I also had the similar issue in the past refusing the connections on my 9200 port. So I just checked the elasticsearch service status with the below command
sudo service elasticsearch status.
After executing above command if it is presenting the error and it is related to Java, then mostly the problem is with your jvm memory. If you want then you can also edit it in
/etc/elasticsearch/jvm.options. My machine is having 1GB RAM memory on the Amazon environment, So I kept my configurations as below:
After setting above configuration and just restarting my elasticsearch service, it started working properly for me . If you using the local firewall then Nmap and UFW checking will also be very useful for you.
After that you can test your Elasticsearch node is running or not by sending the HTTP request to the port 9200 on localhost using the command as shown below: