Adding a second node to cluster

Hi,

Recently setup elastic on a windows host but performance is being hampered as its only a single node. I have setup a second node but cannot get it to see the cluster. both elasticsearch.yml configs below:

Node 1:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: ELASTIC-NODE1
path.data: D:\6.2.3\data
path.logs: D:\6.2.3\logs
transport.tcp.port: 9300
thread_pool.search.queue_size: 10000
xpack.license.self_generated.type: basic

Node 2:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: ELASTIC-NODE2
path.data: C:\elasticsearch-6.2.3\data
path.logs: C:\elasticsearch-6.2.3\logs
transport.tcp.port: 9300
thread_pool.search.queue_size: 10000

When viewing the nodes in elasticsearchHQ i can only see one node in the cluster...

Any help would be great.

Cheers,

You can't have two nodes run on the same TCP ports. Change Node 2 to 9201/9301.

they are separate machines, does that still need to be run on different ports?

Oh. The they can use the same port :slight_smile:

But

By default, Elasticsearch binds to loopback addresses only — e.g. 127.0.0.1 and [::1]. This is sufficient to run a single development node on a server.

You need to set network.host.

Added this to both hosts (alternate settings on each), restarted services, still showing 1 node :frowning:

network.host: x.x.x.x
discovery.zen.ping.unicast.hosts:

  • 192.168.51.88:9300
  • 192.168.51.89:9300

Are the individual nodes working ok? What do you see if you go to

And where do you see just one node?

Node1: {
"name" : "ELASTIC-NODE1",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "ttkgUDqOREOuISCvmwR_zg",
"version" : {
"number" : "6.2.3",
"build_hash" : "c59ff00",
"build_date" : "2018-03-13T10:06:29.741383Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

Node2:
{
"name" : "ELASTIC-NODE2",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "FvhTHEhFSF-kMeVIobCFBg",
"version" : {
"number" : "6.2.3",
"build_hash" : "c59ff00",
"build_date" : "2018-03-13T10:06:29.741383Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

Looks good... Last thing I would test is making the node names small caps.

Also, can connect with telnet from one machine to the other on port 9200 and 9300?

after applying those values, i cannot connect via elasticsearchhq or kibana, kibana is now prompting for credentials but i havent set any?

You have installed x-pack or maybe the new version of ES comes with x-pack included.

https://www.elastic.co/guide/en/x-pack/6.2/setting-up-authentication.html#bootstrap-elastic-passwords

Or, you have to set xpack.license.self_generated.type: basic on both nodes.

I haven't played too much with ES v6 yet...

Yep, i had to re-install just to get shot of the x-pack, set the configs on both to the below and all is working :slight_smile:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: ELASTIC-NODE1
path.data: D:\6.2.3\data
path.logs: D:\6.2.3\logs
transport.tcp.port: 9300
thread_pool.search.queue_size: 10000
network.host: x.x.x.x
discovery.zen.ping.unicast.hosts:

  • x.x.x.1:9300
  • x.x.x.2:9300

thanks for your help A_B!

Cheers,

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