You'll need to specify the local deployment as the node parameter along with the required authentication params as auth dEpending on the security settings of your deployment. I would recommend taking a look at the JavaScript client connection documentation for self-managed.
I am having trouble with certficates. Got the following error:
ConnectionError: self signed certificate in certificate chain
at ClientRequest.onError (/root/Backend/ApiGateway/node_modules/@elastic/elasticsearch/lib/Connection.js:123:16)
at ClientRequest.emit (node:events:527:28)
at TLSSocket.socketErrorListener (node:_http_client:454:9)
at TLSSocket.emit (node:events:527:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Thanks for the update. I did come across this StackOverflow thread with a similar issue. Can you try rejectUnauthorized: true and also check the cert as it suggests?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.