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

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.

Related

GoormIDE | Can't run mongod in GoormIDE Container

For context: I am creating a website in html+ejs+mongoose which I had created locally on my pc. Since I want to see the website running on another device besides my local computer, I uploaded the files on GitHub and then cloned it into an online IDE, in this case, GoormIDE, to do that.
As the title above had said, I can't run mongod in a container even though I have enabled mongoDB in the container setup. I created a file which is mongod which runs the code mongod --nojournal so that I will not have journal files in my directory. I kept receiving this error code:
2020-12-27T05:24:49.128+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] MongoDB starting : pid=802 port=27017 dbpath=/data/db 64-bit host=goorm
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] db version v4.0.22
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] git version: 1741806fb46c161a1d42870f6e98f5100d196315
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] modules: none
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] build environment:
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] distmod: ubuntu1804
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] distarch: x86_64
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] 1024 MB of memory available to the process out of 7771 MB total system memory
2020-12-27T05:24:49.135+0000 I CONTROL [initandlisten] options: { storage: { journal: { enabled: false } } }
2020-12-27T05:24:49.135+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating
2020-12-27T05:24:49.136+0000 I REPL [initandlisten] Stepping down the ReplicationCoordinator for shutdown, waitTime: 10000ms
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] Shutting down the global connection pool
2020-12-27T05:24:49.136+0000 I - [initandlisten] Killing all operations for shutdown
2020-12-27T05:24:49.136+0000 I NETWORK [initandlisten] Shutting down the ReplicaSetMonitor
2020-12-27T05:24:49.136+0000 I CONTROL [initandlisten] Shutting down free monitoring
2020-12-27T05:24:49.136+0000 I FTDC [initandlisten] Shutting down full-time data capture
2020-12-27T05:24:49.136+0000 I STORAGE [initandlisten] Shutting down the HealthLog
2020-12-27T05:24:49.136+0000 I - [initandlisten] Dropping the scope cache for shutdown
2020-12-27T05:24:49.136+0000 I CONTROL [initandlisten] now exiting
2020-12-27T05:24:49.136+0000 I CONTROL [initandlisten] shutting down with code:100
Because of this, I can't start the website because it needs mongoDB/mongoose in order to run the server.
It seems that mongod/mongoDB doesn't have a data directory. Any ideas?
I already found the answer guys!
I just need to put -dbpath ./data/db after mongod
With that, I created a directory of data/db where I will store all the data from mongoDB.
so now I edited the file that I created named "mongod" with: mongod --nojournal -dbpath ./data/db and everything works once again. I feel pretty silly not knowing this but I hope I will never make this mistake again.

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.

MongoDB shutting down with code:12

