-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
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
mongoshake用户权限 #9
Comments
请给出一下你的配置文件信息,和错误的全部log信息。另外,代码有改过吗?前后不一样的信息只是添加了账号? |
您好:
经过近期测试,mongoshake满足数据同步要求,多谢您做出这么好的产品。
配置文件见附件.
当前确认的可用权限为
|
src(rs)
|
dst(standalone)
|
|
{
user: "shake",
pwd: "shake",
roles: [
{ role: "readWrite", db: "mongoshake" },
{ role: "readWrite", db: "pri" },
{ role: "read", db: "local" },
{ role: "read", db: "admin" },
"clusterMonitor",
"backup",
]
}
|
{
user: "shake",
pwd: "shake",
roles: [
{ role: "readWrite", db: "pri" },
{ role: "read", db: "local" },
{ role: "read", db: "admin" },
"restore",
]
}
|
如果dst端缺少{ role: "read", db: "admin" },会产生数据风暴。src经过insert和delete后只剩一条数据,dst端的数据一直在改变
在 2018-07-20 10:01:44,"Vinllen Chen" <notifications@github.com> 写道:
前后不一样的信息只是添加了账号?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
报错的log信息给出一下,以及你邮件里说的循环风暴的日志。 |
目的数据在变应该是在同步,同步Insert的oplog就添加,delete的就删除,等全部同步完你看看是否还在变。 |
src端rs的权限如之前,但是dst端rs的权限没有测试出来,暂时在dst端没有做权限控制。 |
应该是找到原因了。同事做了drop操作,但使用mongoshake时只开启了IDU操作,replayer.dml_only = true。另外由于oplog是幂等的,从哪开始都一样。再做一次同步试试。 |
对于DML是幂等的,DDL的重试不能保证幂等性 |
|
非标题相关问题建议多开一个issue,方便后人定位。这个问题我先关了。 |
mongos启用权限时,每一个节点都要加账号,否则会报no oplog ns in mongo |
mongodb没有做username:password时,rs-->standalone,sharding-->sharding已经同步成功。
使用权限后,createUser参数是
{
user: "shake",
pwd: "shake",
roles: [
{ role: "readWrite", db: "mongoshake" },
{ role: "readWrite", db: "pri" },
{ role: "read", db: "local" },
{ role: "read", db: "admin" },
"clusterMonitor",
]
}
启动mongoshake时提示Oplog Tailer initialize failed: worker initialize error.
查看代码,到了
w := NewWorker(coordinator, syncer, uint32(i))
if !w.init() {
return errors.New("worker initialize error")
}
继续查看源码
func NewWorker(coordinator *ReplicationCoordinator, syncer *OplogSyncer, id uint32) *Worker {
return &Worker{
coordinator: coordinator,
syncer: syncer,
id: id,
queue: make(chan []*oplog.GenericOplog, conf.Options.WorkerBatchQueueSize),
}
}
type GenericOplog struct {
Raw []byte
Parsed *PartialLog
}
type PartialLog struct {
Timestamp bson.MongoTimestamp
bson:"ts"
Operation string
bson:"op"
Gid string
bson:"g"
Namespace string
bson:"ns"
Object bson.M
bson:"o"
Query bson.M
bson:"o2"
UniqueIndexes bson.M
bson:"uk"
到这,不知道怎么找错误。
能否帮忙看看是什么问题,谢谢。
我的邮箱是wangxiaoyu@sensoro.com welovewxy@gmail.com
The text was updated successfully, but these errors were encountered: