2016-12-28 154 views
1

的MongoDB是完美的工作,直到有一天它生成一個鎖文件,並停止開始,錯誤如下:MongoDB的操作不允許

16-12-28T17:50:14.559+0100 I CONTROL [initandlisten] build environment: 
2016-12-28T17:50:14.559+0100 I CONTROL [initandlisten]  distmod: debian71 
2016-12-28T17:50:14.559+0100 I CONTROL [initandlisten]  distarch: x86_64 
2016-12-28T17:50:14.559+0100 I CONTROL [initandlisten]  target_arch: x86_64 
2016-12-28T17:50:14.559+0100 I CONTROL [initandlisten] options: {} 
2016-12-28T17:50:14.577+0100 I -  [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 
2016-12-28T17:50:14.577+0100 I STORAGE [initandlisten] 
2016-12-28T17:50:14.577+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 
2016-12-28T17:50:14.577+0100 I STORAGE [initandlisten] **   See http://dochub.mongodb.org/core/prodnotes-filesystem 
2016-12-28T17:50:14.577+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1024M,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-12-28T17:50:14.590+0100 E STORAGE [initandlisten] WiredTiger error (1) [1482943814:590694][32048:0x7f27c7cdcc80], file:WiredTiger.wt, connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted 
2016-12-28T17:50:14.591+0100 I -  [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267 
2016-12-28T17:50:14.591+0100 I STORAGE [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating 
2016-12-28T17:50:14.591+0100 I NETWORK [initandlisten] shutdown: going to close listening sockets... 
2016-12-28T17:50:14.591+0100 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock 
2016-12-28T17:50:14.591+0100 I NETWORK [initandlisten] shutdown: going to flush diaglog... 
2016-12-28T17:50:14.591+0100 I CONTROL [initandlisten] now exiting 
2016-12-28T17:50:14.591+0100 I CONTROL [initandlisten] shutting down with code:100 

我已刪除了所有軟件包並重新安裝所有的MongoDB的服務,沒有運氣。

回答

1

假設權限正確。這可能是一個selinux問題,請嘗試:

setenforce 0 

然後嘗試啓動服務器。如果服務器啓動,您將不得不使用semanage設置適當的上下文到mongo數據文件夾

+1

這似乎奏效了。 – Goodwin

+1

https://stopdisablingselinux.com/ –

2

你試過這個嗎?

須藤CHOWN -R⁠⁠⁠⁠id-u⁠⁠⁠⁠/數據/分貝

+0

是的我已經使mongod文件夾的所有者,甚至嘗試使所有文件讀取寫入。 – Goodwin

+0

確保您沒有運行mongod實例。 運行以下命令查看是否存在正在後臺運行的實例:ps aux | grep mongo 如果有這樣的情況:24337 bla bla mongod do:kill 24337 然後喲可能可以正常運行。 –

0

我試圖在更改權限後使用新帳戶啓動,這裏是問題開始。通過更改數據文件目錄的所有權作爲Shreya提到