问题
I have a .Net console project referencing the Apache Ignite Nuget package. I'm interested in running the ignite-rest-http module within this same process. I'm using Apache Ignite 2.0.
I'm referring to the Apache Ignite REST Api as described here: https://apacheignite.readme.io/docs/rest-api
I've tried the "Getting Started":
To enable HTTP connectivity, make sure that ignite-rest-http module is in classpath. With binary distribution this means copying libs\optional\ignite-rest-http to libs\ignite-rest-http.
However, it didn't seem to work. I started my process and went to http://localhost:8080, but there was no response.
Is it appropriate to host the ignite-rest-http module within a .Net process?
If so, is there something else I need to configure in order to host the ignite-rest-http module in a .Net process?
回答1:
NuGet package includes a limited set of JARs required for core functionality. Optional libs are not included (NuGet.org has 30 MB package size limit).
To enable ignite-rest-http with NuGet:
- Download full binary package from https://ignite.apache.org/download.cgi#binaries
- Extract
libs\optional\ignite-rest-http
contents somewhere, sayc:\ignite-rest-http
Provide
IgniteConfiguration.JvmClasspath
property with;
-separated paths to all http JAR filesvar cfg = new IgniteConfiguration { JvmClasspath = Directory.GetFiles(@"c:\ignite-rest-http") .Aggregate((x, y) => x + ";" + y) }; Ignition.Start(cfg); Console.WriteLine(new WebClient().DownloadString("http://localhost:8080/ignite?cmd=version"));
There are plans to include these JARs as a separate NuGet package: https://issues.apache.org/jira/browse/IGNITE-3275
来源:https://stackoverflow.com/questions/44532780/how-do-i-enable-ignite-http-rest-module-when-using-the-net-nuget-apache-ignite