0
votes

I installed elasticseaerch in two different machine, both the nodes have same cluster name also i configured another setting in order to have a cluster with two nodes but its not getting connected I don't know why. My elasticsearch version is 7.3 in both nodes and i also have kibana in the same machine with node-1, although both elasticsearch is running fine but not getting connected maybe it is because of security issues because i setup certificate thing in elasticsearch because of sercurity purpose. Please check it out.

THANKS.

node-1 elasticsearch.yml

# Use a descriptive name for your cluster:
#
cluster.name: ElasticsearchStaging
#xpack.security.enabled: true
#xpack.security.audit.enabled: true
#xpack.security.http.ssl.enabled: true
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
node.master: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
path.logs: /var/log/elasticsearch/
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: <internal_ip_node-1>
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: "node-1"
    discovery.seed_hosts:
   - internal_ip_node-1:9200
   - internal_ip_node-2:9200
cluster.initial_master_nodes:
   - node-1
   - node-2
#
# For more information, consult the discovery and cluster formation module documentation.
#
#---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
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
xpack.security.audit.enabled: true
xpack:
  security:
    authc:
      realms:
        native:
          native1:
            order: 0
#xpack.security.audit.enabled: true
#xpack.monitoring.enabled: true
#---------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

node-2 elasticsearch.yml

# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: ElasticsearchStaging
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-2
node.data: true
#
# Add custom attributes to the node:
#
#node.master: false
#node.data: true
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: <internal_ip_node-2>
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: 10.128.0.24
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
    discovery.seed_hosts:
   - internal_ip_node-1:9200
   - internal_ip_node-2:9200
cluster.initial_master_nodes:
   - node-1
   - node-2
# For more information, consult the discovery and cluster formation module documentation.
#discovery.zen.minimum_master_node: 2
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
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
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
1
Please add your Elasticsearch logs. Zen2 is generally pretty good with logging its problems.xeraa

1 Answers

0
votes

There has been breaking changes in version 7.0 of Elasticsearch.

Your zen configuration will no longer work.

breaking changes

Go to the discovery and cluster formation settings section and you will find that the new settings are

  • discovery.seed_hosts
  • cluster.initial_master_nodes

Important discovery and cluster formation settings