2016-02-11 54 views
9

我最近在我的電腦上有一些存儲問題,所以我更改了mongo.conf文件以減小日誌的大小。這些都是我放了行。Mongo異常

mmapv1: 
    smallFiles: true 

然而,每次當我嘗試有了新的變化,我得到這個錯誤(不只是正常工作變動)運行蒙戈。你能告訴我有什麼問題嗎?


2016-02-11T22:32:14.002+0000 I FTDC [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK

2016-02-11T22:32:14.023+0000 W FTDC [ftdc] Uncaught exception in 'UnknownError Caught std::exception of type boost::filesystem::filesystem_error: boost::filesystem::file_size: No such file or directory: "/data/db/diagnostic.data/metrics.interim.temp"' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem.

回答

11

我會嘗試刪除該目錄/data/db/diagnostic.data

您也可以通過使用選項開始蒙戈禁用診斷數據收集:

setParameter: 
    diagnosticDataCollectionEnabled: false 
+0

你碰巧知道我是否刪除該目錄究竟發生了什麼?安裝時我不認爲我檢查了發送診斷。 –

+1

如果您刪除該目錄,它將被重新創建。我建議您只在服務器停止時刪除該目錄。診斷數據收集默認啓用。它不會在任何地方「發送」,它只在本地收集。 – helmy

+0

爲了澄清,'diagnostics.data'目錄本質上包含了一個定期的'db.serverStatus()'輸出記錄,並且它不會被髮送到任何地方。如果您與MongoDB有支持協議,可能會要求您上傳此目錄的內容以獲得支持/疑難解答。 –

1

我有同樣的問題後,當HD是溢滿高達100%的MongoDB失敗。下面是日誌:

2016-10-03T10:13:42.017+0000 I CONTROL [initandlisten] MongoDB starting : pid=12630 port=27017 dbpath=/var/lib/mongo 64-bit host=drft006 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] db version v3.2.9 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] allocator: tcmalloc 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] modules: none 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] build environment: 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten]  distmod: rhel62 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten]  distarch: x86_64 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten]  target_arch: x86_64 
2016-10-03T10:13:42.018+0000 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { port: 27017, unixDomainSocket: { filePermissions: 511 } }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongo", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } } 
2016-10-03T10:13:42.045+0000 I -  [initandlisten] Detected data files in /var/lib/mongo created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 
2016-10-03T10:13:42.045+0000 W -  [initandlisten] Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty. 
2016-10-03T10:13:42.045+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint. 
2016-10-03T10:13:42.045+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=93G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 
2016-10-03T10:13:42.465+0000 I FTDC  [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data' 
2016-10-03T10:13:42.465+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker 
2016-10-03T10:13:42.467+0000 I NETWORK [initandlisten] waiting for connections on port 27017 
2016-10-03T10:13:43.012+0000 I FTDC  [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK 
2016-10-03T10:13:43.045+0000 W FTDC  [ftdc] Uncaught exception in 'UnknownError: Caught std::exception of type boost::filesystem::filesystem_error: boost::filesystem::file_size: No such file or directory: "/var/lib/mongo/diagnostic.data/metrics.interim.temp"' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem. 

kill -ed的mongod和清除診斷文件夾的內容:

> rm -f /var/lib/mongo/diagnostic.data/* 

蒙戈日誌重啓後顯示:

2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] MongoDB starting : pid=12803 port=27017 dbpath=/var/lib/mongo 64-bit host=drft006 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] db version v3.2.9 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] allocator: tcmalloc 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] modules: none 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] build environment: 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten]  distmod: rhel62 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten]  distarch: x86_64 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten]  target_arch: x86_64 
2016-10-03T10:17:46.745+0000 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { port: 27017, unixDomainSocket: { filePermissions: 511 } }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongo", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } } 
2016-10-03T10:17:46.772+0000 I -  [initandlisten] Detected data files in /var/lib/mongo created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 
2016-10-03T10:17:46.772+0000 W -  [initandlisten] Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty. 
2016-10-03T10:17:46.772+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint. 
2016-10-03T10:17:46.772+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=93G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 
2016-10-03T10:17:47.128+0000 I FTDC  [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data' 
2016-10-03T10:17:47.128+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker 
2016-10-03T10:17:47.129+0000 I NETWORK [initandlisten] waiting for connections on port 27017 

和蒙戈沒問題。

1

如果您使用nodejs,請嘗試禁用/刪除服務器代碼中的調試模式。

步驟:

  1. rm -rf /{your_db_name}/diagnostic.data/
  2. 刪除或註釋掉mongoose.set('debug', true);
  3. 重啓蒙戈節點服務器