Mongo shell connection failed after adding authentication of adminOfAnyDatabase - mongodb

root#ip-172-31-34-204:/tmp/asterisk-16.1.1# sudo mongod --repair
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] MongoDB starting : pid=1980 port=27017 dbpath=/data/db 64-bit host=ip-172-31-34-204
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] db version v3.4.13
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] git version: fbdef2ccc53e0fcc9afb570063633d992b2aae42
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] modules: none
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] build environment:
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] distarch: x86_64
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-02-11T10:55:19.993+0000 I CONTROL [initandlisten] options: { repair: true }
2020-02-11T10:55:19.997+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-02-11T10:55:19.997+0000 I STORAGE [initandlisten] Detected WT journal files. Running recovery from last checkpoint.
2020-02-11T10:55:19.997+0000 I STORAGE [initandlisten] journal to nojournal transition config: create,cache_size=1459M,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),
2020-02-11T10:55:20.015+0000 E STORAGE [initandlisten] WiredTiger error (-31802) [1581418520:15471][1980:0x7fac126bad00], txn-recover: unsupported WiredTiger file version: this build only supports major/minor versions up to 1/0, and the file is version 2/0: WT_ERROR: non-specific WiredTiger error
2020-02-11T10:55:20.015+0000 E STORAGE [initandlisten] WiredTiger error (0) [1581418520:15533][1980:0x7fac126bad00], txn-recover: WiredTiger is unable to read the recovery log.
2020-02-11T10:55:20.015+0000 E STORAGE [initandlisten] WiredTiger error (0) [1581418520:15552][1980:0x7fac126bad00], txn-recover: This may be due to the log files being encrypted, being from an older version or due to corruption on disk
2020-02-11T10:55:20.015+0000 E STORAGE [initandlisten] WiredTiger error (0) [1581418520:15562][1980:0x7fac126bad00], txn-recover: You should confirm that you have opened the database with the correct options including all encryption and compression options
2020-02-11T10:55:20.015+0000 E STORAGE [initandlisten] WiredTiger error (-31802) [1581418520:15632][1980:0x7fac126bad00], txn-recover: Recovery failed: WT_ERROR: non-specific WiredTiger error
2020-02-11T10:55:20.018+0000 I - [initandlisten] Assertion: 28718:-31802: WT_ERROR: non-specific WiredTiger error src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 254
2020-02-11T10:55:20.018+0000 I STORAGE [initandlisten] exception in initAndListen: 28718 -31802: WT_ERROR: non-specific WiredTiger error, terminating
2020-02-11T10:55:20.018+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2020-02-11T10:55:20.018+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2020-02-11T10:55:20.018+0000 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2020-02-11T10:55:20.018+0000 I CONTROL [initandlisten] now exiting
2020-02-11T10:55:20.018+0000 I CONTROL [initandlisten] shutting down with code:100
Before this I've tried giving the account authentication: How to secure MongoDB with username and password
Can not connect to mongo also:
root#ip-172-31-34-204:/tmp/asterisk-16.1.1# mongo
MongoDB shell version v3.4.13
connecting to: mongodb://127.0.0.1:27017
2020-02-11T10:56:37.487+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2020-02-11T10:56:37.487+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:240:13
#(connect):1:6
exception: connect failed

Related

How to configure two MongoDB servers in one local system?

