2015-04-14 220 views
2

我正在使用AWS和EC2和EBS。該系統確實工作並添加了安裝的EBS驅動器。然後我將驅動器映射到/ data並在更改mongod.conf之前添加/ data/db以獲取新的數據文件夾。現在mongo不會啓動。當我從ubuntu命令行輸入mongo時,我得到以下信息。無法連接到Mongo db

2015-04-14T10:49:21.292+0000 W NETWORK Failed to connect to 
    127.0.0.1:27017, reason: errno:111 Connection refused 
2015-04-14T10:49:21.294+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed 
at connect (src/mongo/shell/mongo.js:179:14) 
at (connect):1:6 at src/mongo/shell/mongo.js:179 
exception: connect failed 

如果我使用的mongod嘗試和得到的東西運行,它只是掛起如下:

2015-04-14T10:57:14.147+0000 I JOURNAL [initandlisten] journal dir=/data/db/journal 
2015-04-14T10:57:14.148+0000 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed 
2015-04-14T10:57:14.153+0000 I JOURNAL [durability] Durability thread started 

2015-04-14T10:57:14.153+0000 I JOURNAL [journal writer] Journal writer thread started 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] MongoDB starting : pid=1977 port=27017 dbpath=/data/db 64-bit host=ip-10-167-179-237 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] **  We suggest setting it to 'never' 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] **  We suggest setting it to 'never' 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] db version v3.0.1 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] git version: 534b5a3f9d10f00cd27737fbcd951032248b5952 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] build info: Linux ip-10-167-176-91 3.13.0-24-generiC#46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] allocator: tcmalloc 

2015-04-14T10:57:14.156+0000 I CONTROL [initandlisten] options: {} 

2015-04-14T10:57:14.198+0000 I NETWORK [initandlisten] waiting for connections on port 27017 

我試圖消除mongod.lock文件,它只是返回。日誌似乎根本沒有新條目。系統在更改conf之前確實有效,這是通過添加/數據和新的EBS的唯一改變。我有最新版本的mongo和ubuntu。

回答

2

OK,我解決了這個用

sudo service mongod start 

然後我用命令

mongo 

這打開了的數據庫接口。

我發現了一些引用來啓動mongo和我有的消息。

+0

這確實有效,當我重新啓動EC2時,舊的錯誤返回並且上述現在不起作用。 –