elasticsearch 7.2 集群节点配置

conf/elasticsearch.yml对其修改,在下面添加修改:

主节点的配置

http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: cluster1
node.name: slave
node.master: true
network.host: 127.0.0.1

配置第二个节点

cluster.name: cluster1
node.name: slave1
network.host: 127.0.0.1
http.port: 8200

配置第三个节点

cluster.name: cluster1
node.name: slave2
network.host: 127.0.0.1
http.port: 7200
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]

 常用查询命令:

查看集群进程状态:

curl -u elastic:{password} -X GET "172.18.54.20:9200/_nodes/stats/process?pretty"

检查集群状态:
curl -u elastic:{password} -X GET "172.18.54.20:9200/_nodes/stats?pretty"

查看ES集群健康状态
curl -u elastic:{password} -X GET "172.18.54.20:9200/_cluster/health?pretty"

curl -u elastic:{password} -X GET "172.18.54.20:9200/_cluster/health?level=indices"

查看指定索引库的健康状态
curl -u elastic:{password} -X GET "172.18.54.20:9200/_cluster/health/{indexName}?pretty"

posted @ 2019-07-25 16:52  李小加  阅读(1915)  评论(0编辑  收藏  举报