我需要通過對現有成員進行操作來更改oplog大小。 (不使用額外的成員,confiugred前需要OPLOG大小)
我失敗使用本官方手冊中:https://docs.mongodb.org/manual/tutorial/change-oplog-size/ 其中指出oplog.rs可以在獨立模式 這是不對的運行時被發現。至少在我的情況下。 所以,請人點我在正確的方向,以接替我的任務
有動作心中已經perfomed起初已登錄到次要構件,藉以說明問題
和傾倒的oplog.rs使確定它是否存在:
# mongodump --db local --collection 'oplog.rs' --port 27018
connected to: 127.0.0.1:27018
Thu Nov 5 13:26:44.369 DATABASE: local to dump/local
Thu Nov 5 13:26:44.370 local.oplog.rs to dump/local/oplog.rs.bson
Thu Nov 5 13:26:44.410 273 objects
Thu Nov 5 13:26:44.410 Metadata for local.oplog.rs to dump/local/oplog.rs.metadata.json
檢查,看看是什麼都被拋:
# find dump/ -ls
917559 4 drwxr-xr-x 3 root root 4096 Nov 5 13:26 dump/
917560 4 drwxr-xr-x 2 root root 4096 Nov 5 13:26 dump/local
917561 9516 -rw-r--r-- 1 root root 9742693 Nov 5 13:26 dump/local/oplog.rs.bson
917562 4 -rw-r--r-- 1 root root 79 Nov 5 13:26 dump/local/oplog.rs.metadata.json
所以oplog.rs存在於二級和有一些數據在裏面。 刪除轉儲目錄..
# rm -rf dump
然後,切換到獨立......
# mongod --port 37018 --dbpath /var/lib/mongodb/mongod-oplog-test2&
[4] 25587
# Thu Nov 5 13:29:41.690 [initandlisten] MongoDB starting : pid=25587 port=37018 dbpath=/var/lib/mongodb/mongod-oplog-test2 64-bit host=mongohost.net.local
Thu Nov 5 13:29:41.690 [initandlisten] db version v2.4.14
Thu Nov 5 13:29:41.690 [initandlisten] git version: nogitversion
Thu Nov 5 13:29:41.690 [initandlisten] build info: Linux buildvm-24.phx2.fedoraproject.org 3.19.5-200.fc21.x86_64 #1 SMP Mon Apr 20 19:51:56 UTC 2015 x86_64 BOOST_LIB_VERSION=1_41
Thu Nov 5 13:29:41.690 [initandlisten] allocator: tcmalloc
Thu Nov 5 13:29:41.690 [initandlisten] options: { dbpath: "/var/lib/mongodb/mongod-oplog-test2", port: 37018 }
Thu Nov 5 13:29:41.715 [initandlisten] journal dir=/var/lib/mongodb/mongod-oplog-test2/journal
Thu Nov 5 13:29:41.715 [initandlisten] recover : no journal files present, no recovery needed
Thu Nov 5 13:29:41.739 [websvr] admin web console waiting for connections on port 38018
Thu Nov 5 13:29:41.741 [initandlisten] waiting for connections on port 37018
檢查,看是否oplog.rs可以通過mongodump發現,期待看到同樣的結果在以前的在副本模式下運行:
# mongodump --db local --collection 'oplog.rs' --port 37018
Thu Nov 5 13:51:17.614 [initandlisten] connection accepted from 127.0.0.1:54388 #10 (1 connection now open)
Thu Nov 5 13:51:17.615 DATABASE: local to dump/local
# find dump/ -ls
917559 4 drwxr-xr-x 3 root root 4096 Nov 5 13:51 dump/
917560 4 drwxr-xr-x 2 root root 4096 Nov 5 13:51 dump/local
我們在這裏什麼都看不到。
檢查,看看我們是否能在所有達到oplog.rs ...
# mongo --port 37018
MongoDB shell version: 2.4.14
connecting to: 127.0.0.1:37018/test
> use local;
switched to db local
> show tables;
startup_log
>
並沒有oplog.rs收集....
所以是時間來修正手動或我瞭解錯了什麼嗎?