I can't go further wehn start mongod --auth

I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker hang on this for long time in ubuntu

I can’t go further can anyone help me out

Thanks

This is an odd case. Could you please provide a full screenshot or, better yet, a copy/paste of the whole input and output in the terminal? That can help us get a better understanding.

Hi mohammed_22880,

You may find this topic discussion useful. If you use the --fork option the mongod daemon process will run in the background.

1 Like

Ahhh!! It’s not a matter of an error and a hanging process, but of the process running in foreground! I hadn’t put 2 and 2 together on that, because I’m not yet familiar with all the output that mongo can throw on the console.

2019-01-14T05:13:11.888+0000 I CONTROL [initandlisten] MongoDB starting : pid=10308 port=27017 dbpath=/data/db 64-bit host=database
2019-01-14T05:13:11.889+0000 I CONTROL [initandlisten] db version v3.2.22
2019-01-14T05:13:11.889+0000 I CONTROL [initandlisten] git version: 105acca0d443f9a47c1a5bd608fd7133840a58dd
2019-01-14T05:13:11.889+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2019-01-14T05:13:11.890+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-01-14T05:13:11.890+0000 I CONTROL [initandlisten] modules: enterprise
2019-01-14T05:13:11.890+0000 I CONTROL [initandlisten] build environment:
2019-01-14T05:13:11.891+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2019-01-14T05:13:11.891+0000 I CONTROL [initandlisten] distarch: x86_64
2019-01-14T05:13:11.891+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-01-14T05:13:11.891+0000 I CONTROL [initandlisten] options: { security: { authorization: “enabled” } }
2019-01-14T05:13:11.911+0000 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2019-01-14T05:13:11.911+0000 I CONTROL [initandlisten] dbexit: rc: 100
vagrant@database:~ sudo mmkdir -p /data/db sudo: mmkdir: command not found vagrant@database:~ sudo mkdir -p /data/db
vagrant@database:~ mongod --auth 2019-01-14T05:13:36.553+0000 I CONTROL [initandlisten] MongoDB starting : pid=10313 port=27017 dbpath=/data/db 64-bit host=database 2019-01-14T05:13:36.553+0000 I CONTROL [initandlisten] db version v3.2.22 2019-01-14T05:13:36.553+0000 I CONTROL [initandlisten] git version: 105acca0d443f9a47c1a5bd608fd7133840a58dd 2019-01-14T05:13:36.553+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014 2019-01-14T05:13:36.554+0000 I CONTROL [initandlisten] allocator: tcmalloc 2019-01-14T05:13:36.554+0000 I CONTROL [initandlisten] modules: enterprise 2019-01-14T05:13:36.554+0000 I CONTROL [initandlisten] build environment: 2019-01-14T05:13:36.554+0000 I CONTROL [initandlisten] distmod: ubuntu1404 2019-01-14T05:13:36.554+0000 I CONTROL [initandlisten] distarch: x86_64 2019-01-14T05:13:36.555+0000 I CONTROL [initandlisten] target_arch: x86_64 2019-01-14T05:13:36.555+0000 I CONTROL [initandlisten] options: { security: { authorization: "enabled" } } 2019-01-14T05:13:36.571+0000 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating 2019-01-14T05:13:36.572+0000 I CONTROL [initandlisten] dbexit: rc: 100 vagrant@database:~ sudo chown -R vagrant:vagrant /data/db
vagrant@database:~$ mongod --auth
2019-01-14T05:13:57.283+0000 I CONTROL [initandlisten] MongoDB starting : pid=10318 port=27017 dbpath=/data/db 64-bit host=database
2019-01-14T05:13:57.283+0000 I CONTROL [initandlisten] db version v3.2.22
2019-01-14T05:13:57.283+0000 I CONTROL [initandlisten] git version: 105acca0d443f9a47c1a5bd608fd7133840a58dd
2019-01-14T05:13:57.284+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2019-01-14T05:13:57.284+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-01-14T05:13:57.284+0000 I CONTROL [initandlisten] modules: enterprise
2019-01-14T05:13:57.284+0000 I CONTROL [initandlisten] build environment:
2019-01-14T05:13:57.284+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2019-01-14T05:13:57.285+0000 I CONTROL [initandlisten] distarch: x86_64
2019-01-14T05:13:57.285+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-01-14T05:13:57.285+0000 I CONTROL [initandlisten] options: { security: { authorization: “enabled” } }
2019-01-14T05:13:57.302+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,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),verbose=(recovery_progress),
2019-01-14T05:14:01.019+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/data/db/diagnostic.data’
2019-01-14T05:14:01.020+0000 I NETWORK [initandlisten] waiting for connections on port 27017
2019-01-14T05:14:01.020+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker

@ mohammed_22880

I’m sorry, but this seems very unclear. Where are you in this process? How did you start your VMs – especially since another of your posts suggests that you’re having problems with those – and where and how did you get into the VM? And which VM are you in? If you can clarify this a bit, I’ll try to help.

The first time they started MongoD I saw permission errors and missing directories. The second time looks fine, no? It’s just waiting for a connection.