python client can't connect to elasticsear remotely -


this code works on machine has exact same elasticsearh version server,

from elasticsearch import elasticsearch         es = elasticsearch(['the server ip here'], port=9200)           body = json.dumps(itemdictionary, ensure_ascii=true)         es.index(index = 'indexname', doc_type = 'doc', body = body) 

i getting error

warning:elasticsearch:post http://the ip of server:9200/indexname/doc [status:n/a request:0.197s]  es.index(index = 'indexname', doc_type = 'doc', body = body)   file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped     return func(*args, params=params, **kwargs)   file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 261, in index     _make_path(index, doc_type, id), params=params, body=body)   file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/elasticsearch/transport.py", line 307, in perform_request     status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)   file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py", line 89, in perform_request     raise connectionerror('n/a', str(e), e) connectionerror: connectionerror(<urllib3.connection.httpconnection object @ 0x10cc62550>: failed establish new connection: [errno 61] connection refused) caused by: newconnectionerror(<urllib3.connection.httpconnection object @ 0x10cc62550>: failed establish new connection: [errno 61] connection refused) 

the python version 2.7 , elastcisearch version 2.1.1


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -