Unable to start mongod with option --logpath

113 views
Skip to first unread message

林森

unread,
Jul 6, 2017, 8:22:27 AM7/6/17
to mongodb-user
Hi, 

Mongod can start well without option --logpath , but once I add the option --logpath, it seems can't work well..

This the log file when starting mongod with option --logpath.
➜  mongo git:(master) ./mongod --dbpath ~/mongo/rocksdb/data --storageEngine rocksdb --logpath ~/mongo/rocksdb/log/mongod.log --logappend --port 20000
2017-07-06T15:28:17.187+0800 I STORAGE  [main] Compression: snappy
2017-07-06T15:28:17.187+0800 I STORAGE  [main] MaxWriteMBPerSec: 1024
2017-07-06T15:28:17.187+0800 I STORAGE  [main] Crash safe counters: 0
2017-07-06T15:28:17.187+0800 I STORAGE  [main] Counters: 1
2017-07-06T15:28:17.187+0800 I STORAGE  [main] Use SingleDelete in index: 0

It seems stucked ..

This is log file when starting mongod without option --logpath.
➜  mongo git:(master) ./mongod --dbpath ~/mongo/rocksdb/data --storageEngine rocksdb  --port 20000
2017-07-06T15:46:03.774+0800 I STORAGE  [main] Compression: snappy
2017-07-06T15:46:03.775+0800 I STORAGE  [main] MaxWriteMBPerSec: 1024
2017-07-06T15:46:03.775+0800 I STORAGE  [main] Crash safe counters: 0
2017-07-06T15:46:03.775+0800 I STORAGE  [main] Counters: 1
2017-07-06T15:46:03.775+0800 I STORAGE  [main] Use SingleDelete in index: 0
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten] MongoDB starting : pid=11751 port=20000 dbpath=/home/zhaoj/mongo/rocksdb/data 64-bit host=zhaoj
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten] db version v3.5.9-162-gedc858c
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten] git version: edc858ca3a32974c07f027e6860a52ac6e89039b
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten] modules: rocks 
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten] build environment:
2017-07-06T15:46:03.781+0800 I CONTROL  [initandlisten]     distarch: x86_64
2017-07-06T15:46:03.782+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2017-07-06T15:46:03.782+0800 I CONTROL  [initandlisten] options: { net: { port: 20000 }, storage: { dbPath: "/home/zhaoj/mongo/rocksdb/data", engine: "rocksdb" } }
2017-07-06T15:46:03.814+0800 I STORAGE  [initandlisten] 0 dropped prefixes need compaction
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] 
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] ** NOTE: This is a development version (3.5.9-162-gedc858c) of MongoDB.
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **       Not recommended for production.
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] 
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] 
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **          addressses it should serve responses from, or with --bind_ip_all to
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2017-07-06T15:46:03.822+0800 I CONTROL  [initandlisten] 
2017-07-06T15:46:03.825+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/home/zhaoj/mongo/rocksdb/data/diagnostic.data'

Thanks in advance.


Wan Bachtiar

unread,
Jul 27, 2017, 10:32:55 PM7/27/17
to mongodb-user

Mongod can start well without option —logpath , but once I add the option —logpath, it seems can’t work well..

Hi,

Could you describe what do you mean by "can't working well" ?
Did you try connecting using a mongo shell and it returned some error messages ?
Also check the content of ~/mongo/rocksdb/log/mongod.log file, and see if there’s any error or other messages that would help you.

The command line option —logpath is to send logging information to a log file instead of to standard output.
In your case, when you specified --logpath and it showed STORAGE logging into standard out it may be a logging misconfiguration of the storage engine. i.e. rocksdb

Regards,
Wan.

Reply all
Reply to author
Forward
0 new messages