Mongodb 问题汇总


环境:centos 6.0   mongodb2.4.13


1.集合分片后无法删除:

mongos> db.table.drop()
Tue Apr 21 18:40:30.943 drop failed: {
        "code" : 14022,
        "ok" : 0,
        "errmsg" : "exception: Error locking distributed lock for chunk drop. :: caused by :: 13651 error checking clock skew of cluster 192.168.100.201:21000,192.168.100.202:21000,192.168.100.204:21000 :: caused by :: 13650 clock skew of the cluster 192.168.100.201:21000,192.168.100.202:21000,192.168.100.204:21000 is too far out of bounds to allow distributed locking."
} at src/mongo/shell/collection.js:383
原因:各主机时间不统一,修改统一ok。
与网络时间同步:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  //修改时区
yum install -y ntpdate
ntpdate us.pool.ntp.org //同步时间

mongos> db.table.drop()
true
mongos>

2.mongos 集群无法启动

./mongos  --configdb 192.168.100.201:21000,192.168.100.202:21000,192.168.100.204:21000  --port 20000   --logpath  /data/mongodbtest/mongos/log/mongos.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 4394
ERROR: child process failed, exited with error number 1

查看日志如下:

error upgrading config database to v6 :: caused by :: DistributedClockSkewed clock skew of the cluster 192.168.100.201:21000,192.168.100.202:21000,
192.168.100.204:21000 is too far out of bounds to allow distributed locking.
原因:主机之间时钟有相差,约几百毫秒吧。重新同步ok。参照问题1。

./mongos  --configdb 192.168.100.201:21000,192.168.100.202:21000,192.168.100.204:21000  --port 20000   --logpath  /data/mongodbtest/mongos/log/mongos.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 5200
child process started successfully, parent exiting




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值