2011-12-15 12 views
3

Mongoを実行しようとしています。Homebrewを使用してmongodbをインストールする際に問題が発生する

私はその後、Mongoのサイトにあるコマンドを使用し、パッケージマネージャにHomebrew

をインストール:

$ brew update 
$ brew install mongodb 

これは正しくインストールして登場。
私は新しいターミナルウィンドウでmongoを入力して、次のエラーを得た:

MongoDB shell version: 2.0.1 
connecting to: test 
Thu Dec 15 09:37:25 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84 
exception: connect failed 

だから私は、その後here

で見つかった命令はmongodを実行し、これが結果である続く:

mongod --help for help and startup options 
Thu Dec 15 09:38:49 [initandlisten] MongoDB starting : pid=7364 port=27017 dbpath=/data/db/ 64-bit host=Mike-Fieldens-iMac.local 
Thu Dec 15 09:38:49 [initandlisten] db version v2.0.1, pdfile version 4.5 
Thu Dec 15 09:38:49 [initandlisten] git version: 3a5cf0e2134a830d38d2d1aae7e88cac31bdd684 
Thu Dec 15 09:38:49 [initandlisten] build info: Darwin erh2.10gen.cc 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40 
Thu Dec 15 09:38:49 [initandlisten] options: {} 
Thu Dec 15 09:38:49 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating 
Thu Dec 15 09:38:49 dbexit: 
Thu Dec 15 09:38:49 [initandlisten] shutdown: going to close listening sockets... 
Thu Dec 15 09:38:49 [initandlisten] shutdown: going to flush diaglog... 
Thu Dec 15 09:38:49 [initandlisten] shutdown: going to close sockets... 
Thu Dec 15 09:38:49 [initandlisten] shutdown: waiting for fs preallocator... 
Thu Dec 15 09:38:49 [initandlisten] shutdown: lock for final commit... 
Thu Dec 15 09:38:49 [initandlisten] shutdown: final commit... 
Thu Dec 15 09:38:49 [initandlisten] shutdown: closing all files... 
Thu Dec 15 09:38:49 [initandlisten] closeAllFiles() finished 
Thu Dec 15 09:38:49 dbexit: really exiting now 

"initAndListen"で例外が発生し、シャットダウンしたことに注目してください。

私は間違っていますか?どのようにしてこのインストールを修正し、Mongoを起動して稼動させることができますか?

+1

助けを読む:dbpath(/ data/db /)が存在しません。終了する –

答えて

8

これは問題です:

15 09:38:49 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating 
Thu Dec 15 09:38:49 dbexit: 

は、システム上のパス/data/dbを作成し、それが動作します。

+0

'usr'の下にパスを作成しますか? –

+2

Nm ...私はばかです...私は本当に基金であると思います:) –

+0

'/ data/db'はあなたが' mongod'を実行するユーザからの書き込み権限を持っている必要があります。 '--dbpath'コマンドライン引数で代替データディレクトリを指定することができます。 – dcrosta

関連する問題