1. 程式人生 > >elasticsearch 6.3.2 + Ubuntu16.04 Ubuntu18.04 叢集搭建問題一覽

elasticsearch 6.3.2 + Ubuntu16.04 Ubuntu18.04 叢集搭建問題一覽

配置3個節點的elasticsearch叢集,遇到問題如下:

  • 問題一
ERROR: bootstrap checks failed
      max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解決辦法:修改 /etc/sysctl.conf ,新增: vm.max_map_count=262144,sudo sysctl -p使修改生效,重啟ES

  • 問題二
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]

解決辦法: 修改/etc/security/limits.conf,通過新增:

es soft nofile 65536

es hard nofile 131072

es  soft nproc 2048
es hard nproc 4096

這裡es代表你當前的Ubuntu使用者,退出當前登入使用者重新登入即可

  • 問題三:
    即使修改了上面的內容但是不生效的問題:
    使用ulimit -a檢視修改是否生效,發現沒有生效。
    使用ulimit -n 65535修改報ulimit: open files: cannot modify limit: Operation not permitte錯誤:
    使用如下方法解決:
su - es 進入es使用者,
然後 ulimit -a檢視修改,此時應該是已生效的狀態
以後每次啟動節點都需要:su -  es
  • 問題四: es叢集啟動後:with the same id but is a different node instance

由於node3 是複製node2的配置,需要將node3 es目錄下的data目錄刪掉