
[英]Cannot delete document from local.system.replset when authentication enabled
[英]NoMatchingDocument: Did not find replica set configuration document in local.system.replset
我的 AWS EC2 实例中有一个独立的 MongoDB 实例。 我打算将其转移到 Mongo Atlas。 前提是将 MongoDB 实例转换为副本集。
下面是我的mongo.conf
文件的代码:
# mongodb.conf
# Where to store the data.
dbpath=/opt/bitnami/mongodb/data/db
#where to log
logpath=/opt/bitnami/mongodb/log/mongodb.log
logappend=true
bind_ip = 127.0.0.1
port = 27017
# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true
# Enable smaller default file size for MongoDB
# Also reduces size of journal files from 1G to 128M
#smallfiles=true
# Enables periodic logging of CPU utilization and I/O wait
#cpu = true
# Turn on/off security. Off is currently the default
#noauth = true
auth = true
# Verbose logging output.
#verbose = true
# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true
# Enable db quota management
#quota = true
# Set oplogging level where n is
# 0=off (default)
# 1=W
# 2=R
# 3=both
# 7=W+some reads
#oplog = 0
# Diagnostic/debugging option
#nocursors = true
# Ignore query hints
#nohints = true
setParameter = enableLocalhostAuthBypass=0
unixSocketPrefix=/opt/bitnami/mongodb/tmp
fork = true
setParameter = enableLocalhostAuthBypass=0
# Replication Options
replication:
replSetName: res0
# in replicated mongo databases, specify here whether this is a slave or master
#slave = true
#source = master.example.com
# Slave only: specify a single database to replicate
#only = master.example.com
# or
#master = true
#source = slave.example.com
我正在使用以下命令创建副本集:
sudo mongod --port 27017 --dbpath /opt/bitnami/mongodb --replSet res0 --bind_ip localhost
我收到以下错误:
NoMatchingDocument: Did not find replica set configuration document in local.system.replset
我还应该在我的mongo.conf
文件中更改什么?
我正在使用bitnami/mongodb helm chart 将 mongodb 部署到我们的自定义 k8s 集群,并在忘记覆盖我的values.yaml
文件中的clusterDomain
变量时出现此错误,因为默认情况下它是cluster.local
并导致运行rs.initiate
eval主机地址中的错误集群域:
mongodb 14:59:37.35 WARN ==> Problem initiating replica set
request: rs.initiate({"_id":"rs0", "members":[{"_id":0,"host":"temp-mongo-0.temp-mongo-headless.default.svc.**cluster.local**:27017","priority":5}]})
response: MongoDB shell version v4.4.4
connecting to: mongodb://127.0.0.1:27017/admin?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("dc48d2bc-269b-4710-95b8-525b7768fa72") }
MongoDB server version: 4.4.4
{
"ok" : 0,
"errmsg" : "No host described in new configuration with {version: 1, term: 0} for replica set rs0 maps to this node",
"code" : 93,
"codeName" : "InvalidReplicaSetConfig"
}
bye
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.