2016-02-25 86 views
0

所以我附有有數據的磁盤/mnt/snapshotMongoDB的2.6.11不會啓動

我已經創建像這樣的軟鏈接:ln -s /mnt/snapshot/var/lib/mongo /var/lib/mongo

當我嘗試現在運行蒙戈服務(服務mongod的啓動) 這是輸出我得到:

2016-02-25T14:08:44.196+0000 ***** SERVER RESTARTED ***** 
2016-02-25T14:08:44.200+0000 [initandlisten] MongoDB starting : pid=10906 port=27017 dbpath=/var/lib/mongo 64-bit host=ip-10-0-0-149.localdomain 
2016-02-25T14:08:44.200+0000 [initandlisten] db version v2.6.11 
2016-02-25T14:08:44.200+0000 [initandlisten] git version: d00c1735675c457f75a12d530bee85421f0c5548 
2016-02-25T14:08:44.200+0000 [initandlisten] build info: Linux build4.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49 
2016-02-25T14:08:44.200+0000 [initandlisten] allocator: tcmalloc 
2016-02-25T14:08:44.200+0000 [initandlisten] options: { config: "/etc/mongod.conf", processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, security: { keyFile: "/srv/mongodb/keyfile" }, storage: { dbPath: "/var/lib/mongo" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } } 
2016-02-25T14:08:44.200+0000 [initandlisten] exception in initAndListen std::exception: boost::filesystem::status: Permission denied: "/var/lib/mongo", terminating 
2016-02-25T14:08:44.201+0000 [initandlisten] dbexit: 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: going to close listening sockets... 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: going to flush diaglog... 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: going to close sockets... 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: waiting for fs preallocator... 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: lock for final commit... 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: final commit... 
2016-02-25T14:08:44.201+0000 [initandlisten] shutdown: closing all files... 
2016-02-25T14:08:44.201+0000 [initandlisten] closeAllFiles() finished 
2016-02-25T14:08:44.201+0000 [initandlisten] dbexit: really exiting now 

權限:

[[email protected] lib]# ll /var/lib/mongo 
lrwxrwxrwx. 1 mongod mongod 27 feb 25 13:54 /var/lib/mongo -> /mnt/snapshot/var/lib/mongo 


[[email protected] mongo]# ll 
total 37846140 
drwxr-xr-x. 2 mongod mongod  4096 feb 9 16:16 admin 
-rw-r-xr-x. 1 mongod mongod 67108864 feb 9 16:16 admin.0 
-rw-r-xr-x. 1 mongod mongod 16777216 feb 9 16:16 admin.ns 
drwxr-xr-x. 2 mongod mongod  4096 feb 9 16:28 cgs 
-rw-r-xr-x. 1 mongod mongod 67108864 feb 24 16:58 cgs.0 
-rw-r-xr-x. 1 mongod mongod 134217728 feb 23 12:22 cgs.1 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:21 cgs.10 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:21 cgs.11 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:22 cgs.12 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:23 cgs.13 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:24 cgs.14 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:24 cgs.15 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:25 cgs.16 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:26 cgs.17 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:26 cgs.18 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:27 cgs.19 
-rw-r-xr-x. 1 mongod mongod 268435456 feb 9 16:55 cgs.2 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 10 12:17 cgs.20 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 23 12:22 cgs.21 
-rw-r-xr-x. 1 mongod mongod 536870912 feb 24 16:58 cgs.3 
-rw-r-xr-x. 1 mongod mongod 1073741824 feb 25 09:48 cgs.4 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:18 cgs.5 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:18 cgs.6 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:18 cgs.7 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 25 09:48 cgs.8 
-rw-r-xr-x. 1 mongod mongod 2146435072 feb 9 16:20 cgs.9 
-rw-r-xr-x. 1 mongod mongod 16777216 v 25 09:48 cgs.ns 
drwxr-xr-x. 2 mongod mongod  4096 feb 25 10:00 journal 
drwxr-xr-x. 2 mongod mongod  4096 feb 9 16:16 local 
-rw-r-xr-x. 1 mongod mongod 67108864 feb 25 09:46 local.0 
-rw-r-xr-x. 1 mongod mongod 16777216 feb 25 09:46 local.ns 
-rwxr-xr-x. 1 mongod mongod   0 feb 25 10:00 mongod.lock 
-rw-r-xr-x. 1 mongod mongod   69 dec 16 13:48 storage.bson 

任何幫助將不勝感激!

回答

1

好吧,我發現SElinux是個問題,出於某種原因,它不讓mongo從安裝的驅動器中讀取數據。

我不得不做的是:

setenforce 0 

和繁榮,沒有更多的問題。

我希望這可以幫助任何人。