centos 7 安裝 elasticsearch,及常見錯誤 Failed to start Elasticsearch....

今天給項目上線,原本運維得工作不知道怎麼跑到我的身上.....
開始主題

一切安裝完畢,準備就緒得時候,突然發現了重要得一茬,這個項目我用搜索引擎 Elasticsearch 
開始 安裝 Elasticsearch 搜索引擎

下載 rpm 包安裝之後(wget 官網下載賊慢,建議直接迅雷下載,再上傳,幾分鐘就完事)

 systemctl start   elasticsearch //啓動完成
 systemctl status  elasticsearch //查看狀態

沒問題,就是外網一直無法訪問,突然腦梗,想起了什麼

vim /etc/elasticsearch/elasticsearch.yml

找到network.host 修改後面得地址(沒有直接添加)
爲 network.host: 0.0.0.0 //0.0.0.0表示允許所有主機訪問,127.0.0.1表示只允許本地訪問

好問題來了,進行這一步之後一直起不起來服務

錯誤日誌如下:
[2019-04-26T03:28:05,915][ERROR][o.e.b.Bootstrap          ] [localhost.localdomain] node validation exception
[4] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [3818] for user [admin] 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]
[4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

在此博客尋得答案
解決elasticsearch配置network.host: 0.0.0.0導致elasticsearch服務啓動不成功的問題

經過此次安裝總結如下(多次實驗,一次性安裝到位)
 

1、官網下載rpm安裝包到服務器:www.elastic.co/downloads/elasticsearch

2、執行安裝命令:

rpm -ivh elasticsearch-6.5.3.rpm
3、調整配置

搜索引擎配置

vim /etc/elasticsearch/elasticsearch.yml
#增加以下配置
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
cluster.initial_master_nodes: ["node-1"]
#調整以下配置
#配置允許訪問搜索引擎的主機:0.0.0.0表示允許所有主機訪問,127.0.0.1表示只允許本地訪問
network.host: 0.0.0.0
#配置搜索引擎端口
http.port: 9200


系統文件配置

vim /etc/security/limits.conf
* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
 
vim /etc/security/limits.d/90-nproc.conf 
soft nproc 2048
 
vi /etc/sysctl.conf
vm.max_map_count=655360
#該文件修改完成後需要執行下面的命令讓上面這行的配置生效
sysctl -p

 

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