MongoDB suddenly missing / data not found - mongodb

Our MongoDB database in Digital Ocean suddenly went missing. When I run mongod, it says:
MongoDB starting : pid=27161 port=27017 dbpath=/data/db 64-bit host=unifyhub-db
2017-01-07T17:36:06.617+0800 I CONTROL [initandlisten] db version v3.0.11
2017-01-07T17:36:06.617+0800 I CONTROL [initandlisten] git version: 48f8b49dc30cc2485c6c1f3db31b723258fcbf39
2017-01-07T17:36:06.617+0800 I CONTROL [initandlisten] build info: Linux ip-10-65-215-98 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2017-01-07T17:36:06.617+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-01-07T17:36:06.617+0800 I CONTROL [initandlisten] options: {}
2017-01-07T17:36:06.676+0800 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2017-01-07T17:36:06.677+0800 E NETWORK [initandlisten] addr already in use
2017-01-07T17:36:06.677+0800 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2017-01-07T17:36:06.677+0800 I CONTROL [initandlisten] dbexit: rc: 100
Do you have any idea what happen here? We actually didn't do anything, we just found out that the whole application was not working because the database can't be found.

I think you were hijacked!
according to http://thehackernews.com/2017/01/secure-mongodb-database.html and http://securityaffairs.co/wordpress/55018/cyber-crime/mongodb-hacked.html there is a hacker targeting the opened MongoDB databases, and asks for ransom to return your data back.
I faced the exact same problem as yours. I thought it is something related to digital-ocean but after reading those posts, I checked my server and it is confirmed that it was hijacked.
I opened a mongo shell
mongo;
listed the databases
show dbs;
found a database called READ1 I checked it and found a collection with only one record, a message from the hijacker
use READ1;
show collections; // found a collection called info
db.info.find()
found this document:
{ "_id" : ObjectId("5877674456ae6684507ac017"), "mail" :
"ha******#si*****.org", "text" : "SEND 0.1 BTC TO THIS ADDRESS *****
AND CONTACT THIS EMAIL WITH IP OF YOUR SERVER TO RECOVER YOUR DATABASE
!" }
unfortunately, I didn't check the server since a while and I only keep the last five backups, so I lost my data. But luckily we are still in development mode and we don't have sensitive data.
anyway, I found my Mongodb version (2.4.10 Tokumx distribution) allows remote access by default. I tried the following from my local machine and it is surprisingly connected!!
mongo server-ip:27017/database-name
Finally, I made the following steps to disable the remote access
ps aux | grep mongo //found path of the configuration file (/etc/tokumx.conf)
then as described here, I used vim to append the line bind_ip = 127.0.0.1 to the configuration files
then restarted my tokumx service (mongodb in your case)
sudo service tokumx restart
Now remote access is disabled.

Make sure your config file is loaded by explicitly calling it when running mongod:
mongod --config /etc/mongod.conf
And in your /etc/mongod.conf file make sure you have
bindIp: 127.0.0.1
Now after restarting with this config file, like Ahmed ElBayaa says (I could not comment because of low reputation), try from a remote machine to connect using:
mongo server-ip:27017/
If all is configured correctly this connection should be refused!

Related

loading docker container from existing project, mongo will not connect to database Ubuntu 18.04

At first I had a problem where the mongod service stopped working altogether. Thereupon I completely uninstalled mongodb and reinstalled it and followed instructions per this thread: https://askubuntu.com/questions/921753/failed-to-start-mongod-service-unit-mongod-service-not-found
This caused the mongod service to finally start.
In order for it to work, I also had to follow instructions from this thread:
mongo - couldn't connect to server 127.0.0.1:27017
So far this configuration has worked only 1 time and that was after I followed the instructions to remove the .lock file in the mongod directory and then repair mongod.
I also tried to remove the sock file like stated here: MongoDB Failing to Start - ***aborting after fassert() failure
Full project reset
Then I tried just disconnecting the project entirely; close nodemon for backend, exit ng serve on frontend, stop and remove mongo docker container... And tried again. Here is my step-by-step process after everything should have been fixed:
Restart mongod service
sudo service mongod restart
Restart frontend (executed from frontend directory)
ng serve frontend
Restart backend (executed from backend directory)
npx nodemon backend
Restart mongo container (executed from deploy directory, mongo is the docker container name, I'm building it from existing provided deploy script)
sudo docker-compose up -d mongo
sudo docker ps -a # check container was created and is running
Debugging information:
sudo service mongod status
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset:
Active: active (running) since Thu 2020-01-09 11:21:43 CET; 3min 40s ago
Docs: https://docs.mongodb.org/manual
Main PID: 17242 (mongod)
CGroup: /system.slice/mongod.service
└─17242 /usr/bin/mongod --config /etc/mongod.conf
janv. 09 11:21:43 junior-LIFEBOOK-E752 systemd[1]: Started MongoDB Database Server
sudo mongod2020-01-09T11:25:45.983+0100 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] MongoDB starting : pid=17727 port=27017 dbpath=/data/db 64-bit host=junior-LIFEBOOK-E752
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] db version v4.2.2
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] allocator: tcmalloc
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] modules: none
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] build environment:
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] distmod: ubuntu1804
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] distarch: x86_64
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] target_arch: x86_64
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] options: {}
2020-01-09T11:25:45.987+0100 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] now exiting
2020-01-09T11:25:45.987+0100 I CONTROL [initandlisten] shutting down with code:48
sudo mongo
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("8e813fc2-049c-440d-83ce-0b1d8516c4d0") }
MongoDB server version: 4.2.2
Server has startup warnings:
2020-01-09T11:21:43.352+0100 I STORAGE [initandlisten]
2020-01-09T11:21:43.352+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-01-09T11:21:43.352+0100 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-01-09T11:21:44.848+0100 I CONTROL [initandlisten]
2020-01-09T11:21:44.848+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-01-09T11:21:44.848+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-01-09T11:21:44.848+0100 I CONTROL [initandlisten]
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).
The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.
To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
So something weird is happening here, it doesn't find the database from the project and I have no clue why. As far as I can see, it creates a new database including my system details.
How can I fix this please and connect to the project database? I can't move further until I do.
it's been resolved. First I found out I didn't need to have the mongod service running locally because mongo was already included in the docker container. But actually this wasn't a database issue at all. There were a few things going wrong like there was a proxy but the command had been changed to execute the connection, endpoints were on localhost but weren't supposed to be, and the content I was expecting to see had been hidden by a careless push from another developer. Fun times! But we can move on now. Thanks to the people who tried to help!

