I get this error when i tried to run elasticsearch.
Exception in thread "main" java.nio.file.AccessDeniedException: /home/supportdev/elasticsearch-6.5.4/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:60)
here is the error while running elasticsearch server...
[aadil@oc4733723867 elasticsearch-6.6.0]$ ./bin/elasticsearch
Exception in thread "main" java.nio.file.AccessDeniedException: /home/aadil/Downloads/Elastic_Stack/elasticsearch-6.6.0/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:60)
will try but I dont think It will work because it says, we can not perform on root users
[aadil@oc4733723867 Elastic_Stack]$ sudo su
[sudo] password for aadil:
[root@oc4733723867 Elastic_Stack]# chown aadil elasticsearch-6.6.0
[root@oc4733723867 Elastic_Stack]# cd elasticsearch-6.6.0/
[root@oc4733723867 elasticsearch-6.6.0]# ./bin/elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000d4cc0000, 724828160, 0) failed; error='Cannot allocate memory' (errno=12)
There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (mmap) failed to map 724828160 bytes for committing reserved memory.
An error report file with more information is saved as:
@sahil_ahmed bhai,
I gave permission (chown "username" "filename"). I tried all the way, Could you please help to get fix this issue.
[aadil@oc4733723867 ~] cd Downloads/
[aadil@oc4733723867 Downloads] cd Elastic_Stack/
[aadil@oc4733723867 Elastic_Stack] cd elasticsearch-6.6.0/
[aadil@oc4733723867 elasticsearch-6.6.0] ls
bin config lib LICENSE.txt logs modules NOTICE.txt plugins README.textile
[aadil@oc4733723867 elasticsearch-6.6.0] ./bin/elasticsearch
Exception in thread "main" java.nio.file.AccessDeniedException: /home/aadil/Downloads/Elastic_Stack/elasticsearch-6.6.0/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:60)
[aadil@oc4733723867 elasticsearch-6.6.0] cd ..
[aadil@oc4733723867 Elastic_Stack] chown
chown: missing operand
Try 'chown --help' for more information.
[aadil@oc4733723867 Elastic_Stack] chown aadil elasticsearch-6.6.0
[aadil@oc4733723867 Elastic_Stack] cd elasticsearch-6.6.0/
[aadil@oc4733723867 elasticsearch-6.6.0] ./bin/elasticsearch
Exception in thread "main" java.nio.file.AccessDeniedException: /home/aadil/Downloads/Elastic_Stack/elasticsearch-6.6.0/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:60)
[aadil@oc4733723867 elasticsearch-6.6.0]$ sudo su
[sudo] password for aadil:
[root@oc4733723867 elasticsearch-6.6.0]# ./bin/elasticsearch
[2019-02-13T17:08:47,817][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.6.0.jar:6.6.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.6.0.jar:6.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.6.0.jar:6.6.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.6.0.jar:6.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.6.0.jar:6.6.0]
... 6 more
[root@oc4733723867 elasticsearch-6.6.0]#
Thanks a lot for your effort, It worked for me, I am able to run **elasticsearch (./bin/elasticsearch) **server.
but again I got an error (node js incompatibility) while trying to run kibana (./bin/kibana). Could you please help me to get back to older version of Node js in RedHat 7.5 ?
Thanks in advance!
[aadil@oc4733723867 ~]$ cd Downloads/
[aadil@oc4733723867 Downloads]$ cd Elastic_Stack/
[aadil@oc4733723867 Elastic_Stack]$ cd kibana-6.6.0-linux-x86_64/
[aadil@oc4733723867 kibana-6.6.0-linux-x86_64]$ ls
bin data LICENSE.txt NOTICE.txt package.json README.txt target
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.