Elasticsearch實戰系列(三)--CentOS7下安裝ES

一、步驟

  1. 使用wget命令獲取es的tar包
  2. 解壓該tar包
  3. 運行bin目錄下的elasticserach腳本

二、問題

  1. root賬號不能執行elasticsearch腳本問題,解決方案
    1. 創建一個賬戶,並將解壓後的目錄所有人設置爲該用戶
    2. 切換到該用戶進行啓動ES
  2. 啓動報錯:
  3. ERROR: [4] bootstrap checks failed
          [1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
          [2]: max number of threads [1024] for user [e] 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]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

     

  4. 解決方案:
    1. 修改etc/security/limits.conf文件,在末尾加上
    2. * soft nofile 65536
      * hard nofile 131072
      * soft nproc 4096
      * hard nproc 4096

       

    3. 修改文件/etc/sysctl.conf,在末尾添加
    4. vm.max_map_count=262144 

       

    5. 使用命令使用max_map_count立即生效
      1. sysctl -w vm.max_map_count=262144
    6. 最後修改elasticserach的配置文件elasticserach.yml
      1. 其中第一項需要打開註釋,並修改爲false
      2. 第二項需要自己添加
      3. bootstrap.memory_lock: false
        bootstrap.system_call_filter: false

         

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