Elasticsearch Magento test connection fails while Elasticsearch running

Elasticsearch on Magento test connection fails while Elasticsearch is running.

I am using Magento 2.4.0, I have tested systemctl status elasticsearch and it's running.

enter image description here

But the test connection fails on Magento Configuration > Catalog Search

My Elasticsearch.yml file

cluster.name: my-application node.name: node-1 path.data: /var/lib/elasticsearch path.logs: /var/log/elasticsearch network.host: 127.0.0.1 http.port: 9200 discovery.seed_hosts: [] cluster.initial_master_nodes: node-1

how to fix this?

Magento Connection Fail

Read Entire Article