Mongodb- connection to testing hangs and mongo shell does not start

I am trying to run mongodb (2.2.6 shell) on newly installed windows7 and cygwin OS.

- I downloaded version 2.2.6 from the mongodb website, unzipped it in C: and created a folder C: \ data \ db with write permissions. Now I run cygwin and CD'ed in the bin folder and run. /mongod.exe, everything is going well, and the log says that it is waiting for connections on 27017

$ ./mongod.exe C:\mongodb-win32-x86_64-2008plus-2.2.6\bin\mongod.exe --help for help and startup options Mon Nov 11 16:50:32 [initandlisten] MongoDB starting : pid=3748 port=27017 dbpath=\data\db\ 64-bit host=E7F0921C5EBD33 Mon Nov 11 16:50:32 [initandlisten] db version v2.2.6, pdfile version 4.5 Mon Nov 11 16:50:32 [initandlisten] git version: d626379119a6de9f2fb390780cf2fc336dfd540d Mon Nov 11 16:50:32 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49 Mon Nov 11 16:50:32 [initandlisten] options: {} Mon Nov 11 16:50:32 [initandlisten] journal dir=/data/db/journal Mon Nov 11 16:50:32 [initandlisten] recover begin Mon Nov 11 16:50:32 [initandlisten] info no lsn file in journal/ directory Mon Nov 11 16:50:32 [initandlisten] recover lsn: 0 Mon Nov 11 16:50:32 [initandlisten] recover /data/db/journal/j._0 Mon Nov 11 16:50:32 [initandlisten] recover cleaning up Mon Nov 11 16:50:32 [initandlisten] removeJournalFiles Mon Nov 11 16:50:32 [initandlisten] recover done Mon Nov 11 16:50:32 [initandlisten] waiting for connections on port 27017 Mon Nov 11 16:50:32 [websvr] admin web console waiting for connections on port 28017 

Now I open another cygwin and cd window in the bin folder and run. / mongo to start the monogodb shell. Mongod log shows that he received the request and the connection is open

 Mon Nov 11 16:50:55 [initandlisten] connection accepted from 127.0.0.1:53143 #1 (1 connection now open) 

But the mongodb shell window freezes when connected to the db test and the shell prompt.

 $ ./mongo MongoDB shell version: 2.2.6 connecting to: test 

I checked below and the processes are running, the port is also open.

 $ ps -ef | grep mongo user 860 5556 pty0 10:50:32 /cygdrive/c/mongodb-win32-x86_64-2008 plus-2.2.6/bin/mongod user 6500 5680 pty1 10:50:55 /cygdrive/c/mongodb-win32-x86_64-2008 plus-2.2.6/bin/mongo $ netstat -ano | findstr 27017 TCP 0.0.0.0:27017 0.0.0.0:0 LISTENING 3748 TCP 127.0.0.1:27017 127.0.0.1:53143 ESTABLISHED 3748 TCP 127.0.0.1:53143 127.0.0.1:27017 ESTABLISHED 580 

I also checked http://localhost:28017/ and see that it starts.

 db version v2.2.6, pdfile version 4.5 git hash: d626379119a6de9f2fb390780cf2fc336dfd540d sys info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49 uptime: 2153 seconds 

To fix the problems, I confirmed that write permissions are allowed for the C: \ data \ db folders, the mongod.lock file was deleted and tried restarting with the ability to recover, and it helped, deleted all the mongodb folders, restarted the computer and installed a new copy, but still have the same problem

Any ideas on why this is happening and how to fix it?

+6
source share
1 answer

The MongoDB environment is not known to work in cygwin:

https://jira.mongodb.org/browse/SERVER-4423

Please just run mongod.exe (server) and mongo.exe (shell) as usual without cygwin.

+5
source

Source: https://habr.com/ru/post/957852/


All Articles