Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save huanglong-zz/8026004 to your computer and use it in GitHub Desktop.
Save huanglong-zz/8026004 to your computer and use it in GitHub Desktop.
# Sometimes, you just have to shutdown and reboot your linode. Then all the services running on your linode should be booted again:
1. Shundown/reboot linode
2. Stop the httpd service by default: service httpd stop
3. Repair your mongodb for some reasons:
a. Find out and kill all the process:
ps -ef | grep mongo*
ps -ef | grep mongod
kill -9 pid
#If it doesn't work, then you can pkill -9 mongod once for all.
b. Remove the lock file:
rm -rf /var/lib/mongo/mongod.lock
c. Boot with repair mode:
mongod -f /etc/mongod.conf --repair
d. Boot again without repair mode(important)
mongod -f /etc/mongod.conf
e. Check if it works:
ps -ef | grep mongo*
ps -ef | grep mongod
mongo
4. Configure your nginx and start it(could do this later)
nginx -c /etc/nginx/nginx.conf
5. Boot your node app
NODE_ENV=production kirua stop
NODE_ENV=production kirua start
6. Restart your nginx:
nginx -s reload
Everything is fine!
Some errors below:
# service mongod start
Starting mongod: Wed Dec 18 07:46:33.384
Wed Dec 18 07:46:33.384 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed Dec 18 07:46:33.384
about to fork child process, waiting until server is ready for connections.
forked process: 2364
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 100
[FAILED]
service mongod start
Starting mongod: Wed Dec 18 07:47:38.363
Wed Dec 18 07:47:38.363 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed Dec 18 07:47:38.363
about to fork child process, waiting until server is ready for connections.
forked process: 2395
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 45
mongod -f /etc/mongod.conf --repair
Wed Dec 18 07:49:17.317
Wed Dec 18 07:49:17.317 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed Dec 18 07:49:17.317
about to fork child process, waiting until server is ready for connections.
forked process: 2435
all output going to: /var/log/mongo/mongod.log
child process started successfully, parent exiting
[root@li547-11 ~]# service mongod restart
Stopping mongod: [FAILED]
Starting mongod: Wed Dec 18 07:49:39.804
Wed Dec 18 07:49:39.805 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed Dec 18 07:49:39.805
about to fork child process, waiting until server is ready for connections.
forked process: 2463
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 100
[FAILED]
# service mongod restart --journal
Stopping mongod: [FAILED]
Starting mongod: Wed Dec 18 07:50:05.612
Wed Dec 18 07:50:05.612 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed Dec 18 07:50:05.612
about to fork child process, waiting until server is ready for connections.
forked process: 2491
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 100
[FAILED]
# mongo
MongoDB shell version: 2.4.7
connecting to: test
Wed Dec 18 07:50:14.878 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment