Closed eBeyond closed 11 months ago
spec:
members: 3
type: ReplicaSet
version: "5.0.5"
replicaSetHorizons:
- horizon: mongodb-0.DOMAIN.com:27017
- horizon: mongodb-1.DOMAIN.com:27017
- horizon: mongodb-2.DOMAIN.com:27017
security:
tls:
enabled: true
caConfigMapRef:
name: mongodb-ca.crt
certificateKeySecretRef:
name: mongodb-tls.crt
authentication:
modes: ["SCRAM"]
works in my case. However, I am moving from this project, so I cannot give any further help.
This issue is being marked stale because it has been open for 60 days with no activity. Please comment if this issue is still affecting you. If there is no change, this issue will be closed in 30 days.
This issue was closed because it became stale and did not receive further updates. If the issue is still affecting you, please re-open it, or file a fresh Issue with updated information.
Hello Team I got same error while accessing from connection string
Connecting to: mongodb://<credentials>@mongodb-0.example.com:27017,mongodb-1.example.com:27017/admin?authMechanism=DEFAULT&appName=mongosh+2.1.5
MongoServerSelectionError: getaddrinfo EAI_AGAIN mongodb-replica-set-0.mongodb-replica-set-svc.default.svc.cluster.local
here is my configuration file of mongo
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
name: mongodb-replica-set
spec:
members: 2
replicaSetHorizons:
- external: "mongodb-0.example.com:27017"
internal: "mongodb-replica-set-0.mongodb-replica-set-svc.default.svc.cluster.local:27017"
- external: "mongodb-1.example.com:27018"
internal: "mongodb-replica-set-1.mongodb-replica-set-svc.default.svc.cluster.local:27017"
type: ReplicaSet
version: "5.0.5"
security:
authentication:
modes: ["SCRAM"]
additionalMongodConfig:
storage.wiredTiger.engineConfig.journalCompressor: zlib
statefulSet:
spec:
template:
spec:
hostAliases:
- ip: "172.18.255.203"
hostnames:
- "mongodb-0.example.com"
- ip: "172.18.255.203"
hostnames:
- "mongodb-1.example.com"
users:
- name: admin
db: admin
passwordSecretRef: # a reference to the secret that will be used to generate the user's password
name: admin-password
roles:
- name: clusterAdmin
db: admin
- name: userAdminAnyDatabase
db: admin
- name: root
db: admin
scramCredentialsSecretName: admin-scram
What did you do to encounter the bug? I've created a ReplicaSet with the configured horizons:
but when trying to connect with mongo compass it took some time to timeout and I got:
getaddrinfo EAI_AGAIN mongodb-0.mongodb-svc.mongodb.svc.<cluster-domain>
I've tried it with several other ways to configure horizons:
,
,
or
Within to code horizons should be a map[string]string. As such I understand, that the value of the map is the domain. But what should be the first one? Or more generally: What should be the key in the replicaSetHorizons? As of now I've got no idea of fixing it. (As of testing I've disabled TLS to avoid any issues with that and concentrate on the horizons)
By the way: Most of the examples above I've found in the issues in this project which are mentioned as valid. As such I'm confused... :)
Thanks Marc