I have saved my data yesterday, but when I tried to open my MongoDB via command Prompt and fire the command mongod its throwing out the following messages
>C:\mongodb\bin>mongod
>2018-07-20T16:21:25.350+0530 I CONTROL [main] Automatically disabling TLS 1.0, >to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
>2018-07-20T16:21:25.842+0530 I CONTROL [initandlisten] MongoDB starting : >pid=13544 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-4H7RM2O
>2018-07-20T16:21:25.842+0530 I CONTROL [initandlisten] targetMinOS: Windows >7/Windows Server 2008 R2
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] db version v4.0.0
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] git version: >3b07af3d4f471ae89e8186d33bbb1d5259597d51
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] allocator: tcmalloc
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] modules: none
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] build environment:
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] distmod: 2008plus->ssl
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] distarch: x86_64
>2018-07-20T16:21:25.843+0530 I CONTROL [initandlisten] target_arch: x86_64
>2018-07-20T16:21:25.844+0530 I CONTROL [initandlisten] options: {}
>2018-07-20T16:21:25.844+0530 I STORAGE [initandlisten] exception in >initAndListen: NonExistentPath: Data directory C:\data\db\ not found., >terminating
>2018-07-20T16:21:25.844+0530 I CONTROL [initandlisten] now exiting
>2018-07-20T16:21:25.844+0530 I CONTROL [initandlisten] shutting down with >code:100
>
**Here is the command Prompt output when I fire mongo command**
<C:\mongodb\bin>mongo
<MongoDB shell version v4.0.0
<connecting to: mongodb://127.0.0.1:27017
<2018-07-20T16:28:01.594+0530 E QUERY [js] Error: couldn't connect to server <127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to <127.0.0.1:27017 :: caused by :: No connection could be made because the target <machine actively refused it. :
<connect#src/mongo/shell/mongo.js:251:13
<#(connect):1:6
<exception: connect failed
**This is my log file which is showing error =shutting down with code:12 **
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten] ** WARNING: Access >control is not enabled for the database.
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten] ** Read and >write access to data and configuration is unrestricted.
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten]
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten] ** WARNING: This server >is bound to localhost.
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten] ** Remote >systems will be unable to connect to this server.
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten] ** Start the >server with --bind_ip <address> to specify which IP
>2018-07-20T15:43:37.425+0530 I CONTROL [initandlisten] ** addresses it >should serve responses from, or with --bind_ip_all to
>2018-07-20T15:43:37.426+0530 I CONTROL [initandlisten] ** bind to all >interfaces. If this behavior is desired, start the
>2018-07-20T15:43:37.426+0530 I CONTROL [initandlisten] ** server with >--bind_ip 127.0.0.1 to disable this warning.
>2018-07-20T15:43:37.426+0530 I CONTROL [initandlisten]
>2018-07-20T15:43:40.388+0530 I FTDC [initandlisten] Initializing full-time >diagnostic data capture with directory 'C:/mongodb/data/db/diagnostic.data'
>2018-07-20T15:43:40.499+0530 I NETWORK [initandlisten] waiting for connections >on port 27017
>2018-07-20T15:45:42.106+0530 I CONTROL [thread1] Ctrl-C signal
>2018-07-20T15:45:42.106+0530 I CONTROL [consoleTerminate] got CTRL_C_EVENT, >will terminate after current cmd ends
>2018-07-20T15:45:42.106+0530 I NETWORK [consoleTerminate] shutdown: going to >close listening sockets...
>2018-07-20T15:45:42.325+0530 I CONTROL [consoleTerminate] Shutting down free >monitoring
>2018-07-20T15:45:42.326+0530 I FTDC [consoleTerminate] Shutting down full->time diagnostic data capture
>2018-07-20T15:45:42.334+0530 I STORAGE [consoleTerminate] WiredTigerKVEngine >shutting down
>2018-07-20T15:45:45.543+0530 I STORAGE [consoleTerminate] shutdown: removing fs >lock...
>2018-07-20T15:45:45.543+0530 I CONTROL [consoleTerminate] now exiting
>2018-07-20T15:45:45.543+0530 I CONTROL [consoleTerminate] shutting down with >code:12
I have ensured that my data path is correct but unable to solve this problem.
Try below:
Mac: Documents/mongodb/bin/mongod --dbpath Documents/data/db/
Window: "C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe" --dbpath d:\test\mongodb\data
You just need to set db path.
You can set storage db path to the config file: Check this
And check this for window installation.
If you're using Linux just give increased permission to the storage file and restart mongodb it will work. Default storage file will be var/lib/mongodb. To give increased permissions use : chmod 777 mongod.

mongod HostnameCanonicalizationWorker error on OS X

I've just installed MOngoDB via homebrew und want to start it via command line mongod.
When I do that, i'll get this message:
2016-03-05T19:23:55.763+0100 I CONTROL [initandlisten] MongoDB starting : pid=52426 port=27017 dbpath=/data/db 64-bit host=Matthias-MBP
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] db version v3.2.3
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] allocator: system
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] modules: none
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] build environment:
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] distarch: x86_64
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] target_arch: x86_64
2016-03-05T19:23:55.764+0100 I CONTROL [initandlisten] options: {}
2016-03-05T19:23:55.765+0100 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-03-05T19:23:55.765+0100 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-03-05T19:23:56.483+0100 I CONTROL [initandlisten]
2016-03-05T19:23:56.483+0100 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2016-03-05T19:23:56.486+0100 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-03-05T19:23:56.486+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-03-05T19:23:56.488+0100 I NETWORK [initandlisten] waiting for connections on port 27017
2016-03-05T19:23:56.513+0100 W NETWORK [HostnameCanonicalizationWorker] Failed to obtain address information for hostname Matthias-MBP: nodename nor servname provided, or not known
The last line doesn't sound correct. What is the problem?
The first line of logs says
MongoDB starting : pid=52426 port=27017 dbpath=/data/db 64-bit host=Matthias-MBP".
Notice that host name is Matthias-MBP, so you can add 127.0.0.1 Matthias-MBP in /etc/hosts file. After Ctrl-C and re-run mongod, the error message will disappear.
$ cd /private/etc
open hosts file in that directory
copy the following code:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
127.0.0.1 Matthias-MBP
255.255.255.255 broadcasthost
::1 localhost

