暂无图片
Mongodb4.0-分布式集群-PHP连接数据无法写入
我来答
分享
wolf
2020-06-22
Mongodb4.0-分布式集群-PHP连接数据无法写入

mongodb 4.0分布式集群;
手动命令和第三方工具navicat连接库可以进行增删改查;
php对接时只能查不能写入数据
php没有报出相关错误信息;Mongodb业务报出错误日志
路由日志打印大量信息如下:
node: 192.168.1.225:27017 isn’t a part of set: replSetHO ismaster: { hosts: [ “192.168.1.213:27017”, “192.168.1.225:27017”, “192.168.1.226:27017” ], setName: “rs0”, setVersion: 1, ismaster: false, secondary: true, primary: “192.168.1.213:27017”, me: “192.168.1.225:27017”, lastWrite: { opTime: { ts: Timestamp(1592821753, 2), t: 1 }, lastWriteDate: new Date(1592821753000), majorityOpTime: { ts: Timestamp(1592821753, 2), t: 1 }, majorityWriteDate: new Date(1592821753000) }, configsvr: 2, maxBsonObjectSize: 16777216, maxMessageSizeBytes: 48000000, maxWriteBatchSize: 100000, localTime: new Date(1592821755267), logicalSessionTimeoutMinutes: 30, minWireVersion: 7, maxWireVersion: 7, readOnly: false, compression: [ “snappy” ], ok: 1.0, operationTime: Timestamp(1592821753, 2), $gleStats: { lastOpTime: Timestamp(0, 0), electionId: ObjectId(‘000000000000000000000000’) }, lastCommittedOpTime: Timestamp(1592821753, 2), $clusterTime: { clusterTime: Timestamp(1592821753, 2), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } } }

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
wolf

升级问题到: 紧急故障
{
“_id” : “xx_001.worker1”,
“user” : “worker1”,
“db” : “xx_001”,
“roles” : [
{
“role” : “readWrite”,
“db” : “xx_001”
}
],
“mechanisms” : [
“SCRAM-SHA-1”,
“SCRAM-SHA-256”
]
}

php使用worker1账户连接,只能查询不能写入。 这个情况请教一下各位大佬

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