Hello, i am trying to build a multiple node cluster on a single instance. I found a useful doc to create multiple elasticsearch nodes on a single instance.
If you want to start multiple nodes on the same machine (for tests purposes) just run:
bin/elasticsearch -Epath.data=data1 -Epath.logs=log1
bin/elasticsearch -Epath.data=data2 -Epath.logs=log2
bin/elasticsearch -Epath.data=data3 -Epath.logs=log3
Without changing anything in the default elasticsearch.yml and you should be done.
Now i would like know few things:
How can we remove nodes from cluster.
Do we need to take any precautions, while we take out them from pool.
When we add multiple elasticsearch nodes, will the loadbalancing happens on its own or we need to make any changes in elasticsearch.yml
How much memory do you have? Asking that as it does not make a lot of sense to do that if you have less than 64+ gb of RAM on your machine.
Why do you want to do this?
I'm not able to understand why are you using single instance for elasticsearch cluster.However, Please find below replies on your query.
How can we remove nodes from cluster.
You can decommission a node by telling the cluster to exclude it from allocation. please follow the below steps for the same.
Here P.P.P.P is the private IP of the master node, you may also use the localhost if elasticsearch is running on localhost . X.X.X.X is the private IP of the node to be removed from the cluster.
This command will give acknowledgementtrue if the node is accepted to be removed and the data relocation will start. Check if the data relocation is over and the node doesn't have any shards left on it, than stop elasticsearch process and stop/terminate the instance.
Please read community link for more reference : https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html
Do we need to take any precautions, while we take out them from pool.
Yes, Please take backup of your data with the help of Snapshot and restore module or you can use curator for the same.
When we add multiple elasticsearch nodes, will the loadbalancing happens on its own or we need to make any changes in elasticsearch.yml
You need the add the IP of your new elasticsearch node in elasticsearch.yml under discovery section and it will be balanced automatically.
My machine capacity is 16 GB 1600 MHz DDR3. I want to test load balance across multiple elasticsearch nodes on a single instance. As part of it, I wanted to check how we can have the nodes removed from the cluster.
@harshbajaj16 Thanks for your suggestions. As i am running all these nodes on a single instance. I have only node names to differentiate them. I gave a try with this to exclude it from the cluster, but no luck. Am I missing something here?
{
"index" : "testlogs-debug-2019.01.25",
"shard" : 3,
"primary" : true,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "NODE_LEFT",
"at" : "2019-02-19T09:21:13.011Z",
"details" : "node_left[jo-5XmbKQ9SsyVJpbaTG3Q]",
"last_allocation_status" : "no_valid_shard_copy"
},
"can_allocate" : "no_valid_shard_copy",
"allocate_explanation" : "cannot allocate because a previous copy of the primary shard existed but can no longer be found on the nodes in the cluster",
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.