##7月1日19点过5分,设置时间窗口为12:00-12:10
[mongodb@cst ~]$ date
Wed Jul 1 19:05:41 CST 2015
[mongodb@cst ~]$ /home/mongodb/mongodb3.0.2/bin/mongo –port=30000
MongoDB shell version: 3.0.2
connecting to: 127.0.0.1:30000/test
mongos> use config
switched to db config
mongos> sh.setBalancerState(true)
mongos> db.settings.update({ _id :”balancer” }, { $set : { activeWindow : { start :”12:00″, stop :”12:10″ } } }, true )
WriteResult({ “nMatched” : 1, “nUpserted” : 0, “nModified” : 1 })
mongos> db.settings.find()
{ “_id” : “chunksize”, “value” : 64 }
{ “_id” : “balancer”, “stopped” : false, “activeWindow” : { “start” : “12:00”, “stop” : “12:10” } }
mongos>
##此时balancer状态和数据块状态如下,数据库无任何增删改查操作:
balancer:
Currently enabled: yes
Currently running: no
Balancer active window is set between 12:00 and 12:10 server local time
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
No recent migrations
wy_test.Test
shard key: { “number” : “hashed” }
chunks:
rs172
rs272
rs372
too many chunks to print, use verbose if you want to force print
{ “_id” : “test”, “partitioned” : false, “primary” : “rs3” }
##向数据库insert30000000条数据
##期间由于工作原因,没有查看其状态。
##7月2日上午11点多查看状态。
balancer:
Currently enabled: yes
Currently running: yes
Balancer lock taken at Wed Jul 01 2015 23:29:05 GMT+0800 (CST) by cst.test.111:30000:1435563620:1804289383:Balancer:846930886
Balancer active window is set between 12:00 and 12:10 server local time
Collections with active migrations:
wy_test.Test started at Wed Jul 01 2015 23:29:35 GMT+0800 (CST)
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
No recent migrations
{ “_id” : “wy_test”, “partitioned” : true, “primary” : “rs3” }
wy_test.Test
shard key: { “number” : “hashed” }
chunks:
rs176
rs274
rs376
too many chunks to print, use verbose if you want to force print
{ “_id” : “test”, “partitioned” : false, “primary” : “rs3”
##而且服务器变得很卡,查看currentOp中慢的操作发现:moveChunk运行了52415秒。
{
“desc” : “conn623”,
“threadId” : “0x31915260”,
“connectionId” : 623,
“opid” : “rs1:45011063”,
“active” : true,
“secs_running” : 52415,
“microsecs_running” : NumberLong(“52415931651”),
“op” : “query”,
“ns” : “wy_test.Test”,
“query” : {
“moveChunk” : “wy_test.Test”,
“from” : “rs1/172.16.5.110:27017,172.16.5.111:27017”,
“to” : “rs2/172.16.5.110:27018,172.16.5.112:27018”,
“fromShard” : “rs1”,
“toShard” : “rs2”,
“min” : {
“number” : { “$minKey” : 1 }
},
“max” : {
“number” : NumberLong(“-9153541293874985355”)
},
“maxChunkSizeBytes” : NumberLong(67108864),
“shardId” : “wy_test.Test-number_MinKey”,
“configdb” : “172.16.5.110:20000,172.16.5.111:20000,172.16.5.112:20000”,
“secondaryThrottle” : true,
“waitForDelete” : false,
“maxTimeMS” : 0,
“epoch” : ObjectId(“55910a2a2f531a312c7922ff”)
},
“client_s” : “172.16.5.111:55843”,
“msg” : “step 3 of 6”,
“numYields” : 1176,
“locks” : {
},
“waitingForLock” : false,
“lockStats” : {
“Global” : {
“acquireCount” : {
“r” : NumberLong(1177),
“w” : NumberLong(1),
“R” : NumberLong(1)
},
“acquireWaitCount” : {
“R” : NumberLong(1)
},
“timeAcquiringMicros” : {
“R” : NumberLong(81107)
}
},
“Database” : {
“acquireCount” : {
“r” : NumberLong(1177),
“w” : NumberLong(1)
}
},
“Collection” : {
“acquireCount” : {
“r” : NumberLong(1177),
“W” : NumberLong(1)
}
}
}
},
java mongodb时区 mongodb时区设置
转载文章标签 java mongodb时区 mongodb 服务器时区设置 Test mongodb 数据库 文章分类 Java 后端开发
-
Ubuntu之修改时区/时间
查看当前时间及时区状态sudo timedatectl status# 显示当前时区为Asia/Shanghai查看当前系统时间sudo date查看当前系统时间及时区sudo date -R# 显示当前时间及对应时区,时区为“+0800”北京时区修改硬件时间修改日期格式:MM月/DD日/YYYY年sudo date -s MM/DD/YYYY修改时间:hh时:mm分:ss秒 sudo date
ubuntu修改时区 ubuntu修改时间 ubuntu修改时间及时区 ubuntu修改时区和时间 ubuntu修改系统时间