简体   繁体   中英

How do I enable ignite-http-rest module when using the .Net NuGet Apache Ignite package?

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?

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, say c:\\ignite-rest-http
  • Provide IgniteConfiguration.JvmClasspath property with ; -separated paths to all http JAR files

     var 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM