I have created a replica set with 3 members in an EKS cluster.
I followed the instructions here and enabled TLS, created nodeports and replicaSetHorizons.
The replicaset is running and I am able to see all detail from my Ops manager.
But I am not able to connect to replicaset with mongosh
from outside the cluster. It throws MongoNetworkError: getaddrinfo ENOTFOUND
error for the replica set POD fqdn. But I am using the host names defined in HORIZON
to connect to replica set.
My connection string:
mongosh mongodb://user:password@node1.mongo.mydomain.com:30503,node2.mongo.mydomain.com:31518,node3.mongo.mydomain.com:30612/ --tls --tlsCAFile mongo.pem --authenticationDatabase admin
Error:
MongoNetworkError: getaddrinfo ENOTFOUND example-rs1-0.example-rs1-svc.mongodb.svc.cluster.local
This fqdn of my pods wont be resolved from my application server as it is not inside EKS.
My Mongosh version - 1.1.7
My replicaset kubernetes yaml file:
---
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: sandbox-rs1
spec:
members: 3
version: "5.0.5-ent"
type: ReplicaSet
persistent: true
opsManager:
configMapRef:
name: example-rs1 # Must match metadata.name in ConfigMap file
credentials: org-secret-example-rs1
security:
tls:
enabled: true
ca: custom-ca
authentication:
enabled: true
connectivity:
replicaSetHorizons:
- "node": "node1.mongo.mydomain.com:30503"
- "node": "node2.mongo.mydomain.com:31518"
- "node": "node3.mongo.mydomain.com:30612"
Can someone help me on this ?