adrwer
(Adrian)
September 18, 2018, 9:19am
1
I've installed the .tar.gz package on a Rhel7.5 instance on Amazon Web Services with a RAM of 1GB and volume of 10GB but when I run it with this command "./bin/elasticsearch" I get this error despite reducing the heap size to 512MBs:
Exception in thread "main" java.nio.file.AccessDeniedException: /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)
What could the issue be?
warkolm
(Mark Walkom)
September 18, 2018, 9:28am
2
How did you install Elasticsearch?
adrwer
(Adrian)
September 18, 2018, 9:29am
3
I installed using the .tar.gz option
warkolm
(Mark Walkom)
September 18, 2018, 9:41am
4
Right, but what did you do exactly?
What commands, what user?
adrwer
(Adrian)
September 18, 2018, 9:43am
5
I installed using root and the commands were as follows:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz.sha512 shasum -a 512 -c elasticsearch-6.4.0.tar.gz.sha512 !(https://www.elastic.co/guide/en/elasticsearch/reference/current/images/icons/callouts/1.png) tar -xzf elasticsearch-6.4.0.tar.gz cd elasticsearch-6.4.0/ !(https://www.elastic.co/guide/en/elasticsearch/reference/current/images/icons/callouts/2.png)
adrwer
(Adrian)
September 18, 2018, 9:44am
6
warkolm
(Mark Walkom)
September 18, 2018, 9:45am
7
What user are you trying to run Elasticsearch as?
adrwer
(Adrian)
September 18, 2018, 9:47am
8
ec2-user currently coz i tried running the process using root but it keeps on being killed
warkolm
(Mark Walkom)
September 18, 2018, 9:48am
9
You cannot run Elasticsearch as root, ever, there are checks to stop that.
adrwer:
ec2-user
Which would probably explain this;
Why not use the rpm?
adrwer
(Adrian)
September 18, 2018, 9:49am
10
Does that mean reinstalling elasticsearch with rpm?
warkolm
(Mark Walkom)
September 18, 2018, 9:50am
11
Yes, that creates the proper directory structures, users and service files.
adrwer
(Adrian)
September 18, 2018, 9:53am
12
can i uninstall the .tar.gz version?
warkolm
(Mark Walkom)
September 18, 2018, 9:54am
13
Just rm -rf
the directory you extracted.
Also, ideally, you should setup the repo, not just download the RPM. That way you are setup to allow easy upgrades as well.
adrwer
(Adrian)
September 18, 2018, 9:56am
14
adrwer
(Adrian)
September 18, 2018, 10:01am
16
Thanks Mark you are awesome
warkolm
(Mark Walkom)
September 18, 2018, 10:01am
17
Thanks for being sticking through to the end!
1 Like
adrwer
(Adrian)
September 19, 2018, 7:42am
19
Blocked by another huddle....I installed Elasticsearch as adviced here:
warkolm:
Also, ideally, you should setup the repo, not just download the RPM. That way you are setup to allow easy upgrades as well.
but it sends this error when i try checking if it runs
curl: (7) Failed connect to localhost:9200; Connection refused
i checked if the service was runnning and i found out that it wasn't so i started it then it sent me this response
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2018-09-19 07:21:43 UTC; 32s ago
Docs: http://www.elastic.co
Main PID: 5798 (java)
CGroup: /system.slice/elasticsearch.service
└─5798 /bin/java -Xms512m -Xmx512m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headl...
Sep 19 07:21:43 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: Started Elasticsearch.
Sep 19 07:21:43 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: Starting Elasticsearch...
but on trying to test the Elasticsearch node it still sent me this error
curl: (7) Failed connect to localhost:9200; Connection refused
and on checking the status of the service, this is what it said
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: signal) since Wed 2018-09-19 07:23:52 UTC; 9s ago
Docs: http://www.elastic.co
Process: 5798 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=killed, signal=KILL)
Main PID: 5798 (code=killed, signal=KILL)
Sep 19 07:21:43 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: Started Elasticsearch.
Sep 19 07:21:43 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: Starting Elasticsearch...
Sep 19 07:23:52 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: elasticsearch.service: main process exited, code=killed, status=9/KILL
Sep 19 07:23:52 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: Unit elasticsearch.service entered failed state.
Sep 19 07:23:52 ip-172-31-7-139.us-east-2.compute.internal systemd[1]: elasticsearch.service failed.
Please help
warkolm
(Mark Walkom)
September 19, 2018, 7:45pm
20
Check /var/log/elasticsearch
for something.