使用.Net NuGet Apache Ignite软件包时,如何启用ignite-http-rest模块? [英] How do I enable ignite-http-rest module when using the .Net NuGet Apache Ignite package?

查看:57
本文介绍了使用.Net NuGet Apache Ignite软件包时,如何启用ignite-http-rest模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

I'm referring to the Apache Ignite REST Api as described here: https://apacheignite.readme.io/docs/rest-api

我尝试了入门":

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

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.

但是,它似乎没有用.我开始了我的过程,然后转到 http://localhost:8080 ,但是没有任何响应.

However, it didn't seem to work. I started my process and went to http://localhost:8080, but there was no response.

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

Is it appropriate to host the ignite-rest-http module within a .Net process?

如果是这样,我还需要配置其他内容以将ignite-rest-http模块托管在.Net进程中吗?

If so, is there something else I need to configure in order to host the ignite-rest-http module in a .Net process?

推荐答案

NuGet软件包包括一组有限的JAR,这些JAR都是核心功能所必需的.不包括可选库(NuGet.org的程序包大小限制为30 MB).

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).

要通过NuGet启用ignite-rest-http:

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

已计划将这些JAR作为单独的NuGet软件包包括在内: https://issues.apache.org/jira/browse/IGNITE-3275

There are plans to include these JARs as a separate NuGet package: https://issues.apache.org/jira/browse/IGNITE-3275

这篇关于使用.Net NuGet Apache Ignite软件包时,如何启用ignite-http-rest模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