ElasticSearch学习(4)--ElasticSearch启动时的各种报错

ElasticSearch启动时的各种报错

【1】expecting token of type [START_OBJECT] but found [VALUE_STRING]]; 
报错详细信息:

SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ParsingException[Failed to parse object: expecting token of type [START_OBJECT] but found [VALUE_STRING]]; 
ElasticSearch学习(4)--ElasticSearch启动时的各种报错_第1张图片
错误原因:elasticsearch.yml 文件内部错误 
解决办法:仔细检查yml文件中的配置项书写格式: (空格)name:(空格)value

【2】 can not run elasticsearch as root 
报错详细信息

[] uncaught exception in thread [main] 
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root 
错误原因:es设置了保护机制,禁止使用root账号进行操作,因为root的权限比较高,对系统的内存什么的会有所难以把控 
解决办法:创建一个用户,并为这个用户分配es目录的权限

adduser ela             #创建用户,命名ela
passwd ela              #设置ela的密码
输入两次密码
chown -R ela /es的目录   #为ela用户赋予es软件目录的权限
su ela                  #从root用户下切换至ela用户
cd /es的目录/bin         #进入es目录
./elasticsearch         #启动es
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

【3】: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536] 
【4】: max number of threads [1024] for user [es] is too low, increase to at least [4096] 
【5】: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

报错详细信息:这个属于bootstrap checks failed报错大类中的几个,所以没什么详细描述 
这里写图片描述
错误原因:系统设置错误,系统为es分配的配置不够 
解决办法:(如果还报这个错误就说明分配的大小还需要调整,依据报错信息来,因为es在不断地更新,未来要求的内存大小可能更高,我猜的>_<)

切换到root用户    
1、vi /etc/security/limits.conf 修改如下配置
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

2、vi /etc/security/limits.d/90-nproc.conf   修改如下配置
* soft nproc 2048

3、vi /etc/sysctl.conf 添加配置
vm.max_map_count=655360 
运行命令 sysctl -p
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

【6】system call filters failed to install; 
报错详细信息:

system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

错误原因:Centos6不支持SecComp,而高版本ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动 
解决办法: 
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

你可能感兴趣的:(数据库)