1、can not run elasticsearch as root
解决方法:切换到非root用户
步骤:groupadd elsearch
useradd elsearch -g elsearch -p elsearch
su elsearch
2、main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
解决方法:改变elasticsearch文件夹所有者到当前用户
步骤:sudo chown -R 用户组:用户名 elasticsearch目录
chmod -R 775 elasticsearch目录
如果还是有错误的话,添加permission javax.management.MBeanTrustPermission "register"
nano /usr/java/jdk1.8.0_121/jre/lib/security/java.policy
3、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方法:
sudo vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sudo sysctl -p
4、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解决方法:
sudo vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
sudo vi /etc/pam.d/common-session
添加 session required pam_limits.so
sudo vi /etc/pam.d/common-session-noninteractive
添加 session required pam_limits.so