linux上安裝elasticsearch-6.6.2


1.在linux上安裝jdk8

2.在官網(https://www.elastic.co/downloads/elasticsearch)上下載最新elasticsearch版本,目前的版本是6.6.2,下載地址為:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz

3.進入/usr/local/src路徑:

  • wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz
  • tar -zxvf elasticsearch-6.6.2.tar.gz
  • mv elasticsearch-6.6.2.tar.gz /usr/local

4.創建非root用戶啟動elasticsearch,因為elasticsearch不允許以root用戶啟動

  • groupadd esgroup
  • useradd esuser -g esgroup -p flzx3QC
  • chown -R esuser:esgroup /usr/local/elasticsearch-6.6.2

5.切換到esuser目錄下,並更改es的配置文件

  • su esuser
  • vim conf/elasticsearch.yml   
#放開外網訪問
network.host: 192.168.0.116
#端口號
http.port:9200
#java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed 解決這個異常
bootstrap.system_call_filter: false

6.啟動es,解決如下報錯方式

  • ./bin/elasticsearch  啟動會出現如下三個錯誤:
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1024] for user [esuser] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解決方法:

  問題1: vim /etc/security/limits.conf  文件后面加入:

esuser soft nofile 65536
esuser hard nofile 65536
esuser soft nproc 4096
esuser hard nproc 6096

  問題2:vim /etc/security/limits.d/20-nproc.conf修改 esuser soft nproc 4096

  問題3:vim  /etc/sysctl.conf  追加:vm.max_map_count=655360

  執行下面命令生效:sysctl -p

關閉防火牆:service iptables stop;

如問題還沒解決,需要重啟linux服務器

7.后台進程啟動es:  ./bin/elasticsearch -d

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

安裝Kibana

Kibana是一個針對Elasticsearch的開源分析及可視化平台,使用Kibana可以查詢、查看並與存儲在ES索引的數據進行交互操作,使用Kibana能執行高級的數據分析,並能以圖表、表格和地圖的形式查看數據.

1)下載Kibana,注意其版本要和elasticsearch的版本保持一致

https://www.elastic.co/downloads/kibana

2)把下載好的壓縮包拷貝到/soft目錄下

3)解壓縮,並把解壓后的目錄移動到/user/local/kibana

4)編輯kibana配置文件

vi /usr/local/kibana/config/kibana.yml

將server.host,elasticsearch.url修改成所在服務器的ip地址

5)開啟5601端口

Kibana的默認端口是5601

開啟防火牆:systemctl start firewalld.service

開啟5601端口:firewall-cmd --permanent --zone=public --add-port=5601/tcp

重啟防火牆:firewall-cmd –reload

6)啟動Kibana

[root@localhost /]# /usr/local/kibana/bin/kibana

瀏覽器訪問:http://192.168.0.116:5601

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM