我的情况是生产环境中,elasticsearch突然崩溃,然后起不来了。
我的日志目录在
vim /var/log/elasticsearch/my-elk-cluster.log
日志信息为Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/data/elk_data/my-elk-cluster]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
解决方法为,找到配置文件,我的目录是
vim /var/log/elasticsearch/my-elk-cluster.log
添加下面代码到配置文件
node.max_local_storage_nodes: 2
然后就可以启动成功了。