Mongodb connection shows inappropriate number on mongo console. - mongodb

I am using Mongodb 3.2 version. Using Spring's org.springframework.data.mongodb.core.MongoTemplate and com.mongodb.Mongo for mongodb connections, queries and aggregation.
Software Configuration:
spring-core 4.1.6.RELEASE, spring-data-mongodb 1.8.2.RELEASE, mongo-java-driver 3.1.0, spring-context 4.1.6.RELEASE, Tomcat 8.
It looks like mongodb connections are not closing properly. At some time mongodb console shows 10 connections still active. Other than my webapp I use Robomongo tool to check mongodb data. So it should be only two connections at any point of time.
After i shutdown my tomcat and Robomongo, still there are 4 connections active and also at some point it had peaked to 10 with tomcat and Robomongo running.
Logs:
2016-07-16T12:29:12.835+0530 I CONTROL [initandlisten] MongoDB starting : pid=792 port=27017 dbpath=C:\mongodata 64-bit host=DESKTOP-SFNL93Q
2016-07-16T12:29:12.956+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2016-07-16T12:29:12.960+0530 I CONTROL [initandlisten] db version v3.2.6
2016-07-16T12:29:12.961+0530 I CONTROL [initandlisten] git version: 05552b562c7a0b3143a729aaa0838e558dc49b25
2016-07-16T12:29:12.962+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1p-fips 9 Jul 2015
2016-07-16T12:29:12.964+0530 I CONTROL [initandlisten] allocator: tcmalloc
2016-07-16T12:29:12.965+0530 I CONTROL [initandlisten] modules: none
2016-07-16T12:29:12.966+0530 I CONTROL [initandlisten] build environment:
2016-07-16T12:29:12.967+0530 I CONTROL [initandlisten] distmod: 2008plus-ssl
2016-07-16T12:29:12.968+0530 I CONTROL [initandlisten] distarch: x86_64
2016-07-16T12:29:12.969+0530 I CONTROL [initandlisten] target_arch: x86_64
2016-07-16T12:29:12.970+0530 I CONTROL [initandlisten] options: { storage: { dbPath: "C:\mongodata" } }
2016-07-16T12:29:12.993+0530 I - [initandlisten] Detected data files in C:\mongodata created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-07-16T12:29:12.999+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,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),
2016-07-16T12:29:14.717+0530 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-07-16T12:29:14.717+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/mongodata/diagnostic.data'
2016-07-16T12:29:14.744+0530 I NETWORK [initandlisten] waiting for connections on port 27017
2016-07-16T12:33:51.795+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53065 #1 (1 connection now open)
2016-07-16T12:41:16.247+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53243 #2 (2 connections now open)
2016-07-16T12:41:58.268+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53253 #3 (3 connections now open)
2016-07-16T12:41:58.318+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53254 #4 (4 connections now open)
2016-07-16T12:42:02.864+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53255 #5 (5 connections now open)
2016-07-16T12:42:02.922+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53256 #6 (6 connections now open)
2016-07-16T12:42:04.920+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53257 #7 (7 connections now open)
2016-07-16T12:42:04.958+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53258 #8 (8 connections now open)
2016-07-16T12:46:51.214+0530 I NETWORK [conn1] end connection 127.0.0.1:53065 (7 connections now open)
2016-07-16T12:46:51.216+0530 I NETWORK [conn2] end connection 127.0.0.1:53243 (7 connections now open)
2016-07-16T12:48:51.768+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53378 #9 (7 connections now open)
2016-07-16T12:51:07.622+0530 I NETWORK [conn9] end connection 127.0.0.1:53378 (6 connections now open)
2016-07-16T12:53:27.581+0530 I NETWORK [initandlisten] connection accepted from 127.0.0.1:53403 #10 (7 connections now open)
2016-07-16T12:54:20.400+0530 I NETWORK [conn3] end connection 127.0.0.1:53253 (6 connections now open)
2016-07-16T12:54:20.401+0530 I NETWORK [conn4] end connection 127.0.0.1:53254 (6 connections now open)
2016-07-16T12:55:38.285+0530 I NETWORK [conn10] end connection 127.0.0.1:53403 (4 connections now open)

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

WSL2 ubuntu Mongod Keeps changing ports whenever I start a local server up

I followed this link to setup mongodb on ubuntu wsl, and it kind of worked
https://github.com/michaeltreat/Windows-Subsystem-For-Linux-Setup-Guide/blob/master/readmes/installs/MongoDB.md
However, whenever I use the command sudo mongod --dbpath ~/data/db
It will open a Mongod server locally and display this
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] allocator: tcmalloc
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] modules: none
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] build environment:
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] distmod: ubuntu1604
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] distarch: x86_64
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] target_arch: x86_64
2020-05-07T14:50:56.880-0700 I CONTROL [initandlisten] options: { storage: { dbPath: "/home/misterjoe/data/db" } }
2020-05-07T14:50:56.880-0700 I - [initandlisten] Detected data files in /home/misterjoe/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-05-07T14:50:56.880-0700 I STORAGE [initandlisten]
2020-05-07T14:50:56.880-0700 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-05-07T14:50:56.880-0700 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-05-07T14:50:56.880-0700 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=5840M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2020-05-07T14:50:57.360-0700 I STORAGE [initandlisten] WiredTiger message [1588888257:360834][18606:0x7f3480c394c0], txn-recover: Main recovery loop: starting at 6/13440
2020-05-07T14:50:57.409-0700 I STORAGE [initandlisten] WiredTiger message [1588888257:409482][18606:0x7f3480c394c0], txn-recover: Recovering log 6 through 7
2020-05-07T14:50:57.441-0700 I STORAGE [initandlisten] WiredTiger message [1588888257:441849][18606:0x7f3480c394c0], txn-recover: Recovering log 7 through 7
2020-05-07T14:50:57.467-0700 I STORAGE [initandlisten] WiredTiger message [1588888257:467231][18606:0x7f3480c394c0], txn-recover: Set global recovery timestamp: 0
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten]
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten]
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten]
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten]
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2020-05-07T14:50:57.486-0700 I CONTROL [initandlisten]
2020-05-07T14:50:57.488-0700 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/home/misterjoe/data/db/diagnostic.data'
2020-05-07T14:50:57.489-0700 I NETWORK [initandlisten] listening via socket bound to 127.0.0.1
2020-05-07T14:50:57.489-0700 I NETWORK [initandlisten] listening via socket bound to /tmp/mongodb-27017.sock
2020-05-07T14:50:57.489-0700 I NETWORK [initandlisten] waiting for connections on port 27017
Then if I start an application with a mongo database I get this
2020-05-07T14:53:19.392-0700 I NETWORK [listener] connection accepted from 127.0.0.1:60332 #1 (1 connection now open)
2020-05-07T14:53:19.395-0700 I NETWORK [conn1] received client metadata from 127.0.0.1:60332 conn1: { driver: { name: "nodejs", version: "3.5.5" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.19.84-microsoft-standard" }, platform: "'Node.js v13.10.1, LE (legacy)" }
I am trying to keep it on the same port so I can use mongodb compass and have it go to a certain db of my choice. Like RedditClone or todoApp database. However if I type in that IP into it doesn't exist, and the only way I can see anything from this database is by using a .find({}) in javascript. Please help :(
What is your actual problem? Everything in your logs shows that you have set up a server and are able to successfully connect to it (from your local machine). It doesn't look like Compass provides a way to set a default database, like the mongo shell command line. If you can browse the available databases or create a new database in Compass, then you have connected to the server.
2020-05-07T14:50:57.489-0700 I NETWORK [initandlisten] waiting for connections on port 27017
This line indicates your started the server and it is listening on localhost:27017
2020-05-07T14:53:19.392-0700 I NETWORK [listener] connection accepted from 127.0.0.1:60332 #1 (1 connection now open)
This line indicates a new client successfully opened a connection to this server (in your case hosted on port 27017) from port 60332.
If you run the mongo shell, you will see another connection get opened to the server in the logs. Each client (in your case it sounds like Compass) will run on a dynamic port so you can run multiple clients at the same time. You don't connect to the client ports, just the server. The client port is telling the server what port to return results to.
The database specified in the URL is the authentication database, and since you don't have authentication enabled, it is ignored. To quote the docs:
mongodb://[username:password#]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
...
defaultauthdb
Optional. The authentication database to use if the connection string includes username:password# authentication credentials but the authSource option is unspecified.
If both authSource and defaultauthdb are unspecified, the client will attempt to authenticate the specified user to the admin database.

Cannot start a clean installation of MongoDB with a clean data directory UserNotFound

TLDR: I am unable to start a clean installation of Mongo (from ZIP) with an empty data directory, because of a UserNotFound Error (the not found user is from the old installation).
In more detail: My initial Mongo database is working fine. For testing purpose I moved my current data directory and created a new one. So I stopped my running Windows Service with
mongod --dbpath=C:\data\db --remove
created a new data directory and tried to start a new MongoDB in noauth mode with
mongod --dbpath=C:\data\db --noauth
And here begins the trouble: MongoDB tries to connect with an user from my old database which is nowhere mentioned in the current settings. Here is the log
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] MongoDB starting : pid=12508 port=27017 dbpath=C:\data\db 64-bit host=XXX
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] db version v3.6.8-45-g4f1bd30460
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] git version: 4f1bd3046036a8621c2ad5acde7cdf103a533226
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2o-fips 27 Mar 2018
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] allocator: tcmalloc
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] modules: none
2018-10-23T04:45:47.323-0700 I CONTROL [initandlisten] build environment:
2018-10-23T04:45:47.327-0700 I CONTROL [initandlisten] distmod: 2008plus-ssl
2018-10-23T04:45:47.327-0700 I CONTROL [initandlisten] distarch: x86_64
2018-10-23T04:45:47.327-0700 I CONTROL [initandlisten] target_arch: x86_64
2018-10-23T04:45:47.327-0700 I CONTROL [initandlisten] options: { security: { authorization: "disabled" }, storage: { dbPath: "C:\data\db" } }
2018-10-23T04:45:47.330-0700 I - [initandlisten] Detected data files in C:\data\db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-10-23T04:45:47.330-0700 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7379M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-10-23T04:45:47.569-0700 I STORAGE [initandlisten] WiredTiger message [1540295147:568779][12508:140717431611728], txn-recover: Main recovery loop: starting at 2/4736
2018-10-23T04:45:47.718-0700 I STORAGE [initandlisten] WiredTiger message [1540295147:718169][12508:140717431611728], txn-recover: Recovering log 2 through 3
2018-10-23T04:45:47.815-0700 I STORAGE [initandlisten] WiredTiger message [1540295147:815426][12508:140717431611728], txn-recover: Recovering log 3 through 3
2018-10-23T04:45:48.053-0700 I STORAGE [initandlisten] WiredTiger message [1540295148:53068][12508:140717431611728], txn-recover: Set global recovery timestamp: 0
2018-10-23T04:45:48.137-0700 I CONTROL [initandlisten]
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten] ** Start the server with --bind_ip to specify which IP
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-10-23T04:45:48.138-0700 I CONTROL [initandlisten]
2018-10-23T13:45:48.471+0200 W FTDC [initandlisten] Failed to initialize Performance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with 'Das angegebene Objekt wurde nicht auf dem Computer gefunden.' for counter '\Memory\Available Bytes'
2018-10-23T13:45:48.471+0200 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2018-10-23T13:45:48.473+0200 I NETWORK [initandlisten] waiting for connections on port 27017
2018-10-23T13:45:48.863+0200 I NETWORK [listener] connection accepted from 127.0.0.1:57924 #1 (1 connection now open)
2018-10-23T13:45:48.864+0200 I NETWORK [conn1] received client metadata from 127.0.0.1:57924 conn1: { driver: { name: "mongo-java-driver", version: "unknown" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/1.8.0_171-b11" }
2018-10-23T13:45:48.865+0200 I ACCESS [conn1] SCRAM-SHA-1 authentication failed for fritz1338 on admin from client 127.0.0.1:57924 ; UserNotFound: Could not find user fritz1338#admin
2018-10-23T13:45:48.865+0200 I NETWORK [conn1] end connection 127.0.0.1:57924 (0 connections now open)
2018-10-23T13:45:49.366+0200 I NETWORK [listener] connection accepted from 127.0.0.1:57925 #2 (1 connection now open)
2018-10-23T13:45:49.367+0200 I NETWORK [conn2] received client metadata from 127.0.0.1:57925 conn2: { driver: { name: "mongo-java-driver", version: "unknown" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/1.8.0_171-b11" }
2018-10-23T13:45:49.369+0200 I ACCESS [conn2] SCRAM-SHA-1 authentication failed for fritz1338 on admin from client 127.0.0.1:57925 ; UserNotFound: Could not find user fritz1338#admin
2018-10-23T13:45:49.370+0200 I NETWORK [conn2] end connection 127.0.0.1:57925 (0 connections now open)
2018-10-23T13:45:49.872+0200 I NETWORK [listener] connection accepted from 127.0.0.1:57926 #3 (1 connection now open)
2018-10-23T13:45:49.873+0200 I NETWORK [conn3] received client metadata from 127.0.0.1:57926 conn3: { driver: { name: "mongo-java-driver", version: "unknown" }, os: { type: "Windows", name: "Windows 10", architecture: "amd64", version: "10.0" }, platform: "Java/Oracle Corporation/1.8.0_171-b11" }
2018-10-23T13:45:49.875+0200 I ACCESS [conn3] SCRAM-SHA-1 authentication failed for fritz1338 on admin from client 127.0.0.1:57926 ; UserNotFound: Could not find user fritz1338#admin
2018-10-23T13:45:49.877+0200 I NETWORK [conn3] end connection 127.0.0.1:57926 (0 connections now open)
"fritz1338" is an user from my old db instance. If I move the old database directory to data\db everyting works fine again. But I cannot start a clean install from MongoDB.
What I have already tried:
create a brand new data\db directory
redownload MongoDB (ZIP File)
searched the entire PC and registry for references to a mongo configuration file (even though mongo does not use an config file by default)
removed the "mongo-java-driver" in my .m2 maven directory (evetn though it shouldn't been accessed)
run the mongod repair option with
mongod --dbpath=C:\data\db --repair
Can anyone tell me why aclean installation of MongoDB knows about an old username from another data directory?
Problem solved!
The log entries came from another application, which attempted to connect to the database.

Failed to run mongod, windows 10, "T�r: errno:11001 No such host is known."

I am very new, I have looked and looked but haven't found anything that helps. I hope this isn't a super obscure problem.
I am running windows 10 and have installed MongoDB. I am attempting to get mongod to run but right after it starts listening on port 27017 it kicks back:
[HostnameCanonicalizationWorker] Failed to obtain address information for hostname T�r: errno:11001 No such host is known.
And that is where it stops. I have tried many things. I run the console in administrator, I reinstalled MongoDB, I have made sure the port is not being blocked by the firewall. I even gave trying other ports a go.
Everything that I have looked up says that where I am at mongod should now run and be listening on port 27017.
Here it is in full:
C:\>mongod
2016-01-17T02:29:30.059-0700 I CONTROL [initandlisten] MongoDB starting : pid=1668 port=27017 dbpath=C:\data\db\ 64-bit host=T�r
2016-01-17T02:29:30.063-0700 I CONTROL [initandlisten] targetMinOS: Windows Vista/Windows Server 2008
2016-01-17T02:29:30.065-0700 I CONTROL [initandlisten] db version v3.2.1
2016-01-17T02:29:30.067-0700 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-01-17T02:29:30.070-0700 I CONTROL [initandlisten] allocator: tcmalloc
2016-01-17T02:29:30.071-0700 I CONTROL [initandlisten] modules: none
2016-01-17T02:29:30.073-0700 I CONTROL [initandlisten] build environment:
2016-01-17T02:29:30.074-0700 I CONTROL [initandlisten] distarch: x86_64
2016-01-17T02:29:30.076-0700 I CONTROL [initandlisten] target_arch: x86_64
2016-01-17T02:29:30.078-0700 I CONTROL [initandlisten] options: {}
2016-01-17T02:29:30.080-0700 I - [initandlisten] Detected data files in C:\data\db\ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-01-17T02:29:30.086-0700 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,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),
2016-01-17T02:29:31.063-0700 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-01-17T02:29:31.063-0700 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2016-01-17T02:29:31.084-0700 I NETWORK [initandlisten] waiting for connections on port 27017
2016-01-17T02:29:31.897-0700 W NETWORK [HostnameCanonicalizationWorker] Failed to obtain address information for hostname T�r: errno:11001 No such host is known.
2016-01-17T02:29:36.111-0700 I CONTROL [thread1] Ctrl-C signal
2016-01-17T02:29:36.115-0700 I CONTROL [consoleTerminate] got CTRL_C_EVENT, will terminate after current cmd ends
2016-01-17T02:29:36.121-0700 I FTDC [consoleTerminate] Shutting down full-time diagnostic data capture
2016-01-17T02:29:36.137-0700 I CONTROL [consoleTerminate] now exiting
2016-01-17T02:29:36.141-0700 I NETWORK [consoleTerminate] shutdown: going to close listening sockets...
2016-01-17T02:29:36.148-0700 I NETWORK [consoleTerminate] closing listening socket: 544
2016-01-17T02:29:36.152-0700 I NETWORK [consoleTerminate] shutdown: going to flush diaglog...
2016-01-17T02:29:36.159-0700 I NETWORK [consoleTerminate] shutdown: going to close sockets...
2016-01-17T02:29:36.168-0700 I STORAGE [consoleTerminate] WiredTigerKVEngine shutting down
2016-01-17T02:29:36.864-0700 I STORAGE [consoleTerminate] shutdown: removing fs lock...
2016-01-17T02:29:36.868-0700 I CONTROL [consoleTerminate] dbexit: rc: 12
As pointed out by Maximiliano Rios I used a non-latin character in my computers network name and mongod couldn’t handle it. So by changing the name from Týr to Tyr allowed mongod to run.
Under Control Panel\All Control Panel Items\System I changed the Computer Name.
Absolutely weird but we found it out talking together. Seems that mongod tries to reverse lookup always the machine name and it has issues with non-standard characters (in this case is a non-latin character ö but I'm not sure what's the set mongo uses)
Changing the name of the machine works.
I would also try to set an alias in the hosts file.

mongodb can't start with Invariant failure false

I use mongodb. After stop mongod I can not start with error show in log below
log:
...
2015-11-18T16:42:01.017+0800 I JOURNAL [journal writer] Journal writer thread started
2015-11-18T16:42:01.128+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2015-11-18T16:42:01.146+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:45738 #1 (1 connection now open)
2015-11-18T16:42:01.151+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:45741 #2 (2 connections now open)
2015-11-18T16:42:01.160+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:45743 #3 (3 connections now open)
2015-11-18T16:42:01.165+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:45745 #4 (4 connections now open)
2015-11-18T16:42:01.166+0800 I INDEX [conn1] btree bucket corrupt? consider reindexing or running validate command
2015-11-18T16:42:01.166+0800 I INDEX [conn1] klast: { : new Date(1447832163431) }
2015-11-18T16:42:01.166+0800 I INDEX [conn1] key: { : new Date(1447832226553) }
2015-11-18T16:42:01.166+0800 I - [conn1] Invariant failure false src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp 399
2015-11-18T16:42:01.234+0800 I CONTROL [conn1]
0xf75549 0xf12271 0xef6022 0xd0fce7 0xd11d08 0xd12307 0xd12622 0xd126b7 0xd126b7 0xd126b7 0xd12bb9 0xd04c2f 0xa835eb 0x916ebe 0x917235 0x904cf0 0x9050ed 0x9a6d63 0x9a7abd 0x9a998e 0x9aa0cb 0x9acb5d 0x9cf044 0x9cffcd 0x9d0cdb 0xba223a 0xab3ba0 0x7fb86d 0xf268ab 0x7ffc1734ca51 0x7ffc15e9e93d
......
mongod(_ZN5mongo15printStackTraceERSo+0x29) [0xf75549]
mongod(_ZN5mongo10logContextEPKc+0xE1) [0xf12271]
mongod(_ZN5mongo15invariantFailedEPKcS1_j+0xB2) [0xef6022)
mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x34B) [0xf268ab]
libpthread.so.0(+0x7A51) [0x7ffc1734ca51]
libc.so.6(clone+0x6D) [0x7ffc15e9e93d]
----- END BACKTRACE -----
2015-11-18T16:42:01.234+0800 I - [conn1]
***aborting after invariant() failure
I found this line in log:
Invariant failure false src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp 399
2015-11-18T16:42:01.234+0800 I CONTROL [conn1]
How can I start mongod? Or if can't, how can I read data from files like *.ns *.1 *.2?