cd /opt
複製3臺
cp -r elasticsearch-7.6.2 elasticsearch-7.6.2-qiao1
cp -r elasticsearch-7.6.2 elasticsearch-7.6.2-qiao2
cp -r elasticsearch-7.6.2 elasticsearch-7.6.2-qiao3
建立logs data 授權
mkdir logs
mkdir data
chown -R qiao:qiao ./logs
chown -R qiao:qiao ./data
修改配置
vi /opt/elasticsearch-7.6.2-qiao1/config/elasticsearch.yml
vi /opt/elasticsearch-7.6.2-qiao2/config/elasticsearch.yml
vi /opt/elasticsearch-7.6.2-qiao3/config/elasticsearch.yml
cluster.name: qiao-course
node.name: qiao-1
node.master: true
node.data: true
node.max_local_storage_nodes: 3
network.host: 0.0.0.0
http.port: 9201
transport.tcp.port: 9700
discovery.seed_hosts: ["localhost:9700","localhost:9800","localhost:9900"]
cluster.initial_master_nodes: ["qiao-1","qiao-2","qiao-3"]
path.data: /opt/data
path.logs: /opt/logs
cluster.name: qiao-course
node.name: qiao-2
node.master: true
node.data: true
node.max_local_storage_nodes: 3
network.host: 0.0.0.0
http.port: 9202
transport.tcp.port: 9800
discovery.seed_hosts: ["localhost:9700","localhost:9800","localhost:9900"]
cluster.initial_master_nodes: ["qiao-1","qiao-2","qiao-3"]
path.data: /opt/data
path.logs: /opt/logs
cluster.name: qiao-course
node.name: qiao-3
node.master: true
node.data: true
node.max_local_storage_nodes: 3
network.host: 0.0.0.0
http.port: 9203
transport.tcp.port: 9900
discovery.seed_hosts: ["localhost:9700","localhost:9800","localhost:9900"]
cluster.initial_master_nodes: ["qiao-1","qiao-2","qiao-3"]
path.data: /opt/data
path.logs: /opt/logs
4 執行授權
chown -R qiao:qiao /opt/elasticsearch-7.6.2-qiao1
chown -R qiao:qiao /opt/elasticsearch-7.6.2-qiao2
chown -R qiao:qiao /opt/elasticsearch-7.6.2-qiao3
5 日誌檔案授權
cd /opt/elasticsearch-7.6.2-qiao1/logs
chown -R qiao:qiao ./*
cd /opt/elasticsearch-7.6.2-qiao2/logs
chown -R qiao:qiao ./*
cd /opt/elasticsearch-7.6.2-qiao3/logs
chown -R qiao:qiao ./*
設定記憶體
vi /opt/elasticsearch-7.6.2-qiao1/config/jvm.options
-Xms256m
-Xml256m
vi /opt/elasticsearch-7.6.2-qiao2/config/jvm.options
-Xms256m
-Xml256g
vi /opt/elasticsearch-7.6.2-qiao3/config/jvm.options
-Xms256m
-Xml256m
依次啟動
./elasticsearch
訪問3臺 OK
本作品採用《CC 協議》,轉載必須註明作者和本文連結