I stuck trying to implement some backup strategy for our mongodb replica set (3 nodes on aws) When i trying to make mongodump
mongodump --host="mydb/db1.myapp.co:27017,db2.myapp.co:27017,db3.myapp.co:27017" -o /home/ubuntu/db_backups/1 -d mydb--authenticationDatabase admin --username myself--password mypassword --ssl --sslCAFile=/home/ubuntu/mongotls/rootCA.pem --sslPEMKeyFile=/home/ubuntu/mongotls/mykey.pem
i recieved:
Failed: error connecting to db server: no reachable servers
When i tried to do this with uri:
mongodump --uri="mongodb://myself:[email protected]:27017,db2.myapp.co:27017,db3.myapp.co:27017/mydb?replicaSet=mydb&authSource=admin&ssl=true" -o /home/ubuntu/db_backups/ --sslPEMKeyFile=/home/ubuntu/mongotls/mykey.pem --sslCAFile=/home/ubuntu/mongotls/rootCA.pem
i recieved nothing, but host tries to establish connection with all mongo replicas, but immediately ended (circled):
below attached mongod logs from 1 of mongo replica
{"t":{"$date":"2023-02-05T12:54:29.297+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"122.11.24.98:39148","uuid":"ed692df4-8841-4211-8c66-1a8c1ab29b89","connectionId":23027,"connectionCount":12}}
{"t":{"$date":"2023-02-05T12:54:29.309+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn23027","msg":"Connection ended","attr":{"remote":"122.11.24.98:39148","uuid":"ed692df4-8841-4211-8c66-1a8c1ab29b89","connectionId":23027,"connectionCount":11}}
{"t":{"$date":"2023-02-05T12:54:29.850+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"122.11.24.98:39160","uuid":"881a4b60-6883-4a7b-8fa9-becec0439140","connectionId":23028,"connectionCount":12}}
{"t":{"$date":"2023-02-05T12:54:29.882+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn23028","msg":"Connection ended","attr":{"remote":"122.11.24.98:39160","uuid":"881a4b60-6883-4a7b-8fa9-becec0439140","connectionId":23028,"connectionCount":11}}