Failed to connect to localhost port 9200: Connection refused

From a fresh install of Ubuntu 16.04:

sudo apt-get install elasticsearch

After that, the following should work but doesn't:

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sleep 10
curl http://localhost:9200/

Despite that, the following does work:

sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch &
sleep 10
curl http://localhost:9200/

Comments

Popular Posts

How to pass hash in Postman

nginx: unrecognized service

Bootstrap Select Picker append add new item if search not exist

Reading Excel Sheets using "Roo" gem in ruby on rails

Add CORS to Nginx on AWS Elastic Beanstalk

Enable gzip compression on Elastic Beanstalk with nginx

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Get video duration by URL in Ruby on Rails

site-enables nginx setting in ruby in rails