Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- code for connecting to elastic cloud
- const elasticsearch = require('elasticsearch');
- const getElasticClient = () => {
- // const esClient = new elasticsearch.Client({
- // host: 'localhost:9200',
- // log: 'info'
- // });
- const esClient = new elasticsearch.Client({
- hosts: [
- // 'https://elastic:mM320Lv403eWrtQKXA3VWgfl@79c3a93ce95743f2b6d28add4db92cd8.ap-southeast-1.aws.found.io:9243/']
- });
- return esClient;
- };
- Error i keep getting whenever i start the code is
- ERROR: 2018-11-23T05:33:01Z
- Error: Request error, retrying
- HEAD http://localhost:9200/ => connect ECONNREFUSED 127.0.0.1:9200
- at Log.error (D:\newOg-tk\og-tk3\og-tk\node_modules\elasticsearch\src\lib\log.js:226:56)
- at checkRespForFailure (D:\newOg-tk\og-tk3\og-tk\node_modules\elasticsearch\src\lib\transport.js:259:18)
- at HttpConnector.<anonymous> (D:\newOg-tk\og-tk3\og-tk\node_modules\elasticsearch\src\lib\connectors\http.js:163:7)
- at ClientRequest.wrapper (D:\newOg-tk\og-tk3\og-tk\node_modules\lodash\lodash.js:4949:19)
- at ClientRequest.emit (events.js:180:13)
- at Socket.socketErrorListener (_http_client.js:395:9)
- at Socket.emit (events.js:180:13)
- at emitErrorNT (internal/streams/destroy.js:64:8)
- at process._tickCallback (internal/process/next_tick.js:178:19)
Add Comment
Please, Sign In to add comment