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:配置一些系統(tǒng)內(nèi)核參數(shù):
can not run elasticsearch as root:
不能使用root用戶(hù)進(jìn)行操作,需要?jiǎng)?chuàng)建一個(gè)用戶(hù),并把原來(lái)的目錄的擁有者更改為該用戶(hù)
adduser myuser
passwd myuser
chown -R myuser /mypath
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
修改/etc/security/limits.conf
添加: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:運(yùn)行:
bin/elasticsearch
后臺(tái)運(yùn)行:bin/elasticsearch -d -p pidFile
會(huì)生成一個(gè)pidFile文件,記錄pid
隨系統(tǒng)啟動(dòng):
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。