Elasticsearch refuses to run


(Adrian) #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?


(Mark Walkom) #2

How did you install Elasticsearch?


(Adrian) #3

I installed using the .tar.gz option


(Mark Walkom) #4

Right, but what did you do exactly?
What commands, what user?


(Adrian) #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)


(Adrian) #6

this is the link to the guide i followed...https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-targz.html


(Mark Walkom) #7

What user are you trying to run Elasticsearch as?


(Adrian) #8

ec2-user currently coz i tried running the process using root but it keeps on being killed


(Mark Walkom) #9

You cannot run Elasticsearch as root, ever, there are checks to stop that.

Which would probably explain this;

Why not use the rpm?


(Adrian) #10

Does that mean reinstalling elasticsearch with rpm?


(Mark Walkom) #11

Yes, that creates the proper directory structures, users and service files.


(Adrian) #12

can i uninstall the .tar.gz version?


(Mark Walkom) #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.


Elasticsearch 6.* still not running on rhel7.5
(Adrian) #14

Okay, do you think this guide will help me?...https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html


(Mark Walkom) #15

Yep!


(Adrian) #16

Thanks Mark you are awesome


(Mark Walkom) #17

Thanks for being sticking through to the end! :slight_smile:


(Adrian) #18

:slightly_smiling_face:


(Adrian) #19

Blocked by another huddle....I installed elastic search as adviced here:

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 elastic search 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


(Mark Walkom) #20

Check /var/log/elasticsearch for something.