How to create node using host IPAddress using java library?


(Sam-4) #1

Hi

I'm install elastic search 0.16.2 on Debian Linux.I want to connect
elastic server which is install Debian machine. 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(true).settings(settings)
.local(true)
.node().start();

Note: “local”meaning that local servers started within the same JVM
will discover themselves and form a cluster.

Linux box IPAddress 192.168.1.100 where elastic server is
install.where I mention to connect Linux box elastic search using
java ?

Thanks


(Shay Banon) #2

If you want to connect to a remote node / cluster, then you should not use
"local". What it means is that a cluster will be formed from the nodes
started within the same JVM, but thats it.

You can either start a Node client or a transport client, that will connect
to the remote node / cluster. Explained here:
http://www.elasticsearch.org/guide/reference/java-api/client.html.

On Wed, Aug 24, 2011 at 10:14 AM, sam mishra.sameek@gmail.com wrote:

Hi

I'm install elastic search 0.16.2 on Debian Linux.I want to connect
elastic server which is install Debian machine. 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(true).settings(settings)
.local(true)
.node().start();

Note: “local”meaning that local servers started within the same JVM
will discover themselves and form a cluster.

Linux box IPAddress 192.168.1.100 where elastic server is
install.where I mention to connect Linux box elastic search using
java ?

Thanks


(system) #3