# How to create node using host IPAddress using java library?

**URL:** <https://discuss.elastic.co/t/how-to-create-node-using-host-ipaddress-using-java-library/5233>\
**Category:** Elasticsearch\
**Created:** [August 24, 2011, 7:14am UTC](https://discuss.elastic.co/t/how-to-create-node-using-host-ipaddress-using-java-library/5233 "2011-08-24T07:14:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [August 24, 2011, 7:14am UTC](https://discuss.elastic.co/t/how-to-create-node-using-host-ipaddress-using-java-library/5233/1 "2011-08-24T07:14:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 24, 2011, 6:21pm UTC](https://discuss.elastic.co/t/how-to-create-node-using-host-ipaddress-using-java-library/5233/2 "2011-08-24T18:21:21Z")

</div>

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:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html).

On Wed, Aug 24, 2011 at 10:14 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> I'm install Elasticsearch 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 Elasticsearch using  
> java ?
> 
> Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:56am UTC](https://discuss.elastic.co/t/how-to-create-node-using-host-ipaddress-using-java-library/5233/3 "2017-07-06T03:56:09Z")

</div>


