centos 7安裝elastic、kibana 并發(fā)放外網(wǎng).

下載 & 解壓

# can not run elasticsearch as root 

adduer elk
su elk
cd ~

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.0-linux-x86_64.tar.gz

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.13.0-linux-x86_64.tar.gz



tar -zxvf elasticsearch-7.13.0-linux-x86_64.tar.gz
tar -zxvf  kibana-7.13.0-linux-x86_64.tar.gz

啟動

elasticsearch-7.13.0/bin/elasticsearch -d
nohup  kibana-7.13.0-linux-x86_64/bin/kibana &

curl http://localhost:9300/
http://localhost:5601

開啟遠程訪問端口

vi /home/elk/elasticsearch-7.13.0/config/elasticsearch.yml
network.host: 39.96.*.* # 注意阿里云內(nèi)網(wǎng)IP
vi /home/elk/kibana-7.13.0-linux-x86_64/config/kibana.yml 
server.host: "0.0.0.0"


# 使用kill 進行重啟

iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5601 -j ACCEPT

note: 阿里云記得開放安全端口

啟動失敗,檢查沒有通過,報錯

[2018-05-18T17:44:59,658][INFO ][o.e.b.BootstrapChecks    ] [gFOuNlS] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

切換到root用戶

編輯 /etc/security/limits.conf,追加以下內(nèi)容;
* soft nofile 65536
* hard nofile 65536
此文件修改后需要重新登錄用戶,才會生效
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

編輯 /etc/sysctl.conf,追加以下內(nèi)容:
vm.max_map_count=655360
保存后,執(zhí)行:
sysctl -p

重新啟動,成功。
bin/elasticsearch -d

總結(jié)

問題一大堆,如果是測試環(huán)境還是用docker 吧。

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

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

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