在安裝過程中只配置了cluster.initial_master_nodes 屬性,沒有配置discovery.seed_hosts
啓動的時候遇到如下倆個錯誤:
[1]: memory locking requested for elasticsearch process but memory is not locked
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解決辦法:
1.在 /etc/security/limits.conf加入一下配置:
es hard memlock unlimited
es soft memlock unlimited
其中es爲我啓動的es的用戶,這個根據實際情況修改
2.運行此命令修改vm限制:sysctl -w vm.max_map_count=262144
啓動無誤後,看日誌出現以下警告:
master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible node
意思就是找不到master節點,每個節點以local模式啓動,此問題找了半天,最後發現是因爲沒有在discovery.seed_hosts中配置master nodes的hosts.