In order to do replication in MongoDB in Windows 10, Multiple servers are needed in a single system. But the client cannot connect to the server. After the host is created using
mongod --bind_ip localhost,My-Example-Associated-Hostname
The output is
2020-07-09T19:41:00.708+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-07-09T19:41:01.913+0530 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-07-09T19:41:02.065+0530 I CONTROL [initandlisten] MongoDB starting : pid=18840 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-1R3OPQG
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] db version v4.2.7
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] git version: 51d9fe12b5d19720e72dcd7db0f2f17dd9a19212
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] allocator: tcmalloc
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] modules: none
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] build environment:
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] distmod: 2012plus
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] distarch: x86_64
2020-07-09T19:41:02.066+0530 I CONTROL [initandlisten] target_arch: x86_64
2020-07-09T19:41:02.067+0530 I CONTROL [initandlisten] options: { net: { bindIp: "localhost,My-Example-Associated-Hostname" } }
2020-07-09T19:41:03.115+0530 W NETWORK [initandlisten] Found no addresses for HostNotFound: Could not find address for My-Example-Associated-Hostname:27017: SocketException: No such host is known.
2020-07-09T19:41:03.142+0530 I STORAGE [initandlisten] Detected data files in C:\data\db\ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-07-09T19:41:03.143+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3533M,cache_overflow=(file_max=0M),session_max=33000,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,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
2020-07-09T19:41:03.348+0530 I STORAGE [initandlisten] WiredTiger message [1594303863:347681][18840:140716566797904], txn-recover: Recovering log 11 through 12
2020-07-09T19:41:03.497+0530 I STORAGE [initandlisten] WiredTiger message [1594303863:497260][18840:140716566797904], txn-recover: Recovering log 12 through 12
2020-07-09T19:41:03.641+0530 I STORAGE [initandlisten] WiredTiger message [1594303863:641697][18840:140716566797904], txn-recover: Main recovery loop: starting at 11/6144 to 12/256
2020-07-09T19:41:03.900+0530 I STORAGE [initandlisten] WiredTiger message [1594303863:899522][18840:140716566797904], txn-recover: Recovering log 11 through 12
2020-07-09T19:41:04.077+0530 I STORAGE [initandlisten] WiredTiger message [1594303864:77045][18840:140716566797904], txn-recover: Recovering log 12 through 12
2020-07-09T19:41:04.210+0530 I STORAGE [initandlisten] WiredTiger message [1594303864:209691][18840:140716566797904], txn-recover: Set global recovery timestamp: (0, 0)
2020-07-09T19:41:04.667+0530 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2020-07-09T19:41:04.704+0530 I STORAGE [initandlisten] Timestamp monitor starting
2020-07-09T19:41:04.799+0530 I CONTROL [initandlisten]
2020-07-09T19:41:04.800+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-07-09T19:41:04.801+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-07-09T19:41:04.801+0530 I CONTROL [initandlisten]
2020-07-09T19:41:04.895+0530 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2020-07-09T19:41:04.915+0530 I STORAGE [initandlisten] Flow Control is enabled on this deployment.
2020-07-09T19:41:04.916+0530 I SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
2020-07-09T19:41:04.933+0530 I SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
2020-07-09T19:41:04.961+0530 I SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
2020-07-09T19:41:07.946+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2020-07-09T19:41:07.950+0530 I SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
2020-07-09T19:41:07.997+0530 I SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
2020-07-09T19:41:08.045+0530 I NETWORK [listener] Listening on 127.0.0.1
2020-07-09T19:41:08.045+0530 I NETWORK [listener] waiting for connections on port 27017
2020-07-09T19:41:08.083+0530 I SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
Then in the client I give
mongo --host My-Example-Associated-Hostname
But the output is
MongoDB shell version v4.2.7
connecting to: mongodb://My-Example-Associated-Hostname:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-07-09T19:41:30.776+0530 E QUERY [js] Error: couldn't connect to server My-Example-Associated-Hostname:27017, connection attempt failed: HostNotFound: Could not find address for My-Example-Associated-Hostname:27017: SocketException: No such host is known. :
connect#src/mongo/shell/mongo.js:341:17
#(connect):2:6
2020-07-09T19:41:30.812+0530 F - [main] exception: connect failed
2020-07-09T19:41:30.812+0530 E - [main] exiting with code 1
How can I solve this?
Your hostname is not connect in client call. It should be mongo --host localhost

Mongod exits with error code: 62 when attempting to start mongod

I tried to start mongod and got this error
forked process: 4271
ERROR: child process failed, exited with error number 62
To see additional information in this output, start without the "--fork" option.
I retried with sudo mongod and got this instead
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] MongoDB starting : pid=4275 port=27017 dbpath=/data/db 64-bit host=dhcp020-218-083.wireless.buffalo.edu
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] db version v4.2.1
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] git version: edf6d45851c0b9ee15548f0f847df141764a317e
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] allocator: system
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] modules: none
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] build environment:
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] distarch: x86_64
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] target_arch: x86_64
2019-11-26T12:54:27.563-0500 I CONTROL [initandlisten] options: {}
2019-11-26T12:54:27.564-0500 I STORAGE [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2019-11-26T12:54:27.564-0500 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7680M,cache_overflow=(file_max=0M),session_max=33000,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,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
2019-11-26T12:54:28.082-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:81997][4275:0x114a835c0], txn-recover: Recovering log 35 through 36
2019-11-26T12:54:28.131-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:131917][4275:0x114a835c0], txn-recover: Recovering log 36 through 36
2019-11-26T12:54:28.180-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:180756][4275:0x114a835c0], txn-recover: Main recovery loop: starting at 35/896 to 36/256
2019-11-26T12:54:28.259-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:259184][4275:0x114a835c0], txn-recover: Recovering log 35 through 36
2019-11-26T12:54:28.306-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:306249][4275:0x114a835c0], txn-recover: Recovering log 36 through 36
2019-11-26T12:54:28.345-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:345839][4275:0x114a835c0], txn-recover: Set global recovery timestamp: (0,0)
2019-11-26T12:54:28.399-0500 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2019-11-26T12:54:28.405-0500 I STORAGE [initandlisten] Timestamp monitor starting
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten]
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten]
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten]
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten]
2019-11-26T12:54:28.405-0500 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2019-11-26T12:54:28.407-0500 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2019-11-26T12:54:28.408-0500 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: BadValue: Invalid value for version, found 3.6, expected '4.2' or '4.0'. Contents of featureCompatibilityVersion document in admin.system.version: { _id: "featureCompatibilityVersion", version: "3.6" }. See http://dochub.mongodb.org/core/4.0-feature-compatibility.). If the current featureCompatibilityVersion is below 4.0, see the documentation on upgrading at http://dochub.mongodb.org/core/4.0-upgrade-fcv.
2019-11-26T12:54:28.408-0500 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2019-11-26T12:54:28.408-0500 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-11-26T12:54:28.408-0500 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2019-11-26T12:54:28.408-0500 I STORAGE [initandlisten] Deregistering all the collections
2019-11-26T12:54:28.408-0500 I STORAGE [initandlisten] Timestamp monitor shutting down
2019-11-26T12:54:28.408-0500 I STORAGE [initandlisten] WiredTigerKVEngine shutting down
2019-11-26T12:54:28.408-0500 I STORAGE [initandlisten] Shutting down session sweeper thread
2019-11-26T12:54:28.408-0500 I STORAGE [initandlisten] Finished shutting down session sweeper thread
2019-11-26T12:54:28.408-0500 I STORAGE [initandlisten] Shutting down journal flusher thread
2019-11-26T12:54:28.499-0500 I STORAGE [initandlisten] Finished shutting down journal flusher thread
2019-11-26T12:54:28.500-0500 I STORAGE [initandlisten] Shutting down checkpoint thread
2019-11-26T12:54:28.500-0500 I STORAGE [initandlisten] Finished shutting down checkpoint thread
2019-11-26T12:54:28.500-0500 I STORAGE [initandlisten] Downgrading WiredTiger datafiles.
2019-11-26T12:54:28.576-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:576019][4275:0x114a835c0], txn-recover: Recovering log 36 through 37
2019-11-26T12:54:28.615-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:615152][4275:0x114a835c0], txn-recover: Recovering log 37 through 37
2019-11-26T12:54:28.666-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:666135][4275:0x114a835c0], txn-recover: Main recovery loop: starting at 36/2048 to 37/256
2019-11-26T12:54:28.744-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:744560][4275:0x114a835c0], txn-recover: Recovering log 36 through 37
2019-11-26T12:54:28.790-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:790388][4275:0x114a835c0], txn-recover: Recovering log 37 through 37
2019-11-26T12:54:28.831-0500 I STORAGE [initandlisten] WiredTiger message [1574790868:831263][4275:0x114a835c0], txn-recover: Set global recovery timestamp: (0,0)
2019-11-26T12:54:28.964-0500 I STORAGE [initandlisten] shutdown: removing fs lock...
2019-11-26T12:54:28.965-0500 I CONTROL [initandlisten] now exiting
2019-11-26T12:54:28.965-0500 I CONTROL [initandlisten] shutting down with code:62```
I already checked to see if I have a /data/db folder and I do, I tried to delete the data folder and recreate it with no luck. I checked on the forums and error code 62 means that the data/db folder is on a different version than the MongoDB installation, I'm not sure how I would go about fixing this error.

Error while restarting Mongodb

I tried to restart MongoDB on my server, but I got an error. The error log:
2018-05-24T12:22:08.308+0200 I CONTROL [main] ***** SERVER RESTARTED *****
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] MongoDB starting : pid=13662 port=27017 dbpath=/var/lib/mongodb 64-bit host=Challenger
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] db version v3.6.5
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] git version: a20ecd3e3a174162052ff99913bc2ca9a839d618
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] allocator: tcmalloc
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] modules: none
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] build environment:
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] distmod: ubuntu1604
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] distarch: x86_64
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] target_arch: x86_64
2018-05-24T12:22:08.422+0200 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1", port: 27017 }, processManagement: { timeZoneInfo: "/usr/share/zoneinfo" }, storage: { dbPath: "/var/lib/mongodb",$
2018-05-24T12:22:08.424+0200 I - [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-05-24T12:22:08.424+0200 I STORAGE [initandlisten]
2018-05-24T12:22:08.424+0200 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-05-24T12:22:08.424+0200 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-05-24T12:22:08.424+0200 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=256M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,log=(enabled=true,ar$
2018-05-24T12:22:09.379+0200 E STORAGE [initandlisten] WiredTiger error (1) [1527157329:379309][13662:0x7f6ea10839c0], file:WiredTiger.wt, connection: /var/lib/mongodb/WiredTiger.wt: handle-open: open: Operation not permitted
2018-05-24T12:22:09.380+0200 E - [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 416
2018-05-24T12:22:09.402+0200 I STORAGE [initandlisten] exception in initAndListen: Location28595: 1: Operation not permitted, terminating
2018-05-24T12:22:09.402+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2018-05-24T12:22:09.402+0200 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-05-24T12:22:09.402+0200 I CONTROL [initandlisten] now exiting
2018-05-24T12:22:09.402+0200 I CONTROL [initandlisten] shutting down with code:100
can anyone tell me what the bug is?

mongo: “exception: connect failed”

I am trying to connect to the mongo server, using the "mongo" command in the command prompt and this error is showing: "exception: connect failed"
Here is how I am trying to do it:
enter image description here
This is the mongodb.log
2018-03-27T14:00:19.299+0800 I CONTROL [main] ***** SERVER RESTARTED *****
2018-03-27T14:00:19.647+0800 I CONTROL [main] Trying to start Windows service 'MongoDB'
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] MongoDB starting : pid=10480 port=27017 dbpath=d:\mongodbData\db 64-bit host=DESKTOP-KEA31I3
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] db version v3.6.3
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] allocator: tcmalloc
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] modules: none
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] build environment:
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] distarch: x86_64
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] target_arch: x86_64
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] options: { service: true, storage: { dbPath: "d:\mongodbData\db" }, systemLog: { destination: "file", logAppend: true, path: "d:\mongodbData\log\mongodb.log" } }
2018-03-27T14:00:19.651+0800 I - [initandlisten] Detected data files in d:\mongodbData\db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-03-27T14:00:19.651+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7632M,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-03-27T14:00:19.834+0800 I STORAGE [initandlisten] WiredTiger message [1522130419:833660][10480:140722874245456], txn-recover: Main recovery loop: starting at 4/6272
2018-03-27T14:00:19.970+0800 I STORAGE [initandlisten] WiredTiger message [1522130419:970024][10480:140722874245456], txn-recover: Recovering log 4 through 5
2018-03-27T14:00:20.046+0800 I STORAGE [initandlisten] WiredTiger message [1522130420:46191][10480:140722874245456], txn-recover: Recovering log 5 through 5
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.173+0800 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.
2018-03-27T14:00:20.174+0800 I CONTROL [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-03-27T14:00:20.174+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.402+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'd:/mongodbData/db/diagnostic.data'
2018-03-27T14:00:20.404+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2018-03-27T14:00:20.404+0800 I STORAGE [initandlisten] Service running
Please help me. How to fix it
Run this following command :
sudo service mongodb stop
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart
mongo

MongoDB server running, I get "mongo: command not found"

I`ve started mongoDB and it seems like its running fine, I think (see message below)? Then I open a new terminal window and I try to use the "mongo" command I get the following message:
-bash: mongo: command not found
When I try commands such as "use newtest", it says
-bash: use: command not found
My Path:
PATH=/Users/myname/.npm-global/bin:$PATH
Here is the message when I start mongoDB:
myname-MacBook-Air:~ myname$ mongod
I CONTROL [initandlisten] MongoDB starting : pid=581 port=27017 dbpath=/data/db 64-bit host=myname-MacBook-Air.local
I CONTROL [initandlisten] db version v3.6.2
I CONTROL [initandlisten] git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
I CONTROL [initandlisten] OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
I CONTROL [initandlisten] allocator: system
I CONTROL [initandlisten] modules: none
I CONTROL [initandlisten] build environment:
I CONTROL [initandlisten] distarch: x86_64
I CONTROL [initandlisten] target_arch: x86_64
I CONTROL [initandlisten] options: {}
W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
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),
I STORAGE [initandlisten] WiredTiger message [1519475976:405758][581:0x7fff95b02340], txn-recover: Main recovery loop: starting at 4/3200
I STORAGE [initandlisten] WiredTiger message [1519475976:408878][581:0x7fff95b02340], txn-recover: Recovering log 4 through 5
I STORAGE [initandlisten] WiredTiger message [1519475976:564148][581:0x7fff95b02340], txn-recover: Recovering log 5 through 5
I CONTROL [initandlisten]
I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
I CONTROL [initandlisten]
I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
I CONTROL [initandlisten]
I CONTROL [initandlisten]
I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
I NETWORK [initandlisten] waiting for connections on port 27017
I FTDC [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK
What am I doing wrong here to start mongodB? Or am I misunderstanding it?
Thanks :)