centos7安裝Elastic

官網(wǎng)下載軟件

https://www.elastic.co/

解壓文件

tar -zxvf elasticsearch-5.6.1.tar.gz -C /usr

重要提示:因?yàn)?Elasticsearch 可以執(zhí)行腳本文件,為了安全性,默認(rèn)不允許通過 root 用戶啟動(dòng)服務(wù)。我們需要新創(chuàng)建用戶名和用戶組啟動(dòng)服務(wù)

修改配置文件

1.默認(rèn)情況下,Elasticsearch 只允許本機(jī)訪問,如果需要遠(yuǎn)程訪問,需要修改其配置文件

vim config/elasticsearch.yml
# 去掉 network.host 前邊的注釋,將它的值改成0.0.0.0
network.host: 0.0.0.0

2.啟動(dòng)報(bào)錯(cuò):max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

#使用root命令行鍵入
ulimit -n 65536

3.啟動(dòng)報(bào)錯(cuò):max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

vim /etc/sysctl.conf
#加入以下配置
vm.max_map_count=262144
保存,并執(zhí)行 sysctl -p

4.啟動(dòng)時(shí)報(bào)錯(cuò):max number of threads [3895] for user [elk] is too low, increase to at least [4096]

/etc/security/limits.d/20-nproc.conf

#修改后的配置文件
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     4096
*          hard    nproc     4096
root       soft    nproc     unlimited

5.啟動(dòng)報(bào)錯(cuò):max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]

vi /etc/security/limits.conf 
添加如下內(nèi)容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

啟動(dòng)服務(wù)

bin/elasticsearch 或 bin/elasticsearch -d # -d 表示后臺(tái)啟動(dòng)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容