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()