天天看點

ELK搭建過程中出現的問題與解決方法彙總

搭建過程中出現的問題

elasticsearch啟動過程中報錯【1】

ERROR: [1] bootstrap checks failed
[1]: 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
[2019-06-03T07:05:44,761][INFO ][o.e.n.Node               ] [hz] stopping ...
[2019-06-03T07:05:44,788][INFO ][o.e.n.Node               ] [hz] stopped
[2019-06-03T07:05:44,788][INFO ][o.e.n.Node               ] [hz] closing ...
[2019-06-03T07:05:44,801][INFO ][o.e.n.Node               ] [hz] closed
[2019-06-03T07:05:44,804][INFO ][o.e.x.m.p.NativeController] [hz] Native controller process has stopped - no new native processes can be started
           

解決辦法

#修改config/elasticsearch.yml下約第23行,放開node.name注釋,可更改名稱
node.name: node-1
           

elasticsearch啟動過程中報錯【2】

ERROR: [1] bootstrap checks failed
[1]: 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
           
#打開第68行注釋,ip替換host1等,多節點請添加多個ip位址,單節點可寫按預設來
#配置以下三者,最少其一
#[discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes]
cluster.initial_master_nodes: ["node-1"] #這裡的node-1為node-name配置的值
           

無法通過外部ip通路elasticsearch

#修改config/elasticsearch.yml下約第55行,修改為目前es位址或0.0.0.0
network.host: 0.0.0.0
           
Failed to clear cache for realms [[]]
           

暫無解決辦法,官方github上已經有人提issue了

[status][plugin:[email protected]] Status changed from yellow to green - Ready
           

這個問題隻會出現在單體ELK中,無需理會

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

解決辦法:

臨時解決辦法:切換root使用者執行如下指令

# sysctl -w vm.max_map_count=262144
           

永久解決辦法:在 /etc/sysctl.conf檔案最後添加一行

# echo "vm.max_map_count=262144" >> /etc/sysctl.conf
# sysctl -p  #使修改立即生效
           

檢視修改結果:

# sysctl -a|grep vm.max_map_count
           

顯示:

vm.max_map_count = 262144
           
ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked
           

這是因為設定了鎖定記憶體參數bootstrap.memory_lock=true,這裡給出本人之前的筆記連結https://www.cnblogs.com/hellxz/p/11009634.html

docker版本的資料目錄與日志目錄持載到本地無法啟動,提示

Permission Denied

添加容器環境變量

TAKE_FILE_OWNERSHIP=true

未完待續