Closed mike0355 closed 2 years ago
Please take a look at the external connectivity docs here.
Try selecting the Direct connection in the General tab - and turn off TLS if you have not configured it in TLS/SSL tab
I have the same problem when using port-forward.
I have read the document referenced y priyolahiri, but it isn't related to this problem at all.
Does anyone have any clue as to how this is meant to work? I migrated to the community operator from the bitnami helm chart, but this approach works fine with that helm chart and doesn't seem to work at all with this operator mediated deployment.
facing the same issue, any updates?
update: Authentication mechanism in my case was set to SCRAM-SHA-1. I set it to Default and it worked fine. I deployed mongodb using the community operator and exposed service using port forward.
also, check the direct connection checkbox
Hi , when I face this problem, I select the "Direct connect" this option and I solved this problem.
And one thing need to notice , only primary MongoDB pod can provide read data and write data function. Secondary MongoDB pods only save the data.
For BryanDollery's problem Is your port-forward port is 8000:27017? that means container environment port forward to the local side's 8000 port. So you need to select the 8000 port and select the "Direct connect".
however, the solution creates another issue, as stating from https://www.mongodb.com/docs/compass/current/connect/general-connection/
onnection and connect to a secondary member of a replica set, your write operations fail because it is not the primary member.
this solution, as temporary to test whether the connection succeeds is fine, but I am not sure if this would connect from backend (for instance node) as there'd be no option to connect directly, or even if there is, it would connect to secondary node and would deny any write operations. please look into this.
One method can observed which one pod is primary member. It is enter to the mongodb pods container environment to check .
Use" kubectl exec -it -c mongod
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.
Try selecting the Direct connection in the General tab - and turn off TLS if you have not configured it in TLS/SSL tab
You save my day(night)!
the issue is cause because of /etc/hosts in your client which running MongoDB Compass. you have to sync /etc/hosts to find your replicaset. maybe if you use kubernetes, maybe you have to use NAT or port-forwarding
[Example] suggest you set /etc/hosts like that
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.0.X mongo0.replset.member
192.168.0.X mongo1.replset.member
192.168.0.X mongo2.replset.member
then you have to sync the /etc/hosts with public ip in external if you want to activate replica
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
121.X.X.X mongo0.replset.member
121.X.X.X mongo1.replset.member
121.X.X.X mongo2.replset.member
then try connect in external env
mongodb://id:password@[your_host]:27017,[your_host]27018,[your_host]:27019/?authMechanism=SCRAM-SHA-1&replicaSet=rs0&readPreference=secondaryPreferred
Additionally, it is general ways that changing your member names with domain and port-forwarding in production
Hi , I'm a new on use Mongodb. When I deploy the mongodb operator on K8s from this github community,and I want to use local mongodb compass to connect this mongodb server . When I try to connect the mongodb server I got "getaddrinfo ENOTFOUND mongodb replica set." error massage.
When I finished to deploy mongodb, I use port-forward command to port-forward this service ,and see this message on my browser. And here is my service...
And here is my secret info.
I follow this github to install and deploy mongodb, so I think my setting is correct. But I don't know why I get this problem.