
host insert query update delete getmore command dirty used flushes vsize res qrw arw net_in net_out conn set repl time *:27017 31 2 14 *0 45 137|0 0.9% 80.0% 0 29.2G 23.7G 0|0 0|0 69.7k 134k 992 foo PRI Nov 2 23:55:38.713 *:27017 *17 88 *19 *0 0 17|0 0.8% 80.1% 0 29.2G 22.9G 0|0 1|0 15.3k 1.66m 988 foo SEC Nov 2 23:55:38.727 类似这样一段 PHP 代码,复制集中都有这些数据,也都建了索引,主节点可以轻松查到,备份节点总是超时
$secOndary= false;//修改这个值做的测试,如果是 true,则优先从 SEC 中查 $result = $dao->getRecords([ 'createAt' => [ '$gte' => MongoUtil::getMongoDate(1509547347000), '$lte' => MongoUtil::getMongoDate(1509633747000), ], 'a' => 0, 'b' => 1, 'c' => ['$in' => [2]], 'd' => 3, 'e' => ['$ne' => 4], ], ['_id', 'foo'], ['_id' => -1], 300, $secondary); 把上述 PHP 代码翻译成 JS 在 Mongo Shell 中执行,主节备份节点都可以轻松查到
机器、配置都是一样的,这是啥原因,怎么破?
1 okletswin 2017-11-03 10:40:27 +08:00 节点运行正常,那就是连接地址不通 要么是系统网络层问题 要么是 php 连接地址问题 |