完整的錯誤信息是: uncaught exception in thread [main]org.elasticsearch.bootstrap.StartupException:
java.lang.IllegalStateException: failed to obtain node locks, tried [[/data/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
尋找主要信息:failed to obtain node locks
簡單理解爲:綁定節點失敗!!!
百度後,好多人同樣遇到了這個問題,導致的原因可能是因爲之前運行的es還沒有正常關閉。
第一步:通過命令:ps aux | grep ‘elastic’ 進行查看
ES可能已經起了兩個進程,把進程kill掉之後重新啓動就可以了。
第二步:通過命令: kill -9 進程號 關閉此進程。
第三步:重新啓動es。./bin/elasticsearch
參考博文:https://blog.csdn.net/curryni/article/details/80580337