2017-04-30 4 views
0

私はmongodbに裏打ちされたアプリを開発中です。 dbサーバとのやり取りは、シェルからであれ、アプリケーションからのプログラムであれ、問題なく動作します。問題は、サーバーをrootとして実行した場合にのみ機能します。それ以外の場合は動作しません。私は窓で作業するときにこの問題はありません。私はubuntu 16.04を使用しています。ubuntuでMongodがクラッシュする16.04

まず、dbパスでしたが、私は設定ファイルを変更しました。そして、それはロックファイルを作成することはできません私に言った、と私はパーミッションを変更し、(私は、これは良い習慣であるかどうかわからないんだけど)、今、私はこのエラーを持っている:

Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 
2017-04-29T21:22:44.897+0100 I STORAGE [initandlisten] 
2017-04-29T21:22:44.897+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 
2017-04-29T21:22:44.897+0100 I STORAGE [initandlisten] **   See http://dochub.mongodb.org/core/prodnotes-filesystem 
2017-04-29T21:22:44.897+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=413M,session_max=20000,eviction=(threads_min=4,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), 
2017-04-29T21:22:44.922+0100 E STORAGE [initandlisten] WiredTiger error (1) [1493497364:922160][28430:0x7f168c50dcc0], file:WiredTiger.wt, connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted 
2017-04-29T21:22:44.924+0100 I -  [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267 
2017-04-29T21:22:44.924+0100 I STORAGE [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating 

また、私がしようとするとservice mongod startをサービスとして実行するには、そのようなサービスファイルがないというエラーが発生します。私は/ etc/systemd/systemディレクトリにmongod.serviceファイルを作成しましたが、それでも同じエラーはありません。そのようなファイルはありません。ここで

systemctl status mongodの結果である:

mongod.service - MongoDB Database Service 
    Loaded: loaded (/etc/systemd/system/mongod.service; enabled; vendor preset: enabled) 
    Active: inactive (dead) (Result: exit-code) since ح 2017-04-30 00:15:00 WEST; 14h ago 
    Process: 958 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100) 
Main PID: 958 (code=exited, status=100) 

أبر 30 00:15:00 archer09 systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a 
أبر 30 00:15:00 archer09 systemd[1]: mongod.service: Unit entered failed state. 
أبر 30 00:15:00 archer09 systemd[1]: mongod.service: Failed with result 'exit-code'. 
أبر 30 00:15:00 archer09 systemd[1]: mongod.service: Service hold-off time over, scheduling restart. 
أبر 30 00:15:00 archer09 systemd[1]: Stopped MongoDB Database Service. 
أبر 30 00:15:00 archer09 systemd[1]: mongod.service: Start request repeated too quickly. 
أبر 30 00:15:00 archer09 systemd[1]: Failed to start MongoDB Database Service. 

答えて

0

私は同じ問題がありました。

sudo systemctl start mongod私の環境では動作しないようです。

sudo service mongod start私の最後に問題を解決してください。

sudo systemctl status mongodがくれた使用

mongod.service - High-performance, schema-free document-oriented database 
    Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled) 
    Active: active (running) since Wed 2018-01-24 13:01:38 UTC; 44min ago 
    Docs: https://docs.mongodb.org/manual 
Main PID: 23900 (mongod) 
    Tasks: 25 
    Memory: 143.9M 
     CPU: 8.935s 
    CGroup: /system.slice/mongod.service 
      └─23900 /usr/bin/mongod --config /etc/mongod.conf