Connecting to Elasticsearch 5.6 externally

I'm having trouble setting up Elasticsearch 5.6.10 using the Installation example with tar from elastic.co. This is running on an Amazon EC2 instance running the Amazon Linux 1 OS.

I am able to test connecting externally (using curl xxx.xx.xx.xxx:9200/?pretty to my instance running Elasticsearch 1.4.4 straight out of the box, but the same is not working for 5.6.10.

I know there are major changes between the 1.x and 5.x versions, such as having to edit the network.host value in elasticsearch.yml (since 5.x by default will only loop back to local), but I have had no luck changing the value to _global_, xxx.xx.xx.xxx, and 0.0.0.0. Are there other settings that need to be configured after initial install before running the service to be able to connect to the service externally? If so, pointing me in the right direction to some documentation is all I need!

Please share your logs if you need help. But yes that's the way to go.

In case it helps, please read Bootstrap Checks | Elasticsearch Guide [7.15] | Elastic

I realized the reason I did not have access to logs (and the BootstrapChecks, etc.), is because I've been working with a different install of Elasticsearch 5.6.10 so that I can run it as a service.

I now actually installed via the Installation example with tar like I said earlier and I can see that the BootstrapChecks are enabled (after I change the value of network.host) and I am running into two errors which are shutting down ES.

ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1851] for user [ec2-user] is too low, increase to
at least [2048]

I (eventually) want this working using systemd, so I want to follow this Systemd configuration but I am not exactly sure what the correct syntax is to set nofile to 65536 and nproc to 4096.

Update:

For nofile from Systemd configuration:

[Service]
LimitMEMLOCK=infinity

For nproc from Number of threads:

The package distributions when run as services under systemd will configure the number of threads for the Elasticsearch process automatically. No additional configuration is required.

So it looks like all I need to do is set LimitMEMLOCK and my service installation of ES should be good to go, but I am still unable to connect from an external server, even with having tested different values for network.host.

Rather than further trying to get the service to work, I also made the changes to /etc/security/limits.conf as follows (so that I can get the Installation example with tar to work), but ES is still shutting down due to the same errors (formatting is off here, ignore different spacing between lines):

root             -       nofile          65536
ec2-user     -       nofile          65536
root             -       nproc           4096
ec2-user     -       nproc          4096

What else can I troubleshoot to get either version of my installation to work?

Got it working. User needed to be elasticsearch here:

elasticsearch            -       nofile          65536
elasticsearch            -       nofile          65536

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.