mallocator / Elasticsearch-Exporter

A small script to export data from one Elasticsearch cluster into another.
Apache License 2.0
593 stars 112 forks source link

Error: getaddrinfo ENOTFOUND #94

Closed lighta closed 9 years ago

lighta commented 9 years ago

With same configuration as https://github.com/mallocator/Elasticsearch-Exporter/issues/93

error report = 1) root@imgramDashboard:/opt/asci/Elasticsearch-Exporter# nodejs exporter.js -t file -sh localhost:9200 -si crashs -st crash -tf ./crashs.dump Elasticsearch Exporter - Version 2.0.0 The driver reported an error: { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' } Exit code 4: driver is passing on an error Fetched Entries: 0 documents Processed Entries: 0 documents Source DB Size: 0 documents root@imgramDashboard:/opt/asci/Elasticsearch-Exporter# nodejs exporter.js -t file -sh localhost -si crashs -st crash -tf ./crashs.dump Elasticsearch Exporter - Version 2.0.0 2) root@imgramDashboard:/opt/asci/Elasticsearch-Exporter# curl localhost:9200 { "status" : 200, "name" : "Captain Germany", "cluster_name" : "elasticsearch", "version" : { "number" : "1.4.4", "build_hash" : "c88f77ffc81301dfa9dfd81ca2232f09588bd512", "build_timestamp" : "2015-02-19T13:05:36Z", "build_snapshot" : false, "lucene_version" : "4.10.3" }, "tagline" : "You Know, for Search" }

analysys / desc = 1) So basically, here I tried an endpoint with the port specified. 2) Verify the specified url is valid from host I took a look at doc, args.js and options.js didn't see how you parse the "sh" (source host) to retain the port. You seem to store all the string into : (args.js:87 optionMap[lastArg].value = arg; ) Which probably cause an issue when you building the client here : (drivers/es.js:73 reqOpts.path = 'http://' + host + ':' + port + path; ) But idk I didn't really look how you pass argument to create the client after fetching them. (options and args seem also a bit redondant class responsability)

I suppose for now the way to do this now is only via the json file. Or if you desesperate/lazy, do a proxypass to point to 9200...

mallocator commented 9 years ago

the port is actually a separate flag -sp, but the reason stuff doesn't work is because the driver has not been finished implementing yet.

mallocator commented 9 years ago

This should work now, even though the file format has changed. Keep in mind though that the driver is still in beta. If you experience any more problems please report them back here and I will look into them as soon as I can.