Friday 25 September 2015

Change cluster name of elastic search

When you hit the url http://localhost:9200/, you will get following output

{
  "status" : 200,
  "name" : "Maha Yogi",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.7.1",
    "build_hash" : "b88f43fc40b0bcd7f173a1f9ee2e97816de80b19",
    "build_timestamp" : "2015-07-29T09:54:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

As you observe the output, cluster_name is “elasticsearch”, You can change cluster name by editing elasticsearch.yml file. “elasticsearch.yml” file is located in config directory of elastic search installation directory.

Step 1: Stop the elastic search cluster.

Step 2: Update following property in ‘elasticsearch.yml’ file.
cluster.name: "my_cluster"

Step 3: Restart elastic search cluster.

Hit following URL.

You will get output like below.

{
  "status" : 200,
  "name" : "Sise-Neg",
  "cluster_name" : "my_cluster",
  "version" : {
    "number" : "1.7.1",
    "build_hash" : "b88f43fc40b0bcd7f173a1f9ee2e97816de80b19",
    "build_timestamp" : "2015-07-29T09:54:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },

  "tagline" : "You Know, for Search"
}

As you observe cluster name is changed to my_cluster.




Prevoius                                                 Next                                                 Home

No comments:

Post a Comment