We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
安装副本集单节点,非本地用了ssh隧道,用qmgo连接报错
复现步骤 安装docker sudo docker run -d -p 27017:27017 --name mongo70 mongo:7 mongod --dbpath /data/db --replSet appSet 管理员身份进入容器 sudo docker exec -it mongo70 mongosh admin 初始化副本集 rs.initiate()
连接代码 client, err := qmgo.NewClient(ctx, &qmgo.Config{Uri: "mongodb://127.0.0.1:27017"}, opts...)
报错信息 server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: 47df5866cf51:27017, Type: Unknown, Last error: dial tcp: lookup 47df5866cf51: no such host }, ] } new client fail server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: 47df5866cf51:27017, Type: Unknown, Last error: dial tcp: lookup 47df5866cf51: no such host }, ] }
The text was updated successfully, but these errors were encountered:
用navicat 可以正常🔗,用java spirngboot 也可以连接
Sorry, something went wrong.
你报错信息里连接地址是 47df5866cf51:27017. 这事应该不是 qmgo 的锅.
47df5866cf51:27017
qmgo
No branches or pull requests
Describe the bug
安装副本集单节点,非本地用了ssh隧道,用qmgo连接报错
复现步骤
安装docker
sudo docker run -d -p 27017:27017 --name mongo70 mongo:7 mongod --dbpath /data/db --replSet appSet
管理员身份进入容器
sudo docker exec -it mongo70 mongosh admin
初始化副本集
rs.initiate()
连接代码
client, err := qmgo.NewClient(ctx, &qmgo.Config{Uri: "mongodb://127.0.0.1:27017"}, opts...)
报错信息
server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: 47df5866cf51:27017, Type: Unknown, Last error: dial tcp: lookup 47df5866cf51: no such host }, ] }
new client fail server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: 47df5866cf51:27017, Type: Unknown, Last error: dial tcp: lookup 47df5866cf51: no such host }, ] }
The text was updated successfully, but these errors were encountered: