'Elasticsearch 7.16.2 config for a cluster

I try to setup a ES cluster with 2 Nodes. Everything works fine without SSL but with the certificates no connection between the 2 Nodes can be made anymore.

cluster.name: elasticsearch-stage
ingest.geoip.downloader.enabled: false
path.data: E:\Elasticsearch-Staging\data
path.logs: E:\Elasticsearch-Staging\logs

network.host: 0.0.0.0
http.port: 9200

discovery.seed_hosts: ["172.16.98.177", "172.16.98.198"]
cluster.initial_master_nodes: ["172.16.98.177"]

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

Master node has: node.name: stage-node-1

Second node has: node.name: stage-node-2

I ran bin/elasticsearch-setup-passwords auto to create the system user passwords.

I ran bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass "" on the master node to create the certificate and copied the certificate and the keystore file to the second node.

I'm able to access http://172.16.98.177:9200/_cluster/state/nodes?pretty which is the master node when I'm connected to the master node.

But when I start the second node it is not able to connect to the master node. Can someone help me out here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source