Node Left Cluster After enabling X-Pack

Hello,
I have formed a cluster of 2 Nodes, one is master-data and the other is data. Everything was working perfectly until I decided to enable X-Pack minimal security. Below is the config file for both Nodes. Curling the first node after enabling X-Pack is looking pretty good except that it is now not recognizing the other node

"name" : "Elk-1",
"cluster_name" : "Cyshield",
"cluster_uuid" : "p0M2d0jwR9eRSRPu3cxZNg",
"version" : {
"number" : "7.17.8",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "120eabe1c8a0cb2ae87cffc109a5b65d213e9df1",
"build_date" : "2022-12-02T17:33:09.727072865Z",
"build_snapshot" : false,
"lucene_version" : "8.11.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

root@ubuntu:/etc/kibana# curl -XGET http://192.168.120.23:9200/_cluster/health?pretty -u elastic
Enter host password for user 'elastic':
{
"cluster_name" : "Cyshield",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 13,
"active_shards" : 13,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
root@ubuntu:/etc/kibana# dc /etc/elasticsearch/
dc: Will not attempt to process directory /etc/elasticsearch/
root@ubuntu:/etc/kibana# cd /etc/elasticsearch/
root@ubuntu:/etc/elasticsearch# vi elasticsearch
root@ubuntu:/etc/elasticsearch# vi elasticsearch.yml
root@ubuntu:/etc/elasticsearch# vi elasticsearch.yml
root@ubuntu:/etc/elasticsearch# vi elasticsearch.yml

Config File For the first Node

======================== Elasticsearch Configuration =========================

NOTE: Elasticsearch comes with reasonable defaults for most settings.

Before you set out to tweak and tune the configuration, make sure you

understand what are you trying to accomplish and the consequences.

The primary way of configuring a node is via this file. This template lists

the most important settings you may want to configure for a production cluster.

Please consult the documentation for further information on configuration options:

Elasticsearch Guide | Elastic

---------------------------------- Cluster -----------------------------------

Use a descriptive name for your cluster:

cluster.name: Cyshield

------------------------------------ Node ------------------------------------

Use a descriptive name for the node:

node.name: Elk-1

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:

Curling the other Node is returning this error:

curl -XGET http://192.168.120.24:9200/_cluster/health?pretty -u elastic
Enter host password for user 'elastic':
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "unable to authenticate user [elastic] for REST request [/_cluster/health?pretty]",
"header" : {
"WWW-Authenticate" : "Basic realm="security" charset="UTF-8""
}
}
],
"type" : "security_exception",
"reason" : "unable to authenticate user [elastic] for REST request [/_cluster/health?pretty]",
"header" : {
"WWW-Authenticate" : "Basic realm="security" charset="UTF-8""
}
},
"status" : 401

Here's the Config file for the 2nd node:

---------------------------------- Cluster -----------------------------------

Use a descriptive name for your cluster:

cluster.name: Cyshield

------------------------------------ Node ------------------------------------

Use a descriptive name for the node:

node.name: Elk-2

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:# --Network -----------------------------------

By default Elasticsearch is only accessible on localhost. Set a different

address here to expose this node on the network:

network.host: 192.168.120.24

By default Elasticsearch listens for HTTP traffic on the first free port it

finds starting at 9200. Set a specific HTTP port here:

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: ["192.168.120.23"]

Bootstrap the cluster using an initial set of master-eligible nodes:

cluster.initial_master_nodes: ["Elk-1"]

For more information, consult the discovery and cluster formation module documentation.

---------------------------------- Various -----------------------------------

Require explicit names when deleting indices:

#action.destructive_requires_name: true
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate

BlockquotePreformatted text

Can you please post the ES config using </> code formatter, it's not really very easy to even read as of now ?

1 Like

Any help would me much appreciated

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