MongoDB WiredTiger configuration

I am trying to install MongoDB on my local machine using the Wired Tiger storage engine and experiencing some issues. I downloaded the binaries and following the guide installed it to C:\MongoDB. This got installed using the default engine MMAPV1 but I want to change this to Wired Tiger. To do this I simply used the following command.
mongod.exe --storageEngine "wiredTiger" --dbpath "c:\mongodb\data\wt"
Should mention I have also installed the hotfix and still get the same issue.
It seems this command works as it creates a bunch of files in the specified folder above such as WiredTiger, storage.bson, WiredTiger.turtle etc.
PS C:\MongoDB\bin> .\mongod.exe --storageEngine "wiredTiger"
2015-09-02T15:07:41.266+0100 I CONTROL Hotfix KB2731284 or later update is not installed, will zero-out data files
2015-09-02T15:07:41.270+0100 E NETWORK [initandlisten] listen(): bind() failed errno:10048 Only one usage of each socke
t address (protocol/network address/port) is normally permitted. for socket: 0.0.0.0:27017
2015-09-02T15:07:41.271+0100 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory C:\data\db\ not fo
und., terminating
2015-09-02T15:07:41.271+0100 I CONTROL [initandlisten] dbexit: rc: 100
PS C:\MongoDB\bin> .\mongod.exe --storageEngine "wiredTiger" --dbpath C:\MongoDB\data\wt
2015-09-02T15:10:38.844+0100 I CONTROL Hotfix KB2731284 or later update is not installed, will zero-out data files
2015-09-02T15:10:38.847+0100 E NETWORK [initandlisten] listen(): bind() failed errno:10048 Only one usage of each socke
t address (protocol/network address/port) is normally permitted. for socket: 0.0.0.0:27017
2015-09-02T15:10:38.848+0100 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7G,session_max=20000,e
viction=(threads_max=4),statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(c
lose_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] MongoDB starting : pid=24296 port=27017 dbpath=C:\MongoDB\data\w
t 64-bit host=WSX-111-9999
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] db version v3.0.6
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] git version: 1ef45a23a4c5e3480ac919b28afcba3c615488f2
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, buil
d=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] allocator: tcmalloc
2015-09-02T15:10:39.055+0100 I CONTROL [initandlisten] options: { storage: { dbPath: "C:\MongoDB\data\wt", engine: "wir
edTiger" } }
2015-09-02T15:10:39.057+0100 I CONTROL [initandlisten] now exiting
2015-09-02T15:10:39.057+0100 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2015-09-02T15:10:39.057+0100 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2015-09-02T15:10:39.057+0100 I NETWORK [initandlisten] shutdown: going to close sockets...
2015-09-02T15:10:39.057+0100 I STORAGE [initandlisten] WiredTigerKVEngine shutting down
2015-09-02T15:10:39.074+0100 I STORAGE [initandlisten] shutdown: removing fs lock...
2015-09-02T15:10:39.075+0100 I CONTROL [initandlisten] dbexit: rc: 48
PS C:\MongoDB\bin> .\mongo.exe
2015-09-02T15:11:03.091+0100 I CONTROL Hotfix KB2731284 or later update is not installed, will zero-out data files
MongoDB shell version: 3.0.6
connecting to: test
> db.serverStatus().storageEngine
{ "name" : "mmapv1" }
> exit
bye
PS C:\MongoDB\bin>
Any ideas why this isn't playing ball? I have installed this as a windows service which starts fine and also when using the shell and use the command
db.serverStatus().storageEngine
I get the value mmappv1 back.
Personally, for me to get this working I had to remove the service via the command: .\mongod.exe --remove followed by an install however this time specifying the storage engine etc. So the command becomes
.\mongod.exe --dbpath c:\mongodb\data\wt --logpath c:\mongodb\log\mongo.log --storageEngine wiredTiger --install
Enter the shell and use the command db.serverStatus().storageEngine the world suddenly becomes a happier place { "name" : "wiredTiger" }