Help| setup cluster on same mac

Hello

I want to set up cluster on the same machine I use for development purpose. After going though earlier posts, I found that setting node.max_local_storage_nodes property with >1 creates those many number of nodes locally. I had set the same in Elasticsearch.yml configuration and started the instance and issued a curl as follows

curl -XGET 'localhost:9200/_cluster/health?pretty'

Response:

{
"cluster_name" : "es-cluster",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 35,
"active_shards" : 35,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 34,
"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" : 50.72463768115942
}

the number of nodes is still 1. can anyone help me setup a cluster with say 2 nodes ?

My configuration file Elasticsearch.yml is as follows.

cluster.name: es-cluster
node.max_local_storage_nodes: 2

It works well on my mac with setting this:

network.host: 127.0.0.1
discovery.zen.minimum_master_nodes: 1
node.max_local_storage_nodes: 4

Hello David

I just modified my ES configuration file as you said and restarted the instance. No luck :frowning: . Did I miss anything ? Pls help

"compressed_size_in_bytes" : 28063,
"version" : 21,
"state_uuid" : "3WNzTj_DTzmNPU8OeZz3sg",
"master_node" : "RPAcNRsRSM21qBMpiHIzcQ",
"blocks" : { },
"nodes" : {
"RPAcNRsRSM21qBMpiHIzcQ" : {
"name" : "RPAcNRs",
"ephemeral_id" : "l_6nb1vTSaePqcvRR5Bd6Q",
"transport_address" : "127.0.0.1:9300",
"attributes" : { }
}
},

What are the logs of the second instance you are launching? Please format the logs with the </> icon.

[2019-03-27T21:52:15,085][INFO ][o.e.d.z.ZenDiscovery ] [RPAcNRs] failed to send join request to master [{RPAcNRs}{RPAcNRsRSM21qBMpiHIzcQ}{I3GUBiJDQTCLIzWuKwOAXg}{127.0.0.1}{127.0.0.1:9300}], reason [RemoteTransportException[[RPAcNRs][127.0.0.1:9300][internal:discovery/zen/join]]; nested: IllegalArgumentException[can't add node {RPAcNRs}{RPAcNRsRSM21qBMpiHIzcQ}{n8cs8Preformatted textbB-SEKKgJJ8bAQekw}{127.0.0.1}{127.0.0.1:9301}, found existing node {RPAcNRs}{RPAcNRsRSM21qBMpiHIzcQ}{I3GUBiJDQTCLIzWuKwOAXg}{127.0.0.1}{127.0.0.1:9300} with the same id but is a different node instance]; ]

As you can see, your logs are not correctly formatted.
Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

About your issue, please try again but remove the data dir first. Note that it will remove all existing data but I guess that you are just trying things locally, right?

do i need to delete data dir in both instance ?

I tried it by deleting data dir in 2nd instance...worked like charm :slight_smile:

"nodes" : {
"ZgffNQGDQsmgLdeNvMrjIA" : {
"name" : "ZgffNQG",
"ephemeral_id" : "Divj2iAtT32yBR7MrgvHqg",
"transport_address" : "127.0.0.1:9301",
"attributes" : { }
},
"RPAcNRsRSM21qBMpiHIzcQ" : {
"name" : "RPAcNRs",
"ephemeral_id" : "SaAbszmIRvu3KNIy3cQExQ",
"transport_address" : "127.0.0.1:9300",
"attributes" : { }
}
},

Thanks for your prompt response. :+1:

I'm lost...
Do you have specific dirs for each node?

Yes. Each instance/node had it's own data directory.

So there is no need to use node.max_local_storage_nodes.

Right

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