main

2019/12/07

problem with ElasticSearch connection error

Following https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-18-04, while testing the elasticsearch as suggested,


curl -x GET "localhost:9200"

I received an error as following:

Error:

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

So what can I do? 

Using sudo service elasticsearch status, there is a red light. It tells me there was not insufficient memory for the Java Virtual Machine.

Then modify /etc/elasticsearch/jvm.options file:


# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

#-Xms2g
#-Xms2g

-Xms512m
-Xmx512m
run sudo systemctrl restart elasticsearch again,
check the status: sudo service elasticsearch status. You will see the green light.

No comments:

Post a Comment

How to Supercharge Your Python Classes with Class Methods

  How to Supercharge Your Python Classes with Class Methods | by Siavash Yasini | May, 2024 | Towards Data Science As we just mentioned, a c...