1、关闭一直处于RECOVERING状态的mongodb server
/opt/mongodb/mongodb-linux-x86_64-2
.4.8
/bin/mongo
127.0.0.1:22001
use admin
db.shutdownServer()
2、将原数据目录改名,新建数据目录,再启动mongodb实例
mv /opt/mongodb
/shard1/data
/opt/mongodb
/shard1/data_bak
mkdir
/opt/mongodb
/shard1/data
/opt/mongodb/mongodb-linux-x86_64-2
.4.8
/bin/mongod
--shardsvr --replSet shard1 --port 22001 --dbpath /opt/mongodb
/shard1/data
--logpath /opt/mongodb
/shard1/log/shard1
.log --fork
3、查看恢复状态,为STARTUP2
/opt/mongodb/mongodb-linux-x86_64-2
.4.8
/bin/mongo
127.0.0.1:22001
use admin
rs.status()