Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hugo53/6bed2263b26899be71d94ae0d5deeaa2 to your computer and use it in GitHub Desktop.
Save hugo53/6bed2263b26899be71d94ae0d5deeaa2 to your computer and use it in GitHub Desktop.
Elasticsearch Cluster

Node 1

IP: 192.168.33.10

cluster_name: dinhhoanglong91
node.name: node-vagrant-1
node.master: true
network.host: 192.168.33.10
discovery.zen.ping.unicast.hosts: ["192.168.33.10", "192.168.33.20"]

Node 2

IP: 192.168.33.20

cluster_name: dinhhoanglong91
node.name: node-vagrant-2
network.host: 192.168.33.20
discovery.zen.ping.unicast.hosts: ["192.168.33.10", "192.168.33.20"]

Result

Shards

$ curl -XGET 192.168.33.10:9200/_cat/shards
blogs 1 p STARTED 2 9.4kb 192.168.33.10 node-vagrant   
blogs 1 r STARTED 2 6.4kb 192.168.33.20 node-vagrant-2 
blogs 0 p STARTED 0 3.2kb 192.168.33.10 node-vagrant   
blogs 0 r STARTED 0 3.2kb 192.168.33.20 node-vagrant-2

Cluster health

$ curl -XGET 192.168.33.10:9200/_cluster/health?pretty
{
  "cluster_name" : "dinhhoanglong91",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 2,
  "active_primary_shards" : 2,
  "active_shards" : 4,
  "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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment