Terminal:
Tab for each node.
Browser:
Cleanup:
curl -X DELETE localhost:9200
Scripts:
- 01_create_index.rb
- 02_import_documents.rb
- 03_store_document.rb
- 04_change_replicas.rb
[KAREL] Start node 1
Inspect cluster state in Paramedic
[KAREL] Setup index (shards = 3, replicas=0)
Inspect state and stats in Paramedic (CPU spike, shard distribution, split evenly across 3 nodes)
[LUKAS] Start node 2
Inspect cluster node stats in BigDesk
[KAREL] Import 100,000 documents
Paramedic, show CPU spike, HTTP connections increase, ...
Count documents (90,000)
[SHAY] Start node 3
[KAREL] Inspect cluster state in Paramedic
[KAREL] Import another 200,000 documents
[SHAY] Kill node 3
Paramedic, health is _red_
Count documents (~ 60,000)
(We are missing data, but the cluster is operational)
[KAREL] Index new document, `{"title" : "Hello Red Cluster!"}`
[LUKAS] Search for the newly added document, "hello"
[SHAY] Start node 3
Paramedic, health is _green_, data are back (300,001 documents)
* How to add high availability? Add replicas (= copies of the index). *
[LUKAS] Increase `index.number_of_replicas` to 1
... wait for relocation ...
[KAREL] Paramedic, show shard distribution/allocation across shards
(primaries and replicas)
[SHAY] Kill node 3
[KAREL] Paramedic, cluster state is _green_
[SHAY] Launch node 3 again
[KAREL] Show re-allocation of shards
* How to force the shards from a node? Eg. to use it for other index, etc? With allocation excludes *
[LUKAS] curl -XPUT localhost:9200/my_index/_settings -d '{ "index.routing.allocation.exclude._id" : "NODEID" }'
[KAREL] Show nodes missing from node 3 in Paramedic