Elasticsearch集群应用于ELK:
第一步:做3台Elasticsearch集群:
es1(192.168.0.115)/es2(192.168.0.116)/es3(192.168.0.117)
[root@es1 elasticsearch]# netstat -tulnp | grep 92
tcp6 0 0 192.168.0.115:9200 :::* LISTEN 9852/java
tcp6 0 0 192.168.0.115:9300 :::* LISTEN 9852/java
[root@es1 elasticsearch]# curl 192.168.0.115:9200/_cat/master?v
id host ip node
JAD96f98RKWPhSEszbGSvw 192.168.0.116 192.168.0.116 es2
[root@es1 elasticsearch]# curl -XGET 192.168.0.115:9200/_cluster/health?pretty
{
"cluster_name" : "es-cluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 0,
"active_shards" : 0,
"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
}
[root@es1 elasticsearch]# curl -XGET 'http://192.168.0.115:9200/_cat/nodes?pretty'
192.168.0.117 9 96 2 0.04 0.15 0.13 mdi - es3
192.168.0.116 8 95 3 0.02 0.09 0.07 mdi * es2
192.168.0.115 8 96 4 0.02 0.10 0.08 mdi – es1
[root@es2 elasticsearch]# curl 192.168.0.115:9200/_cat/master?v
id host ip node
JAD96f98RKWPhSEszbGSvw 192.168.0.116 192.168.0.116 es2
[root@es2 elasticsearch]# curl -XGET 192.168.0.115:9200/_cluster/health?pretty
{
"cluster_name" : "es-cluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 0,
"active_shards" : 0,
"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