Rails Exception Mongo::Error::NoServerAvailable

I want to use MongoDB with my Rails app.
The error is not uncommon but none of the suggestions has worked for me.
I've installed mongodb using homebrew and followed the folowing the steps for same
brew update
brew install mongodb
sudo mkdir -p /data/db
sudo chmod 777 /data/db
brew tap homebrew/services
I use brew services start mongodb to start my mongodb server and get the following response
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] MongoDB starting : pid=39164 port=27017 dbpath=/data/db 64-bit host=C168s-iMac.local
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] db version v3.6.2
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] allocator: system
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] modules: none
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] build environment:
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] distarch: x86_64
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] target_arch: x86_64
2018-02-08T12:27:59.072+0530 I CONTROL [initandlisten] options: {}
2018-02-08T12:27:59.089+0530 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-02-08T12:27:59.089+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3584M,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),statistics_log=(wait=0),verbose=(recovery_progress),
2018-02-08T12:28:01.222+0530 I STORAGE [initandlisten] WiredTiger message [1518073081:222686][39164:0x7fffa9db0340], txn-recover: Main recovery loop: starting at 2/18944
2018-02-08T12:28:01.330+0530 I STORAGE [initandlisten] WiredTiger message [1518073081:330012][39164:0x7fffa9db0340], txn-recover: Recovering log 2 through 3
2018-02-08T12:28:01.442+0530 I STORAGE [initandlisten] WiredTiger message [1518073081:442109][39164:0x7fffa9db0340], txn-recover: Recovering log 3 through 3
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten]
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten]
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten]
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten]
2018-02-08T12:28:02.563+0530 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2018-02-08T12:28:02.572+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2018-02-08T12:28:02.572+0530 I NETWORK [initandlisten] waiting for connections on port 27017
2018-02-08T12:28:09.302+0530 I NETWORK [listener] connection accepted from 127.0.0.1:51073 #1 (1 connection now open)
2018-02-08T12:28:09.302+0530 I NETWORK [conn1] received client metadata from 127.0.0.1:51073 conn: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.6.2" }, os: { type: "Darwin", name: "Mac OS X", architecture: "x86_64", version: "17.2.0" } }
Along with this I also start mongo
cd /usr/local/bin
mongod
which starts as expected.
I created my rails app without the ActiveRecord and used mongiod gem. Next i created the config file using rails g mongoid:config and added Mongoid.load! './config/mongoid.yml' in application.rb file so the config file is loaded.
The content for mongoid.yml is
development:
clients:
default:
database: mongo_db_demo_development
hosts:
- localhost:27017
test:
clients:
default:
database: mongo_db_demo_test
hosts:
- localhost:27017
options:
read:
mode: :primary
max_pool_size: 1
I created my scaffold for Person and the model was created as expected using include Mongoid::Document. I went ahead and used the index of person as my root_path.
When i run the rails server, I get the following error
ActionView::Template::Error (No server is available matching preference: # using server_selection_timeout=30 and local_threshold=0.015):
I know its an exception by rails but cant seem to resolve it for hours now.
I referred this tutorial to get started. The weird thing is that I was successful to set up the app in accessing it and the next day it crashed with this error without any changes. I'm able to access the books's new page /books/new but cant seem to save it, hence making it clear that the app is unable to access the database.
I've since uninstalled mongodb twice wondering if the installation has some problem but cant seem to figure out whats wrong.
I understand there are many similar questions but none to resolve my issue. I don't understand what I'm missing and going wrong. Any help is appreciated.
Thanks
Update
I was somehow able to run another project that had active record and mongodb in it. Here is the same. I was successful in saving the data to the post model proving that the mongod and mongo are running and the setup is done correctly. Which means that I'm missing something in my app configuration but yet, I've no clue.

mongodump gives segmentation fault

I have MongoDB v3.2.6 installed on my mac macOs High Sierra v10.13.1 and I am trying to make a backup before I upgrade.
I have an instance of $ mongod running in one window using defaut db location and default port.
It is my local database, it is not protected by a password and does not require ssl conncetions.
I can access my databases find using $ mongo or Robomongo but when I run $ mongodump or $ mongodump --db mydatabase I get the following error
[1] 1815 segmentation fault mongodump
UPDATE: I have tried to run mongostat and now I get the following error :
[1] 2404 bus error mongodump
Here is the log I get when starting the db with $ mongod :
2017-12-25T12:36:26.642+0000 I CONTROL [initandlisten] MongoDB starting : pid=3216 port=27017 dbpath=/data/db 64-bit host=MBP-de-Kevin.home
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] db version v3.2.6
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] git version: 05552b562c7a0b3143a729aaa0838e558dc49b25
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2m 2 Nov 2017
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] allocator: system
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] modules: none
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] build environment:
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] distarch: x86_64
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-12-25T12:36:26.643+0000 I CONTROL [initandlisten] options: {}
2017-12-25T12:36:26.644+0000 I - [initandlisten] Detected data files in /data/db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2017-12-25T12:36:26.653+0000 I JOURNAL [initandlisten] journal dir=/data/db/journal
2017-12-25T12:36:26.654+0000 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2017-12-25T12:36:26.674+0000 I JOURNAL [durability] Durability thread started
2017-12-25T12:36:26.675+0000 I JOURNAL [journal writer] Journal writer thread started
2017-12-25T12:36:26.894+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-12-25T12:36:26.894+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2017-12-25T12:36:26.894+0000 I NETWORK [initandlisten] waiting for connections on port 27017
What am I doing wrong and How can I debug?
I was experiencing the same problem. I am on macOS High Sierra 10.13.3. My mongo version was mongodb 3.2.7. I read this in the documentation of mongodump:
MAC OSX SIERRA AND GO 1.6 INCOMPATIBILITY
Users running on Mac OSX Sierra require the 3.2.10 or newer version of mongodump.
I upgraded to mongodb 3.6.2 and I my issue was resolved.
I fixed my error using brew upgrade mongodb. Still dont know what was the issue.
That said it is better to follow one of these guide upgrade mongodb to avoid other issues.

