elasticsearch启动报错

偏执的太偏执、 2022-05-15 17:07 526阅读 0赞

系统:操作centos7 (虚拟机)

./bin/elasticsearch,启动报错

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

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

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

例如: chown -R es1:es1 searchengine

重启es

继续报错,报错内容如下

  1. 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。

发表评论

表情:
评论列表 (有 0 条评论,526人围观)

还没有评论,来说两句吧...

相关阅读