简体   繁体   English

如何连接其他机器安装弹性搜索服务器?

[英]how to connect other machine install Elastic search server?

I'm install elastic search 0.16.2 on Debian Linux.I want to connect elastic server which is install Debian box. 我在Debian Linux上安装了弹性搜索0.16.2,我想连接安装Debian盒子的弹性服务器。 previously I install elastic server in my machine.for creating node i used following code: 以前我在机器上安装了弹性服务器。为了创建节点,我使用了以下代码:

 Settings settings = ImmutableSettings.settingsBuilder() 
                                .put("index.number_of_shards",1) 
                                .build(); 
       Node node = NodeBuilder.nodeBuilder() 
                                .client(false).settings(settings) 
                                .local(false) 
                                .node().start(); 

Note: “local”meaning that local servers started within the same JVM will discover themselves and form a cluster. 注意:“ local”表示在同一JVM中启动的本地服务器将发现自己并形成集群。

Linux box IPAddress 192.168.1.100 where elastic server is install.where I do changes to connect Linux box elastic search server using java ? Linux盒IPAddress 192.168.1.100哪里安装了弹性服务器。我在哪里更改以使用Java连接Linux盒弹性搜索服务器? Thanks 谢谢

Do you mean to connect via the transport client? 您是要通过传输客户端进行连接吗?

Then this should do it (not sure if you really need to specify the cluster): 然后应该这样做(不确定是否确实需要指定集群):

Settings s = ImmutableSettings.settingsBuilder().put("cluster.name", cluster).build();
TransportClient client = new TransportClient(s);
client.addTransportAddress(new InetSocketTransportAddress(url, port));

But be sure that ElasticSearch cannot be searched from the rest of the world :) 但是请确保无法从世界其他地方搜索ElasticSearch :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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