簡易elasticsearch服務器搭建
阿新 • • 發佈:2019-03-14
network 後臺運行 swd disco fig add enable trap 系統 1:下載和解壓:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz
2:配置config/elasticsearch.yml
network.host: 10.99.32.16
http.port: 9200
path.logs: /root/elasticsearch/log
path.data: /root/elasticsearch/data
node.name: node-1
cluster.name: mycluster
discovery.zen.ping.unicast.hosts: ["10.99.32.16", "10.99.32.17", "10.99.32.18"]
discovery.zen.minimum_master_nodes: 2
bootstrap.memory_lock: true
3:配置config/jvm.options
4:配置一些系統內核參數: 修改/etc/security/limits.conf
添加:elastic hard nofile 65536
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz
2:配置config/elasticsearch.yml
network.host: 10.99.32.16
http.port: 9200
path.logs: /root/elasticsearch/log
path.data: /root/elasticsearch/data
node.name: node-1
cluster.name: mycluster
discovery.zen.ping.unicast.hosts: ["10.99.32.16", "10.99.32.17", "10.99.32.18"]
bootstrap.memory_lock: true
3:配置config/jvm.options
4:配置一些系統內核參數:
can not run elasticsearch as root:
不能使用root用戶進行操作,需要創建一個用戶,並把原來的目錄的擁有者更改為該用戶
adduser myuser
passwd myuser
chown -R myuser /mypath
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
添加:elastic hard nofile 65536
max file size [67107840] for user [elastic] is too low, increase to [unlimited]
修改/etc/security/limits.conf
elastic soft fsize unlimited
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解決:sysctl -w vm.max_map_count=262144
5:運行:
bin/elasticsearch
後臺運行:bin/elasticsearch -d -p pidFile
會生成一個pidFile文件,記錄pid
隨系統啟動:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
簡易elasticsearch服務器搭建