Cluster APIs:

Elasticsearch集群状态查询

cat:
# curl -XGET ‘localhost:9200/_cat/master?v&pretty’
id host ip node
P3rb2XyFQqaedsDWA0qfpw 10.0.0.152 10.0.0.152 kvm3

查看可以使用那些参数:
# curl -XGET ‘http://10.0.0.150:9200/_cat/master?help’
id | | node id
host | h | host name
ip | | ip address
node | n | node name
查询那些参数:
# curl -XGET ‘http://10.0.0.150:9200/_cat/master?h=id,host&v’
id host
P3rb2XyFQqaedsDWA0qfpw 10.0.0.152

health:
# curl -XGET http://node1:9200/_cluster/health?pretty
{
“cluster_name” : “my-es”,
“status” : “green”,
“timed_out” : false,
“number_of_nodes” : 4,
“number_of_data_nodes” : 4,
“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
}

# curl -XGET http://node1:9200/_cluster/state/nodes?pretty
{
“cluster_name” : “my-es”,
“compressed_size_in_bytes” : 377,
“nodes” : {
“v5fbDisBRKysdv5xzk_oUw” : {
“name” : “node4”,
“ephemeral_id” : “NzR05TiARwqWteyKxEOFDw”,
“transport_address” : “172.16.1.7:9300”,
“attributes” : { }
},
“I7zi9t-ZQ7yo_sqX-nx8lA” : {
“name” : “node1”,
“ephemeral_id” : “542felffSgaZN4KkcMi7ZQ”,
“transport_address” : “172.16.1.4:9300”,
“attributes” : { }
},
“gLQRgfkaSqirjIQ4WKfxBg” : {
“name” : “node3”,
“ephemeral_id” : “qaBACZJnQD6haTNlz9iLqA”,
“transport_address” : “172.16.1.6:9300”,
“attributes” : { }
},
“te0emhQ6SGifU2sHvzMkcg” : {
“name” : “node2”,
“ephemeral_id” : “hXduXX1gTzaC31rSxfQGoQ”,
“transport_address” : “172.16.1.5:9300”,
“attributes” : { }
}
}
}
# curl -XGET ‘http://node1:9200/_cluster/state?human&pretty’
{
“cluster_name” : “my-es”,
“compressed_size” : “377b”,
“compressed_size_in_bytes” : 377,
“version” : 5,
“state_uuid” : “ybIQouw0Q3icCXA7IK9Fcg”,
“master_node” : “te0emhQ6SGifU2sHvzMkcg”,
“blocks” : { },
“nodes” : {
“v5fbDisBRKysdv5xzk_oUw” : {
“name” : “node4”,
“ephemeral_id” : “NzR05TiARwqWteyKxEOFDw”,
“transport_address” : “172.16.1.7:9300”,
“attributes” : { }
},
“I7zi9t-ZQ7yo_sqX-nx8lA” : {
“name” : “node1”,
“ephemeral_id” : “542felffSgaZN4KkcMi7ZQ”,
“transport_address” : “172.16.1.4:9300”,
“attributes” : { }
},
“gLQRgfkaSqirjIQ4WKfxBg” : {
“name” : “node3”,
“ephemeral_id” : “qaBACZJnQD6haTNlz9iLqA”,
“transport_address” : “172.16.1.6:9300”,
“attributes” : { }
},
“te0emhQ6SGifU2sHvzMkcg” : {
“name” : “node2”,
“ephemeral_id” : “hXduXX1gTzaC31rSxfQGoQ”,
“transport_address” : “172.16.1.5:9300”,
“attributes” : { }
}
},
“metadata” : {
“cluster_uuid” : “ztbrsCPrTJyra6pbp9zODA”,
“templates” : { },
“indices” : { },
“index-graveyard” : {
“tombstones” : [ ]
}
},
“routing_table” : {
“indices” : { }
},
“routing_nodes” : {
“unassigned” : [ ],
“nodes” : {
“te0emhQ6SGifU2sHvzMkcg” : [ ],
“v5fbDisBRKysdv5xzk_oUw” : [ ],
“I7zi9t-ZQ7yo_sqX-nx8lA” : [ ],
“gLQRgfkaSqirjIQ4WKfxBg” : [ ]
}
},
“restore” : {
“snapshots” : [ ]
},
“snapshot_deletions” : {
“snapshot_deletions” : [ ]
},
“snapshots” : {
“snapshots” : [ ]
}
}
state:
# curl -XGET ‘http://node1:9200/_cluster/state/<metric>?pretty’
{
“cluster_name” : “my-es”,
“compressed_size_in_bytes” : 377
}
stats:
# curl -XGET ‘http://node1:9200/_cluster/stats?pretty’
{
“_nodes” : {
“total” : 4,
“successful” : 4,
“failed” : 0
},
“cluster_name” : “my-es”,
“timestamp” : 1526480418944,
“status” : “green”,
“indices” : {
“count” : 0,
“shards” : { },
“docs” : {
“count” : 0,
“deleted” : 0
},
“store” : {
“size_in_bytes” : 0
},
“fielddata” : {
“memory_size_in_bytes” : 0,
“evictions” : 0
},
“query_cache” : {
“memory_size_in_bytes” : 0,
“total_count” : 0,
“hit_count” : 0,
“miss_count” : 0,
“cache_size” : 0,
“cache_count” : 0,
“evictions” : 0
},
“completion” : {
“size_in_bytes” : 0
},
“segments” : {
“count” : 0,
“memory_in_bytes” : 0,
“terms_memory_in_bytes” : 0,
“stored_fields_memory_in_bytes” : 0,
“term_vectors_memory_in_bytes” : 0,
“norms_memory_in_bytes” : 0,
“points_memory_in_bytes” : 0,
“doc_values_memory_in_bytes” : 0,
“index_writer_memory_in_bytes” : 0,
“version_map_memory_in_bytes” : 0,
“fixed_bit_set_memory_in_bytes” : 0,
“max_unsafe_auto_id_timestamp” : -9223372036854775808,
“file_sizes” : { }
}
},
“nodes” : {
“count” : {
“total” : 4,
“data” : 4,
“coordinating_only” : 0,
“master” : 4,
“ingest” : 4
},
“versions” : [
“6.2.2”
],
“os” : {
“available_processors” : 7,
“allocated_processors” : 7,
“names” : [
{
“name” : “Linux”,
“count” : 4
}
],
“mem” : {
“total_in_bytes” : 6954205184,
“free_in_bytes” : 1651277824,
“used_in_bytes” : 5302927360,
“free_percent” : 24,
“used_percent” : 76
}
},
“process” : {
“cpu” : {
“percent” : 0
},
“open_file_descriptors” : {
“min” : 197,
“max” : 251,
“avg” : 211
}
},
“jvm” : {
“max_uptime_in_millis” : 1180197,
“versions” : [
{
“version” : “1.8.0_171”,
“vm_name” : “OpenJDK 64-Bit Server VM”,
“vm_version” : “25.171-b10”,
“vm_vendor” : “Oracle Corporation”,
“count” : 4
}
],
“mem” : {
“heap_used_in_bytes” : 579857800,
“heap_max_in_bytes” : 4233953280
},
“threads” : 95
},
“fs” : {
“total_in_bytes” : 72955723776,
“free_in_bytes” : 67584700416,
“available_in_bytes” : 67584700416
},
“plugins” : [ ],
“network_types” : {
“transport_types” : {
“netty4” : 4
},
“http_types” : {
“netty4” : 4
}
}
}
}
节点状态:
# curl -XGET ‘node1:9200/_nodes/states?pretty’
{
“_nodes” : {
“total” : 0,
“successful” : 0,
“failed” : 0
},
“cluster_name” : “my-es”,
“nodes” : { }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值