Mongodb 当从不同的应用程序查询时,mongos返回空集合
我们使用带有2个分片的分片MongoDB配置。有几个前端应用程序,它们通过服务(安装在每个应用程序服务器上)检索数据 问题是,在某个时刻,从应用服务器1运行相同的查询将返回空集合,而从应用服务器3运行相同的查询将返回正确的结果 在运行命令之前,该问题在应用程序服务器#1上一直存在。如文件所述: “只需在movePrimary完成后运行flushRouterConfig 已运行或已手动清除巨型块标志。“ 但主设备既没有移动,也没有清除标志 你知道为什么会这样吗 配置文件Mongodb 当从不同的应用程序查询时,mongos返回空集合,mongodb,sharding,Mongodb,Sharding,我们使用带有2个分片的分片MongoDB配置。有几个前端应用程序,它们通过服务(安装在每个应用程序服务器上)检索数据 问题是,在某个时刻,从应用服务器1运行相同的查询将返回空集合,而从应用服务器3运行相同的查询将返回正确的结果 在运行命令之前,该问题在应用程序服务器#1上一直存在。如文件所述: “只需在movePrimary完成后运行flushRouterConfig 已运行或已手动清除巨型块标志。“ 但主设备既没有移动,也没有清除标志 你知道为什么会这样吗 配置文件 # mongos.conf
# mongos.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: false
logRotate: rename
path: /var/log/mongos.log
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongos.pid # location of pidfile
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1,94.130.167.133,192.168.0.1 # Listen to local interface only, comment to listen on all interfaces.
security:
keyFile: /var/lib/database/mongos/.keyfile
sharding:
configDB: myproject-config/192.168.0.15:27027,192.168.0.16:27017,192.168.0.17:27017
printShardingStatus()
你能提供更多的信息吗?配置文件!和db.printShardingStatus()命令的结果!添加了配置和printShardingStatus()1。请尝试更改cnuksize!例如1mb。2.在测试目的中,为(var i=0;i)调用循环,可以提供更多信息?配置文件!和db.printShardingStatus()com的结果!添加了配置和printShardingStatus()1。尝试更改cnuksize!例如1mb.2。在测试目的中,为(var i=0;i)调用循环
MongoDB shell version: 3.2.8
connecting to: cron0.myproject.smapps.org:27017/test
config.locks collection empty or missing. be sure you are connected to a mongos
--- Sharding Status ---
sharding version: {
"_id" : 1,
"minCompatibleVersion" : 5,
"currentVersion" : 6,
"clusterId" : ObjectId("2c5bc3fd9b2385s9613b0la5")
}
shards:
{ "_id" : "myproject0", "host" : "myproject0/192.168.0.11:27017,192.168.0.12:27017", "state" : 1, "tags" : [ ] }
{ "_id" : "myproject1", "host" : "myproject1/192.168.0.13:27017,192.168.0.18:27017", "state" : 1, "tags" : [ "game" ] }
{ "_id" : "myproject2", "host" : "myproject2/192.168.0.26:27017,192.168.0.28:27017", "state" : 1, "tags" : [ "game" ] }
active mongoses:
"4.0.6" : 14
balancer:
Currently enabled: yes
Currently running: no
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
8 : Success
databases:
{ "_id" : "myproject", "primary" : "myproject0", "partitioned" : true, "version" : { "uuid" : BinData(4,"+YxjwrKzTuekDlKutwT1IA=="), "lastMod" : 1 } }
...