[ElasticSearch]5.x版本安裝

ElasticSearch5.x 安裝

1.java8,安裝 ES5.x 版本必須要有 java 8的環境;
2.下載 ElasticSearch5.x,使用以下命令進行下載。可以去官網進行下載,本篇文章安裝的是5.6.3版本;

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.tar.gz
tar -xvf elasticsearch-5.6.3.tar.gz
cd elasticsearch-5.6.3/bin
./elasticsearch

安裝成功後會出現輸入在瀏覽器輸入localhost:9200,出現以下信息說明安裝成功。

現在有一個問題,現在在本地環境下可以對 ES 進行訪問,但是我們怎樣從其它機器來訪問它了,修改兩個地方:
1. 修改config/elasticsearch.yml, network.host修改爲0.0.0.0
2. 修改/etc/sysconfig/iptables,開啓9200端口,重啓防火牆(service iptables restart)

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

這樣,你就可以使用ip-address:9200進行訪問了,ip-address指的是你電腦的 ip 地址。

安裝過程遇見問題

1.max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
root 用戶編輯 vim /etc/security/limits.conf 文件, 添加以下內容

*   hard    nofile  65536

2.max number of threads [1024] for user [henry] is too low, increase to at least [2048]

root 用戶編輯 vim /etc/security/limits.d/90-nproc.conf 修改以下內容

*          soft    nproc     2048

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

root 用戶編輯 vim /etc/sysctl.conf 添加以下內容

vm.max_map_count=262144

並執行命令 sysctl -p

4.system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
henry 用戶編輯 vim config/elasticsearch.yml 文件, 添加以下內容

bootstrap.system_call_filter: false

可能需要重啓服務器, 然後重啓 ES 服務. 在外部通過瀏覽器訪問 http://ip-address:9200, 如果看到如上圖圖所示的輸出, 那麼說明你配置成功啦!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章