有时候我们需要命令查询ES集群节点状态
curl http://localhost:8200/_cluster/nodes?pretty
结果:
{
"ok" : true, // 集群状态
"cluster_name" : "if2c", //集群名称
"nodes" : {
"bT7UoS9nR4aVowpZ7KSQXQ" : { //节点UID
"name" : "test123", //节点名称
"transport_address" : "inet[10.0.2.226/10.0.2.226:8300]", TCP交流IP及端口
"hostname" : "memcached-2", //机器名称
"version" : "0.90.9", ES版本
"http_address" : "inet[/10.0.2.226:8200]", //HTTP查询端口,为插件提供监控
"attributes" : {
"rack" : "racktest123", //机柜ID,跨机柜部署集群,以防某一个机柜断电影响ES服务
"master" : "true" //是否是主节点
}
}
}
}
curl http://localhost:8200/_cluster/nodes/10.0.2.226?pretty
也可以使用通配符查询
curl http://localhost:8200/_cluster/nodes/10.0.2.2*?pretty
因篇幅问题不能全部显示,请点此查看更多更全内容