一、Caused by: java.lang.RuntimeException: can not run elasticsearch as root 這個錯誤,是因為使用root用戶啟動elasticsearch,elasticsearch是不允許使用root用戶啟動的,所以我們需要添加用戶。 [r ...
一、Caused by: java.lang.RuntimeException: can not run elasticsearch as root
這個錯誤,是因為使用root用戶啟動elasticsearch,elasticsearch是不允許使用root用戶啟動的,所以我們需要添加用戶。
[root@localhost ~]# adduser elsearch [root@localhost ~]# passwd elsearch [root@localhost ~]# chown -R elsearch:elsearch elasticsearch-7.6.0 [root@localhost ~]# chmod 770 elasticsearch-7.6.0/ # 這一步之後,切換到elsearch用戶,再執行下麵兩條命令。 [root@localhost ~]# cd elasticsearch-7.6.0/ [root@localhost ~]# bin/elasticsearch
二、OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e5330000, 449642496, 0) failed; error='Not enough space' (errno=12); 或者error='Cannot a ...'(errno=12);
原因:jvm要分配最大記憶體超出系統記憶體
解決:
root@localhost ~]# vim /elasticsearch-7.6.0/config/jvm.options # 適當調整指定jvm記憶體,由於虛擬機記憶體制定1g,所以適當降低jvm記憶體指定,這裡改成512m。 -Xms512m -Xmx512m [root@localhost ~]# /elasticsearch-7.6.0/bin/elasticsearch # 重啟elasticsearch
三、org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/www/wwwroot/elasticsearch-7.6.0/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
原因:線程占用
解決:重新啟動
[root@localhost ~]# ps -ef | grep elasticsearch # 找到elasticsearch線程 [root@localhost ~]# kill -9 pid # 殺死elasticsearch線程 [root@localhost ~]# /elasticsearch-7.6.0/bin/elasticsearch # 重啟elasticsearch
https://www.cnblogs.com/sitongyan/p/11263753.html
https://blog.csdn.net/weixin_41238134/article/details/99291917