Non master node not able to join a master node

I'm initializing a cluster with 2 node setup more nodes will be joining the cluster in near future.Both nodes are on different machine.

One node will be a master node with the below configuration:

transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization
path.repo: ["/backups"]
cluster.name: "es-cluster"
node.name: "node-1"
node.master: true
node.data: true
discovery.seed_hosts: ["127.0.0.1", "[::1]"]
cluster.initial_master_nodes: ["node-1"]

Other node being the non master has below configuration:
transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length
path.repo: ["/backups"]
cluster.name: "es-cluster"
node.name: "node-2"
node.master: false
node.data: true
discovery.seed_hosts: ["10.xx.xx.xxx"]

It shows the below message and does not join the cluster.
publish_address {localhost/127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2020-08-13T13:39:56,804][WARN ][o.e.c.c.ClusterFormationFailureHelper] [node-2] master not discovered yet: have discovered [{node-2}{1CebzVMzSZKPg0rAVVEImA}{vt9uwooRRea8Th3ygKokTw}{localhost}{127.0.0.1:9300}{dilrt}{ml.machine_memory=16057425920, xpack.installed=true, transform.node=true, ml.max_open_jobs=20}]; discovery will continue using [10.81.72.243:9300] from hosts providers and from last-known cluster state; node term 0, last-accepted version 0 in term 0

You cannot form a cluster across different machines if the nodes are only listening on localhost. Delete these transport.* lines from your config.

Thank you so much David.It worked.

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