1

I'm new to ES and just want to set up Magento 2.4 and ES in its simpelst way, just to get a impression.

Magento is on host A, ES on host B. Both on RHEL systems in the same network. I've installed ES and did not configure it, so it runs with its default configuration (which is a 'single node' instance?). On host B I can execute curl -XGET 'localhost:9200/_cat/health?v&pretty' successfully. But if I try that on Host A with curl -XGET 'host_B:9200/_cat/health?v&pretty' I get:

curl: (7) Failed to connect to colop_dev port 9200: Connection refused

And I guess that has something to do with the ES option network.host in /etc/elasticsearch/elasticsearch.yml, which is set to default value _local_, afaik. This does not allow connections from other machines. Is that correct? I tried the value 0.0.0.0, but when I restart ES I get the error

Aug 11 09:19:51 itsrv2493.esrv.local systemd-entrypoint[21543]: ERROR: [1] bootstrap checks failed
Aug 11 09:19:51 itsrv2493.esrv.local systemd-entrypoint[21543]: [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
Aug 11 09:19:51 itsrv2493.esrv.local systemd-entrypoint[21543]: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Aug 11 09:19:51 itsrv2493.esrv.local systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/CONFIG
Aug 11 09:19:51 itsrv2493.esrv.local systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Aug 11 09:19:51 itsrv2493.esrv.local systemd[1]: Failed to start Elasticsearch.

I think it has something to do with this. I have disabled SELinux and the firewall. I've tried telnet. Without success, though other ports on host B can be accessed normally from host A (e.g. web server).

According to the Recommended configuration in the Installation Guide, I should set up a web server on host B as well. But is it really necessary if port 9200 is not public? If not, how should I configure ES on host B? I'm also wondering about the suggested verification of the ES installation with curl -XGET '<host>:9200/_cat/health?v&pretty': it does not use the port 8080 that is suggested for Apache and nginx. Why?

Update: According to simonthesorcerer's answer, it is possible to have ES on a different machine, without the need of another web server in order to use ES.

2
  • Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log so...? Aug 11, 2020 at 15:52
  • @simonthesorcerer It's saying the same, actually: node validation exception, the default discovery settings are unsuitable for production use. at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
    – robsch
    Aug 12, 2020 at 7:18

1 Answer 1

1

First:

  • curl -XGET 'host_A:9200/_cat/health?v&pretty' should be curl -XGET 'host_B:9200/_cat/health?v&pretty'. You may want to try with local/public IP of that server, to exclude the possible problem that the host name isn't working correctly
  • network.host: 0.0.0.0 should actually work, according to this answer: https://stackoverflow.com/questions/33696944/how-do-i-enable-remote-access-request-in-elasticsearch-2-0 You may want to look through the answers, as sometimes, [0.0.0.0] seems to work, and sometimes, additional configuration seems to be necessary:
node.name: elasticsearch-node-1

cluster.initial_master_nodes: ["elasticsearch-node-1"]

Also, I'd recommend looking through the other variables that occur in the error message and read the docs.

You might find more help in the official ES forums though, as this question doesn't seem to be Magento-specific.

4
  • Thanks, that works! So the only missing configuration was cluster.initial_master_nodes. With this I do now have a single node configuration that should work with Magento? Yes, mistake of mine in the question regarding host_A/host_B. I used host_B, of course. And yes, it is actually not very Magento related. Should have ask on StackOverflow.
    – robsch
    Aug 12, 2020 at 8:57
  • I couldn't find a guide that tells how to establish a single node server. Though it seems to be quite easy. Might not be the recommended way. Is there any problem with that configuration, esp. in conjunction with Magento?
    – robsch
    Aug 12, 2020 at 9:05
  • A single node should be the default setup, so it should be working from the start. Yes, this config should work with Magento. You only have to configure Magento to use your remote host (default is localhost) Aug 12, 2020 at 11:25
  • dont forget to use firewall or xpack.security enabled
    – MagenX
    Aug 16, 2020 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.