Docker Community Forums

Share and learn in the Docker community.

Connecting to container


(Willie108) #1

I installed
docker run -d -p 9200:9200 -p 5601:5601 nshou/elasticsearch-kibana

I am using Tweepy to insert data into elasticsearch like this:

es.index(index="sentiment", doc_type="test-type", body={"author": dict_data["user"]["screen_name"], "favoriteCount": dict_data["favorite_count"], "tweetID": dict_data["id"], "lang": dict_data["lang"], "tweetID": dict_data["id"], "date": dict_data["created_at"], "message": dict_data["text"], "polarity": tweet.sentiment.polarity, "subjectivity": tweet.sentiment.subjectivity, "sentiment": sentiment})

and I am running it. I want to download all the data to a csv file.

I found es2csv here https://github.com/taraslayshchuk/es2csv

I tried this
es2csv -q ‘host: localhost’ -o database.csv
but I get this:
root@elk:~# es2csv -t dev -q ‘host: localhost’ -o database.csv
ConnectionError((‘Connection aborted.’, BadStatusLine("’’",))) caused by: ProtocolError((‘Connection aborted.’, BadStatusLine("’’",)))

Using ssh I tried this
es2csv -u 128.199.237.228:9200 -q ‘*’ -o database.csv
but I get this
ConnectionError(<urllib3.connection.HTTPConnection object at 0x7fb51b59d3d0>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7fb51b59d3d0>: Failed to establish a new connection: [Errno 111] Connection refused)

Can anyone guess what the correct way to get this to work would be?