what up with my mongodb. mongod terminal command not running it shows this - linux

IM new to mongodb . & i use linux mint as my machine and in that i tried to install mongodb in it. Now when i run mongod in linux terminal i get this lines.
2020-04-05T14:08:30.899+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-05T14:08:30.936+0530 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] MongoDB starting : pid=6844 port=27017 dbpath=/data/db 64-bit host=meon1-Vostro-3558
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] db version v4.2.5
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] modules: none
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] build environment:
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] distmod: ubuntu1804
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] distarch: x86_64
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] target_arch: x86_64
2020-04-05T14:08:30.936+0530 I CONTROL [initandlisten] options: {}
2020-04-05T14:08:30.936+0530 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted
2020-04-05T14:08:30.936+0530 F - [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 684
2020-04-05T14:08:30.936+0530 F - [initandlisten]
***aborting after fassert() failure
While sudo systemctl status mongodb show it`s running. What is wrong with it?

Can you please check your /tmp folder and see if file mongodb-27017.sock exists.
if yes then please remove it-
sudo rm -rf mongodb-27017.sock

Related

MongoDB Doesn't Run

I just installed mongoDB with AUR in arch and tried to run it just like;
mongod
but it always says;
2019-05-11T17:07:09.608+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] MongoDB starting : pid=27076 port=27017 dbpath=/data/db 64-bit host=manjaro
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] db version v4.0.9
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] git version: fc525e2d9b0e4bceff5c2201457e564362909765
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1b 26 Feb 2019
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] modules: none
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] build environment:
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] distmod: ubuntu1804
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] distarch: x86_64
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] options: { storage: { dbPath: "/data/db", mmapv1: { smallFiles: true } } }
2019-05-11T17:07:09.611+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2019-05-11T17:07:09.612+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2019-05-11T17:07:09.612+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-05-11T17:07:09.612+0000 I CONTROL [initandlisten] now exiting
2019-05-11T17:07:09.612+0000 I CONTROL [initandlisten] shutting down with code:100
What should I do?
2019-05-11T17:07:09.611+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
You're missing a path to it's db directory. Create one in your root folder using:
sudo mkdir /data/db
sudo recommended here, sometimes mongoDB can run in to permission issues otherwise.

How to start Mongo Db after download. Command ./mongod not working

2018-10-08T15:49:48.157+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] MongoDB starting : pid=65956 port=27017 dbpath=/data/db 64-bit host=Mayurs-MacBook-Air.local
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] db version v4.0.2
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] git version: fc1573ba18aee42f97a3bb13b67af7d837826b47
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] allocator: system
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] modules: none
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] build environment:
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] distarch:
x86_64
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] target_arch: x86_64
2018-10-08T15:49:48.175+0530 I CONTROL [initandlisten] options: {}
2018-10-08T15:49:48.175+0530 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2018-10-08T15:49:48.176+0530 I CONTROL [initandlisten] now exiting
2018-10-08T15:49:48.176+0530 I CONTROL [initandlisten] shutting down with code:100
How can solve this?
In the default configuration, mongodb uses /data/db directory for storing its database files.
2018-10-08T15:49:48.175+0530 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
This shows that the directory does not exist, so you have to create it.
Try:
sudo mkdir /data
sudo mkdir /data/db
sudo mkdir /data/logs
I'm not sure if the last command will be needed, but just fire it to be safe.
An alternative to this would be to find the mongo config file (I don't know where it is on macOs) and then change the /data/db path inside it to your desired location that exists.

MongoDB not starting on Ubuntu 17.10

So I'm trying to install MongoDB for use with Node.js, but every time I try to run mongod --dbpath ~/Documents/nodejs-basics/nodetest1/data I get this error:
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] MongoDB starting : pid=4873 port=27017 dbpath=/home/brandon1407/Documents/nodejs-basics/nodetest1/data/ 64-bit host=xubuntu01
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] db version v3.6.0
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] git version: a57d8e71e6998a2d0afde7edc11bd23e5661c915
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] modules: none
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] build environment:
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] distmod: ubuntu1604
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] distarch: x86_64
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] target_arch: x86_64
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] options: { storage: { dbPath: "/home/brandon1407/Documents/nodejs-basics/nodetest1/data/" } }
2017-12-09T19:26:55.943-0800 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] now exiting
2017-12-09T19:26:55.943-0800 I CONTROL [initandlisten] shutting down with code:48
I had previously received a similar error about the /data/db directory missing so I created that directory but got the above error instead. Read through multiple questions asked here, but haven' found anything. It all works just fine on Windows 8.1 though which is strange.

bitnami mean does not work using bitnami script

Im using bitnami 3.2.11-0, when I try to start serivce something bad occurs and neither service could be started.
root#ip-172-31-15-96:/home/bitnami/apps/api# sudo service bitnami start
resize2fs 1.42.9 (4-Feb-2014)
The filesystem is already 26212055 blocks long. Nothing to do!
/opt/bitnami/mongodb/scripts/ctl.sh : mongodb could not be started
/opt/bitnami/php/scripts/ctl.sh : php-fpm could not be started
Syntax OK
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
/opt/bitnami/apache2/scripts/ctl.sh : httpd could not be started
/opt/bitnami/var/init/post-start/040_update_ip: 17: /opt/bitnami/var/init/post-start/040_update_ip: /opt/bitnami/apps/*/bnconfig: not found
daemon with PID 1454 awakened
ERROR: child process failed, exited with error number 14
about to fork child process, waiting until server is ready for connections.
forked process: 1559
2017-10-09T21:33:01.815+0000 I CONTROL [main] ***** SERVER RESTARTED *****
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] MongoDB starting : pid=1559 port=27017 dbpath=/opt/bitnami/mongodb/data/db 64-bit host=ip-172-31-15-96
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] db version v3.2.11
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] allocator: tcmalloc
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] modules: none
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] build environment:
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] distarch: x86_64
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] options: { config: "/opt/bitnami/mongodb/mongodb.conf", net: { bindIp: "127.0.0.1", port: 27017, unixDomainSocket: { filePermissions: 502, pathPrefix: "/opt/bitnami/mongodb/tmp" } }$
2017-10-09T21:33:01.842+0000 I - [initandlisten] Detected data files in /opt/bitnami/mongodb/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-10-09T21:33:01.842+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=sn$
2017-10-09T21:33:02.088+0000 E STORAGE [initandlisten] WiredTiger (1) [1507584782:87985][1559:0x7fb7a2216cc0], file:collection-51-8988087643268075125.wt, WT_SESSION.open_cursor: /opt/bitnami/mongodb/data/db/collection-51-898808764326807$
2017-10-09T21:33:02.088+0000 I - [initandlisten] Invariant failure: ret resulted in status UnknownError: 1: Operation not permitted at src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp 79
2017-10-09T21:33:02.097+0000 I CONTROL [initandlisten]
0x1313f62 0x12be9c8 0x12a6ced 0x10910e4 0x108f9e0 0x108ba02 0x108a40d 0x107afbb 0xfda4b4 0xfe0252 0x1079838 0xf9d4c8 0x96270e 0x964cb0 0x967ebd 0x7fb7a1117f45 0x95f0c9
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"F13F62","s":"_ZN5mongo15printStackTraceERSo"},{"b":"400000","o":"EBE9C8","s":"_ZN5mongo10logContextEPKc"},{"b":"400000","o":"EA6CED","s":"_ZN5mongo17invariantOKFailedEPKcRKNS_6StatusES1_j"},{"b":"400000",$
mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x1313f62]
mongod(_ZN5mongo10logContextEPKc+0x138) [0x12be9c8]
mongod(_ZN5mongo17invariantOKFailedEPKcRKNS_6StatusES1_j+0xAD) [0x12a6ced]
mongod(_ZN5mongo17WiredTigerSession9getCursorERKSsmb+0xE4) [0x10910e4]
mongod(_ZN5mongo16WiredTigerCursorC1ERKSsmbPNS_16OperationContextE+0x50) [0x108f9e0]
mongod(_ZN5mongo21WiredTigerRecordStore6CursorC1EPNS_16OperationContextERKS0_b+0x92) [0x108ba02]
mongod(_ZN5mongo21WiredTigerRecordStoreC1EPNS_16OperationContextENS_10StringDataES3_SsbbllPNS_14CappedCallbackEPNS_20WiredTigerSizeStorerE+0x3ED) [0x108a40d]
mongod(_ZN5mongo18WiredTigerKVEngine14getRecordStoreEPNS_16OperationContextENS_10StringDataES3_RKNS_17CollectionOptionsE+0x1AB) [0x107afbb]
mongod(_ZN5mongo22KVDatabaseCatalogEntry14initCollectionEPNS_16OperationContextERKSsb+0x204) [0xfda4b4]
mongod(_ZN5mongo15KVStorageEngineC1EPNS_8KVEngineERKNS_22KVStorageEngineOptionsE+0x6D2) [0xfe0252]
mongod(+0xC79838) [0x1079838]
mongod(_ZN5mongo20ServiceContextMongoD29initializeGlobalStorageEngineEv+0x598) [0xf9d4c8]
mongod(+0x56270E) [0x96270e]
mongod(_ZN5mongo13initAndListenEi+0x10) [0x964cb0]
mongod(main+0x15D) [0x967ebd]
libc.so.6(__libc_start_main+0xF5) [0x7fb7a1117f45]
mongod(+0x55F0C9) [0x95f0c9]
----- END BACKTRACE -----
2017-10-09T21:33:02.097+0000 I - [initandlisten]
***aborting after invariant() failure
ERROR: child process failed, exited with error number 14
If I try using bin command it'll run.
root#ip-172-31-15-96:/home/bitnami/apps/api# mongod
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] MongoDB starting : pid=15830 port=27017 dbpath=/data/db 64-bit host=ip-172-31-15-96
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] db version v3.2.11
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] allocator: tcmalloc
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] modules: none
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] build environment:
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] distarch: x86_64
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] options: {}
2017-10-09T19:13:48.572+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-10-09T19:13:48.572+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(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-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.725+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-10-09T19:13:48.725+0000 I NETWORK [initandlisten] waiting for connections on port 27017
2017-10-09T19:13:48.725+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
Has anyone experienced this before?
In bitnami stacks the following script is used:
sudo /opt/bitnami/ctlscript.sh start
I advise you to use that one but like this
sudo /opt/bitnami/ctlscript.sh restart
Finally i've reinstalled bitnami mean stack using wget.
$ wget https://bitnami.com/redirect/to/159963/bitnami-meanstack-3.4.9-0-linux-x64-installer.run
$ chmod +x ./bitnami-meanstack-3.4.9-0-linux-x64-installer.run
I followed the installer steps and then run $ sudo service bitnami start mongodb.
Thanks.

Error run mongod

when run command "mongod" in terminal. Cant access localhost:28017
my log
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] MongoDB starting : pid=12891 port=27017 dbpath=/data/db 64-bit host=lucaspc
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] db version v3.2.7
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] git version: 4249c1d2b5999ebbf1fdf3bc0e0e3b3ff5c0aaf2
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] allocator: tcmalloc
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] modules: none
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] build environment:
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] distmod: ubuntu1404
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] distarch: x86_64
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] target_arch: x86_64
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] options: {}
2016-07-08T11:31:15.531-0300 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2016-07-08T11:31:15.531-0300 E NETWORK [initandlisten] addr already in use
2016-07-08T11:31:15.531-0300 E STORAGE [initandlisten] Failed to set up sockets during startup.
2016-07-08T11:31:15.531-0300 I CONTROL [initandlisten] dbexit: rc: 48
There is already a process using the interface and port you want to use. You can find out what process that is using
sudo netstat -lpn | grep 27017
Then use
sudo kill <pid>
to stop it
Address already in use for socket: 0.0.0.0:27017
You already have an instance running on port 27017, change the port or kill the existing process.

Resources