elasticsearch 启动报错 Exception in thread "main" java.nio.file.AccessDeniedException:

系统:操作centos7 (虚拟机)

./bin/elasticsearch,启动报错

[es1@es1 software]$ ./elasticsearch-6.3.1/bin/elasticsearch
Exception in thread "main" java.nio.file.AccessDeniedException: /home/es1/software/elasticsearch-6.3.1/config/jvm.options
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
	at java.nio.file.Files.newInputStream(Files.java:152)
	at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:58)

错误原因:使用非 root用户启动ES,而该用户的文件权限不足而被拒绝执行。

解决方法: chown -R 用户名:用户名 文件(目录)名

例如: chown -R es1:es1 searchengine

重启es

继续报错,报错内容如下

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

将处理器核心数改成2,重启后可正常运行。若不成功,将处理器数量也改成2。

在虚拟机的设置中,将处理器的处理器核心数量改成2,重新执行启动命令后,能够正常运行。若还是未能执行成功,可进一步将处理器数量也改成2。

猜你喜欢

转载自blog.csdn.net/ka3p06/article/details/83748277