一、步驟
- 使用wget命令獲取es的tar包
- 解壓該tar包
- 運行bin目錄下的elasticserach腳本
二、問題
- root賬號不能執行elasticsearch腳本問題,解決方案
- 創建一個賬戶,並將解壓後的目錄所有人設置爲該用戶
- 切換到該用戶進行啓動ES
- 啓動報錯:
-
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
- 解決方案:
- 修改etc/security/limits.conf文件,在末尾加上
-
* soft nofile 65536 * hard nofile 131072 * soft nproc 4096 * hard nproc 4096
- 修改文件/etc/sysctl.conf,在末尾添加
-
vm.max_map_count=262144
- 使用命令使用max_map_count立即生效
- sysctl -w vm.max_map_count=262144
- 最後修改elasticserach的配置文件elasticserach.yml
- 其中第一項需要打開註釋,並修改爲false
- 第二項需要自己添加
-
bootstrap.memory_lock: false bootstrap.system_call_filter: false