How to add multiple nodes in same cluster using elasticsearch.yml file


(Sagar Arora) #1

I am new to elastic search and i want to know how can i setup multiple nodes cluster using the configuration file.


(David Pilato) #2

I'm not sure about your question but basically just start new nodes as you started the first one.

If something is wrong then share your logs and settings.


(Sagar Arora) #3

can you give me a example of the yml file in which you have added two nodes under the same cluster i am not able to do that


(David Pilato) #4

What are the logs?


(Sagar Arora) #5

org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to [9300]]; nested: BindException[Address already in use: bind];
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.5.1.jar:5.5.1]
Caused by: org.elasticsearch.transport.BindTransportException: Failed to bind to [9300]
at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java:793) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java:758) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:173) ~[?:?]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:69) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.transport.TransportService.doStart(TransportService.java:209) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:69) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.node.Node.start(Node.java:692) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:277) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.5.1.jar:5.5.1]
... 6 more
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[?:?]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:554) ~[?:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:980) ~[?:?]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250) ~[?:?]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[?:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) ~[?:?]


(David Pilato) #6

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

You already have a node running on 9300


(Sagar Arora) #7

okay so i cant run on the same tcp port even if i have the same cluster


(Sagar Arora) #8

if i want my ip to be same how should i do that


(David Pilato) #9

For tests only, just keep all defaults and run bin/elasticsearch again


(Sagar Arora) #10

i am using elastic search 5.5.1


(Kran) #11

Is there a way I can increase elasticsearch nodes using AWS CLI or using the ElasticSearch Rest endpoint ?. I have 2 master nodes and 4 client/data nodes. I want to increase the master nodes to 3 and client/data nodes to 5. Appreciate your reply for any references.


(David Pilato) #12

Please open your own thread.

Answer is no. I don't know how AWS CLI is concerned BTW. Elastic Cloud Enterprise is probably able to increase the size of the cluster by calling the REST API though.


(Kran) #13

Sure thanks David for your reply. I will open a new thread


#14

A node is nothing but a new instance of elasticsearch. if you start two instances with same cluster name then it will be a cluster of two nodes. You might have started one instance by unzipping if windows in to a folder and started elasticsearch from bin. Repeat the same. By default the cluster name is 'elasticsearch'. After starting the second instance, if you check the health status of cluster, you can see the number of nodes as 2.


(system) #15

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.