【问题标题】:How do I enable ignite-http-rest module when using the .Net NuGet Apache Ignite package?使用 .Net NuGet Apache Ignite 包时如何启用 ignite-http-rest 模块?
【发布时间】:2017-06-13 22:47:35
【问题描述】:

我有一个引用 Apache Ignite Nuget 包的 .Net 控制台项目。我有兴趣在同一进程中运行 ignite-rest-http 模块。我正在使用 Apache Ignite 2.0。

我指的是 Apache Ignite REST Api,如下所述: https://apacheignite.readme.io/docs/rest-api

我已经尝试了“入门”:

要启用 HTTP 连接,请确保 ignite-rest-http 模块是 在类路径中。对于二进制分发,这意味着复制 libs\optional\ignite-rest-http 到 libs\ignite-rest-http。

但是,它似乎不起作用。我开始了我的流程并转到http://localhost:8080,但没有任何回应。

在 .Net 进程中托管 ignite-rest-http 模块是否合适?

如果是这样,我是否需要配置其他东西才能在 .Net 进程中托管 ignite-rest-http 模块?

【问题讨论】:

标签: c# ignite


【解决方案1】:

NuGet 包包含一组有限的核心功能所需的 JAR。不包括可选库(NuGet.org 的包大小限制为 30 MB)。

使用 NuGet 启用 ignite-rest-http:

  • 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    • 2019-04-07
    • 2019-06-06
    • 2018-01-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多