toluaina / pgsync

Postgres to Elasticsearch/OpenSearch sync
https://pgsync.com
MIT License
1.11k stars 174 forks source link

Not able to connect with AWS OpenSearch #426

Open hardikshakya-simformsolutions opened 1 year ago

hardikshakya-simformsolutions commented 1 year ago

PGSync version: 2.5.0

Postgres version: 14

Elasticsearch version: OpenSearch 2.5

Redis version: -

Python version: 3.10.6

Problem Description: Hi there,

I hope this message finds you well. I'm reaching out because I'm having an issue with running the bootstrap command. Specifically, I keep getting a "Failed to establish a new connection" error with my AWS-hosted OpenSearch server.

I apologize if I sound or look dumb; I'm relatively new to this and I'm not sure what's causing the issue. I've tried troubleshooting it on my own, but so far, nothing seems to be working.

I was hoping that someone on the team could help me or point me in the right direction. Any advice or guidance you can provide would be greatly appreciated.

Thanks so much for your time, and I look forward to hearing back from you soon.

My ENV file, PG_USER=postgres PG_HOST=localhost PG_PORT=5432 PG_PASSWORD=db_password ELASTICSEARCH_HOST=https://search-.us-east-1.es.amazonaws.com ELASTICSEARCH_USER=username ELASTICSEARCH_PASSWORD=userpassword ELASTICSEARCH_AWS_HOSTED=True ELASTICSEARCH_AWS_REGION=us-east-1 ELASTICSEARCH_SCHEME=https ELASTICSEARCH_PORT=443

Error Message (if any):

lasticsearch.exceptions.ConnectionError: ConnectionError(HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: /search-<os-name>.us-east-1.es.amazonaws.com:443/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd4e10989d0>: Failed to establish a new connection: [Errno -2] Name or service not known'))) caused by: ConnectionError(HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: /search-<os-name>.us-east-1.es.amazonaws.com:443/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd4e10989d0>: Failed to establish a new connection: [Errno -2] Name or service not known')))
toluaina commented 1 year ago

Sorry about the delay. I think your host should be without the https protocol prefix i.e in your case ELASTICSEARCH_HOST=search-.us-east-1.es.amazonaws.com