启动脚本
集群名称、节点名称、日志目录、文件目录、http端口、tcp端口
/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/bin/elasticsearch -E cluster.name=es-cluster -E node.name=node-1 -E path.logs=/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/logs1 -E path.data=/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/data1 -E http.port=9201 -E transport.port=9301 -d
/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/bin/elasticsearch -E cluster.name=es-cluster -E node.name=node-2 -E path.logs=/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/logs2 -E path.data=/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/data2 -E http.port=9202 -E transport.port=9302 -d
/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/bin/elasticsearch -E cluster.name=es-cluster -E node.name=node-3 -E path.logs=/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/logs3 -E path.data=/opt/module/elastic/elsaticsearch/cluster/elasticsearch-7.12.0/data3 -E http.port=9203 -E transport.port=9303 -d
es配置文件
network.host: 192.168.94.151
discovery.seed_hosts: ["192.168.94.151:9301","192.168.94.151:9302","192.168.94.151:9303"]
# 启动成功后,注释此配置
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]
查看节点
GET /_cat/nodes