新搭建了一個mongodb集群, replicaset + sharding集群的方式,其中mongos和configsvr服務器是復用的, mongos的查詢出現了問題, 只有在configsvr primary那一臺上的mongos 查詢速度正常(3-5秒), 其他節點的查詢速度都很慢(35秒+);
集群是部署在阿里云上的; 這個集群的部署方式在測驗環境部署測驗, 各個節點的速度都能滿足要求, 但是在生成環境部署之后, 就不行了
求大神幫助
分片也已經啟動了, 但是沒有啟動索引分片
這個是集群的資訊
mongos> use admin
switched to db admin
mongos> db.runCommand({listshards:1})
{
"shards" : [
{
"_id" : "shard1",
"host" : "shard1/10.24.188.197:27001,10.26.68.102:27001",
"state" : 1
},
{
"_id" : "shard2",
"host" : "shard2/10.24.197.219:27002,10.26.68.102:27002",
"state" : 1
},
{
"_id" : "shard3",
"host" : "shard3/10.24.188.197:27003,10.24.197.219:27003",
"state" : 1
}
],
"ok" : 1
}
mongos> sh.status(true)
--- Sharding Status ---
sharding version: {
"_id" : 1,
"minCompatibleVersion" : 5,
"currentVersion" : 6,
"clusterId" : ObjectId("5bdacb1ecabce31601525a70")
}
shards:
{ "_id" : "shard1", "host" : "shard1/10.24.188.197:27001,10.26.68.102:27001", "state" : 1 }
{ "_id" : "shard2", "host" : "shard2/10.24.197.219:27002,10.26.68.102:27002", "state" : 1 }
{ "_id" : "shard3", "host" : "shard3/10.24.188.197:27003,10.24.197.219:27003", "state" : 1 }
active mongoses:
{ "_id" : "node1:27017", "ping" : ISODate("2018-11-01T12:34:05.040Z"), "up" : NumberLong(9926), "waiting" : true, "mongoVersion" : "3.4.17", "advisoryHostFQDNs" : [ "node1" ] }
{ "_id" : "node4", "ping" : ISODate("2018-11-01T12:34:04.668Z"), "up" : NumberLong(1210), "waiting" : true, "mongoVersion" : "3.4.17", "advisoryHostFQDNs" : [ "node4" ] }
{ "_id" : "node2:27017", "ping" : ISODate("2018-11-01T12:34:00.045Z"), "up" : NumberLong(9956), "waiting" : true, "mongoVersion" : "3.4.17", "advisoryHostFQDNs" : [ "node2" ] }
{ "_id" : "node3:27017", "ping" : ISODate("2018-11-01T12:33:57.712Z"), "up" : NumberLong(9907), "waiting" : true, "mongoVersion" : "3.4.17", "advisoryHostFQDNs" : [ "node3" ] }
autosplit:
Currently enabled: yes
balancer:
Currently enabled: yes
Currently running: no
Balancer lock taken at Thu Nov 01 2018 17:45:02 GMT+0800 (CST) by ConfigServer:Balancer
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
No recent migrations
databases:
{ "_id" : "firmmemberinfo", "primary" : "shard3", "partitioned" : true }
由于剛接觸mongodb時間不長, 對mongodb不熟悉
麻煩大神幫助一二
uj5u.com熱心網友回復:
看各個節點的日志有沒有例外 看看各節點間的網路是否正常轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/79544.html
標籤:MongoDB
