2017-06-13 74 views
1

我有一個引用Apache Ignite Nuget包的.Net控制檯項目。我有興趣在這個過程中運行ignite-rest-http模塊。我正在使用Apache Ignite 2.0。如何在使用.Net NuGet Apache Ignite軟件包時啓用ignite-http-rest模塊?

我指的是Apache的點燃REST API如下所述: https://apacheignite.readme.io/docs/rest-api

我已經試過了 「入門」:

要啓用HTTP連接,確保ignite-在classpath中rest-http模塊是 。使用二進制分發,這意味着將libs \ optional \ ignite-rest-http複製到libs \ ignite-rest-http。

但是,它似乎沒有工作。我開始了我的過程並去了http://localhost:8080,但沒有迴應。

在.Net進程中託管ignite-rest-http模塊是否合適?

如果是這樣,是否還需要配置其他東西才能在.Net進程中託管ignite-rest-http模塊?

+0

你試過從REST API的東西嗎?例如curl http:// localhost:8080/ignite?cmd = version。你的答案是哪個http代碼? –

回答

2

NuGet軟件包包含核心功能所需的一組有限的JAR。不包含可選的庫(NuGet.org有30 MB的包大小限制)。

要啓用的Ignite-休息-HTTP具有的NuGet:從https://ignite.apache.org/download.cgi#binaries

  • 提取libs\optional\ignite-rest-http內容某處

    • 下載完整的二進制軟件包,說c:\ignite-rest-http
    • ; - 分隔路徑都提供IgniteConfiguration.JvmClasspath財產http JAR文件

      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")); 
      

    有計劃包括這些JAR作爲一個獨立的NuGet包:https://issues.apache.org/jira/browse/IGNITE-3275

  • 相關問題