0
点赞
收藏
分享

微信扫一扫

Apache Ignite 单机脚本启动

参考​​https://www.ignite-service.cn/doc/java/​​

一  启动时指定的配置文件

 在快速度入门中使用的 example-ignite.xml 启动的是内存模式

ignite.bat ..\examples\config\example-ignite.xml

\examples\config 下其他一些配置例子可以参考,下边启动一个使用原生持久化模式

ignite.bat ..\examples\config\persistentstore\example-persistent-store.xml

二 基线拓扑

   按上边脚本启动一个持久化模式服务,使用DBeaver连接创建表报错

Can not perform the operation because the cluster is inactive. Note, that the cluster is considered inactive by default if Ignite Persistent Store is used to let all the nodes join the cluster. To activate the cluster call Ignite.active(true).

原因是: (文档中 集群化-7.2 持久化集群的基线拓扑)如果集群中只要有一个数据区启用了持久化,则首次启动时该集群将处于非激活状态。在非激活状态下,所有操作将被禁止,必须先激活集群然后才能创建缓存和注入数据。集群激活会将当前服务端节点集合设置为基线拓扑。重启集群时,只要基线拓扑中注册的所有节点都加入,集群将自动激活,否则必须手动激活集群

解决方法 使用REST API命令设置服务器状态为激活

三 启用 REST API 

要启用HTTP连接,确保在类路径中包含ignite-rest-http模块,在二进制包中,这意味着将其从IGNITE_HOME/libs/optional/拷贝到IGNITE_HOME/libs中,具体请参见 Ignite配置入门-2.7启用模块。

不需要特别的配置,连接器就会自动启动,然后监听8080端口,可以通过curl检测其是否工作正常

启动成功后通过

查看服务器状态 ​​http://127.0.0.1:8080/ignite?cmd=state​​ ​

修改状态为激活 ​​http://127.0.0.1:8080/ignite?cmd=setstate&state=ACTIVE​​

其他详细命令看文档

举报

相关推荐

0 条评论