"Go" couldn't connect to server 127.0.0.1: 27017 at src/mongo/shell/mongo. js: 145, "go" 27017
Couldn't connect to server 127.0.0.1: 27017 at src/mongo/shell/mongo. js: 145. For more information, see.
It should be because the installation was not timely yesterday, and the language expression was a little poor, understanding
Mongodb was installed yesterday for no reason.
Couldn't connect to server 127.0.0.1: 27017 at src/mongo/shell/mongo. js: 145
This is an error. After google went down, it was basically said that it was not properly closed. The product had a locks file named mongod. lock, found the file, and deleted it.
Start in./mongod -- dbpath =/usr/local/mongodb/data/-- logpath =/usr/local/mongodb/db. logs -- repair mode,
I tried it several times and the result failed. The error still persists.
I saw some articles about permission issues. I used ll to check the permissions. I found that all the permissions under/usr/local/mongodb/bin/are mysql.
Then chown-R root: root/usr/local/mongodb/bin/
Delete mongod. lock. Restart, failed again,
Continue Baidu and find that there may be port problems. Modify the port to start again or fail
Finally, we found the following problems.
ERROR: Insufficient free space for journal files
The disk is too small. I used df-h to check the disk of the server and found that 92% was used.
Use./mongod -- dbpath =/usr/local/mongodb/data/-- logpath =/usr/local/mongodb/db. logs -- smallfiles
Start again. No error is reported. You can use the./mongo command to find it.
Then edit vi/etc/rc. d/rc. local file to add
./Usr/local/mongodb/bin/mongod -- dbpath =/usr/local/mongodb/data/-- logpath =/usr/local/mongodb/db. logs -- fork -- smallfiles
Enable mongodb to start automatically
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.