Problems starting MongoDB on Windows

I did the mongodb installation, but when I try to start in windows 10 console, the log shows me the following:
C:\WINDOWS\system32>"C:\Program
Files\MongoDB\Server\3.6\bin\mongod.exe" 2017-12-13T11:09:06.089-0700
I CONTROL [initandlisten] MongoDB starting : pid=11240 port=27017
dbpath=C:\data\db\ 64-bit host=DESKTOP-5GUM84N
2017-12-13T11:09:06.089-0700 I CONTROL [initandlisten] targetMinOS:
Windows 7/Windows Server 2008 R2 2017-12-13T11:09:06.090-0700 I
CONTROL [initandlisten] db version v3.6.0
2017-12-13T11:09:06.091-0700 I CONTROL [initandlisten] git version:
a57d8e71e6998a2d0afde7edc11bd23e5661c915 2017-12-13T11:09:06.092-0700
I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22
Sep 2016 2017-12-13T11:09:06.092-0700 I CONTROL [initandlisten]
allocator: tcmalloc 2017-12-13T11:09:06.092-0700 I CONTROL
[initandlisten] modules: none 2017-12-13T11:09:06.093-0700 I CONTROL
[initandlisten] build environment: 2017-12-13T11:09:06.093-0700 I
CONTROL [initandlisten] distmod: 2008plus-ssl
2017-12-13T11:09:06.094-0700 I CONTROL [initandlisten] distarch:
x86_64 2017-12-13T11:09:06.095-0700 I CONTROL [initandlisten]
target_arch: x86_64 2017-12-13T11:09:06.095-0700 I CONTROL
[initandlisten] options: {} 2017-12-13T11:09:06.100-0700 I -
[initandlisten] Detected data files in C:\data\db\ created by the
'wiredTiger' storage engine, so setting the active storage engine to
'wiredTiger'. 2017-12-13T11:09:06.101-0700 I STORAGE [initandlisten]
wiredtiger_open config:
create,cache_size=3534M,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),statistics_log=(wait=0),verbose=(recovery_progress),
2017-12-13T11:09:06.574-0700 I STORAGE [initandlisten] WiredTiger
message [1513188546:574263][11240:140724166549840], txn-recover: Main
recovery loop: starting at 10/4608 2017-12-13T11:09:06.787-0700 I
STORAGE [initandlisten] WiredTiger message
[1513188546:786400][11240:140724166549840], txn-recover: Recovering
log 10 through 11 2017-12-13T11:09:07.034-0700 I STORAGE
[initandlisten] WiredTiger message
[1513188547:34042][11240:140724166549840], txn-recover: Recovering log
11 through 11 2017-12-13T11:09:07.732-0700 I CONTROL [initandlisten]
2017-12-13T11:09:07.732-0700 I CONTROL [initandlisten] ** WARNING:
Access control is not enabled for the database.
2017-12-13T11:09:07.733-0700 I CONTROL [initandlisten] **
Read and write access to data and configuration is unrestricted.
2017-12-13T11:09:07.735-0700 I CONTROL [initandlisten]
2017-12-13T11:09:07.735-0700 I CONTROL [initandlisten] ** WARNING:
This server is bound to localhost. 2017-12-13T11:09:07.736-0700 I
CONTROL [initandlisten] ** Remote systems will be unable to
connect to this server. 2017-12-13T11:09:07.736-0700 I CONTROL
[initandlisten] ** Start the server with --bind_ip
to specify which IP 2017-12-13T11:09:07.737-0700 I CONTROL
[initandlisten] ** addresses it should serve responses from,
or with --bind_ip_all to 2017-12-13T11:09:07.737-0700 I CONTROL
[initandlisten] ** bind to all interfaces. If this behavior
is desired, start the 2017-12-13T11:09:07.738-0700 I CONTROL
[initandlisten] ** server with --bind_ip 127.0.0.1 to disable
this warning. 2017-12-13T11:09:07.738-0700 I CONTROL [initandlisten]
2017-12-13T11:09:07.739-0700 I CONTROL [initandlisten]
2017-12-13T11:09:07.739-0700 I CONTROL [initandlisten] ** WARNING:
The file system cache of this machine is configured to be greater than
40% of the total memory. This can lead to increased memory pressure
and poor performance. 2017-12-13T11:09:07.740-0700 I CONTROL
[initandlisten] See
http://dochub.mongodb.org/core/wt-windows-system-file-cache
2017-12-13T11:09:07.740-0700 I CONTROL [initandlisten]
2017-12-13T15:09:08.161-0300 W FTDC [initandlisten] Failed to
initialize Performance Counters for FTDC: WindowsPdhError:
PdhExpandCounterPathW failed with 'The specified object is not
found on the computer.' for counter '\Memory\Available Bytes'
2017-12-13T15:09:08.161-0300 I FTDC [initandlisten] Initializing
full-time diagnostic data capture with directory
'C:/data/db/diagnostic.data' 2017-12-13T15:09:08.165-0300 I NETWORK
[initandlisten] waiting for connections on port 27017
I followed all the intructions in https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#run-mongodb-community-edition
but i can't start mongodb. anyone knows how to fix this launch error ?
I hope your help guys :c
Regards!
Your mongod actually started successfully initially in the beginning. The log output:
NETWORK [initandlisten] waiting for connections on port 27017
indicates that the mongod is online and waiting for connections on the specified port. You could have at that point opened a mongo shell on the same machine to connect to the mongod.
However, I understand that the warnings as displayed could indicate that there was an issue in operation. We've updated our documentation to address this:
You can find the documentation in question here:
Run MongoDB Community on Windows
It looks like other users have helped you with getting a good working configuration file, but I'd like to pick apart the original output to clarify any confusion encountered there.
Lets start by breaking up your original mongod process output:
CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-12-13T11:09:07.733-0700
This is a warning that indicates you did not start the mongod process using authentication or authorization. Since it seems like you are using the default settings for 3.6, this is an expected informational warning. Please read through the MongoDB documentation on authentication when you get a chance and plan for implementing simple authentication, especially if the mongod will be exposed to the public internet at any point in time.
The next warning is:
CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2017-12-13T11:09:07.736-0700
By default in MongoDB 3.6, the mongod binds to the localhost address. In short, the mongod only listens for connections on the local machine. This gives you time to configure authentication before you open up your MongoDB deployment to your private network or the public internet.
As noted by other users, you can resolve this by setting the net.bindIp in your configuration file:
net:
bindIp: 127.0.0.1
When you are ready to open the mongod to non-localhost connections, just append an IP address associated to a network adapter on the host machine. For example, if the host machine has a network adapter 192.168.1.15, you can add that to bindIp. This tells the mongod to listen for incoming connections on both addresses.
net:
bindIp: "127.0.0.1,192.168.1.15"
As far as the FTDC warning, the \Memory\Available Bytes counter is related to Windows Performance Management - you can read more about that here. You may need to configure some Windows components to enable that counter. Its also possible that the counter is only available (or accessible) in the Server architectures of Windows.
The warning is informational and should not impact normal operations, unless you are heavily reliant on FTDC data for your work.
You can find more information on log messages in MongoDB in our Log Message documentation.
i believe this message is from mongod(mongodb server).
and now you have to run mongo.exe inside "bin"folder to connect to the server(with mongod on, don't close the window) in order to start mongodb.
make sure you created a mongod.cfg inside C:\Program Files\MongoDB\Server\3.6\mongod.cfg
which is from step 3 Create a configuration file.
open that file and type those things below to mongod.cfg
systemLog:
destination: file
path: c:\data\log\mongod.cfg
storage:
dbPath: c:\data\db
if there's still error try to copy and past these code inside mongod.cfg:
systemLog:
destination: file
path: c:\data\log\mongod.cfg
logAppend: true
storage:
journal:
enabled: true
processManagement:
fork: true
net:
bindIp: 127.0.0.1
port: 27017
setParameter:
enableLocalhostAuthBypass: false
Put the following in your mongod.cfg
net:
port: 27017
bindIp: "127.0.0.1"
Then the MONGO command can connect to the local instance.

Mongodb not working properly : Socket already in use?

I am taking the mongodb university class and having problems getting mongod to work properly. I have been trying for hours to try to get it to work properly, but I keep getting the same error.
When I try to run mongod I am getting this error:
erics-mbp:~ emlandst$ mongod --dbpath data
2015-08-16T18:55:24.186-0400 E NETWORK [initandlisten] listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
2015-08-16T18:55:24.186-0400 E NETWORK [initandlisten] addr already in use
2015-08-16T18:55:24.186-0400 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory data not found., terminating
2015-08-16T18:55:24.186-0400 I CONTROL [initandlisten] dbexit: rc: 100
If I am correct the server is set to run on port 27017 by default and for some reason it is being blocked. I tried the ps waux | grep mongo and then I killed the instance, but still i get the same error.
I am trying to just delete everything so I can start all over, but I have no idea how to do that. I'm sure it is simple I just don't have a lot of experience. Thank you