Adding node locally for dev on macos

I'm trying to run a local dev cluster with two nodes. I know ideally three is recommended but I'm troubleshooting the network errors that I'm getting. I may be confusing myself with the transport ssl certs for the cluster. However, I copied the master cert-stack and shared it to data node that I'm adding to the cluster. In the docs states you could create cert per node but in a cluster, master node provisions the security for cluster of nodes. Hence, security xpack would then be false and perhaps isn't a best security practice to share the master-cert-stack with data node in production. There error that I'm getting is (master node)

[node-ma] failed to validate incoming join request from node [{node-1-dev}{_tMuNjv3RA2pOxhDe6ykjQ}{g0-XxZVUQx-dYNm_YF1kpQ}{localhost}{127.0.0.1:9301}{xpack.installed=true}]
org.elasticsearch.transport.NodeNotConnectedException: [node-1-dev][127.0.0.1:9301] Node not connected
 at org.elasticsearch.transport.ConnectionManager.getConnection(ConnectionManager.java:151) ~[elasticsearch-7.1.1.jar:7.1.1]
 at org.elasticsearch.transport.TransportService.getConnection(TransportService.java:558) ~[elasticsearch-7.1.1.jar:7.1.1]
 at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:530) [elasticsearch-7.1.1.jar:7.1.1]
 

data node error logs

 [2019-06-10T16:19:36,789][INFO ][o.e.c.c.JoinHelper] [node-1-dev] failed to join {node-ma}{1D9FZ5aoQF2qnxEUtiikLw}{1dvQIpVtRTiwA2xoMnOl-w}{localhost}{127.0.0.1:9300}
{ml.machine_memory=17179869184, ml.max_open_jobs=20, xpack.installed=true} with JoinRequest{sourceNode={node-1-dev}{_tMuNjv3RA2pOxhDe6ykjQ}{g0-XxZVUQx-dYNm_YF1kpQ}{localhost}{127.0.0.1:9301}
{xpack.installed=true}, optionalJoin=Optional[Join{term=818, lastAcceptedTerm=2, lastAcceptedVersion=18, sourceNode={node-1-dev}
{_tMuNjv3RA2pOxhDe6ykjQ}{g0-XxZVUQx-dYNm_YF1kpQ}{localhost}{127.0.0.1:9301}
{xpack.installed=true}, targetNode={node-ma}{1D9FZ5aoQF2qnxEUtiikLw{1dvQIpVtRTiwA2xoMnOl-w}{localhost}{127.0.0.1:9300}{ml.machine_memory=17179869184, ml.max_open_jobs=20, xpack.installed=true}}]}

master node elasticsearch.yml

 cluster.name: local-dev
 node.name: node.ma
 node.master: true
 node.data: true
 node.ingest: false
 node.ml: false
 network.host: localhost
 transport.tcp.port: 9300
 discovery.zen.ping.unicast.hosts: ["localhost:9301"]
 discovery.zen.minimum_master_nodes: 1
 xpack.security.enabled: true 
 xpack.security.transport.ssl.enabled: true
 xpack.security.transport.ssl.verification_mode: certificate
 xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
 xpack.security.transport.ssl.truststore.path: elastic-certificates.p12    

data node elastisearch.yml

 cluster.name: local-dev
 node.name: node-1-dev
 node.master: false
 node.data: true
 node.ingest: false
 node.ml: false
 network.host: localhost
 transport.tcp.port: 9301 
 discovery.zen.ping.unicast.hosts: ["localhost:9300"] 
 discovery.zen.minimum_master_nodes: 1
  xpack.security.enabled: true 
  xpack.security.transport.ssl.enabled: true
  xpack.security.transport.ssl.verification_mode: certificate
  xpack.security.transport.ssl.keystore.path: elastic-stack-certificates-master.p12
  xpack.security.transport.ssl.truststore.path: elastic-stack-certificates-master.p12

Ok I have fixed this. The problem was that I did not add to the elasticsearch.yml

  network.host: _local_ 
  cluster.initial_master_nodes: ["node-ma"]
  discovery.zen.ping.unicast.hosts:["localhost"]
  xpack.security.enabled: true

and cp cert from master to data-node

for the master node I removed the discovery and changed network_host: local , commented out transport.tcp.port, discovery.zen.minimum_master_nodes: 1 didn't need it for a two node anything 3 nodes or bigger will need this settings
for local dev discovery is local by default

This was for testing purposes to keep the cost of dev to a bare minimum while learning. The dev was local.

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