Connect to a remote server via. SSH - Using elasticsearch package (Node JS)

I'm currently using Node's elasticsearch package. Until now, I connected to the ES instance in the following way.

let esClient = new elasticsearch.Client({
        host: '127.0.0.1:9200',
        log: 'trace'
});

Now, I've installed ES on a remote Amazon EC2 Linux server by tunneling through SSH using a key file.
I've done the basic ES installation and setup on that server. Tested it as well, and it runs properly.

I've now deployed my Node project on a Server X (EC2 - Ubuntu server).
And Elasticsearch is on Server Y(EC2 - Amazon Linux server).

Apart from specifying the IP in the host parameter what else do I need to connect to ES running on Server Y from Server X?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.