I'm trying to create an Elasticsearch cluster with 3 nodes, each node being eligible as a master, as stated in this doc.
This cluster will be used by the end user only on our local network through an nginx proxy that will point his port 9200 to port 9200 of one of the three nodes.
For that, I configured each node to use network.host
with the fixed local IP of each machine.
It turns out that even locally when running the command curl -XGET '192.168.0.1:9200/_cluster/health?pretty'
I just get the response
curl: (52) Empty reply from server.
What could I have done wrong?
These are the steps I did for configuration and how my configuration files turned out:
1 - I installed ES using Debian packages and kept certificates as it generated, and user as well.
2 - After installing, run the commands below:
sudo mkdir -p /etc/systemd/system/elasticsearch.service.d/
sudo nano /etc/systemd/system/elasticsearch.service.d/override.conf
...and added the line...
[Service]
LimitMEMLOCK=infinity
3 - I modified jvm.options to use 4GB of RAM, as the server has 8GB of RAM
sudo nano /etc/elasticsearch/jvm.options
-Xms4g
-Xmx4g
4 - I edited the elasticsearch.yml
file with the following settings:
cluster.name: my-elk-cluster
node.name: master-01
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 192.168.0.1
discovery.seed_hosts: ["192.168.0.1", "192.168.0.2", "192.168.0.3"]
cluster.initial_master_nodes: ["master-01", "master-02", "master-03"]
# Below automatically generated by Elastic on install
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
5 - And after that, I just configured Elasticsearch to start with the server:
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
The command sudo journalctl --unit elasticsearch
does not show any errors.