Linux centos6.2 node MONGO configuration boot-up

Source: Internet
Author: User

#!/bin/bash
# # # BEGIN INIT INFO
# Provides:xiyoulib
# Required-start: $all
# Required-stop: $all
# Default-start:2 3 4 5
# default-stop:0 1 6
# Short-description:start daemon at boot time
# Description:enable service provided by Daemon.
# # # END INIT INFO
# chkconfig:345 88 08
# Description:forever for node. js
Deamon=/usr/local/src/node/pwp/server/mongo/getdata.js
Log=/usr/local/src/node/pwp/server/logs/forever.log
Pid=/usr/local/src/node/pid
Export path= $PATH:/usr/local/bin
Export Node_path= $NODE _path:/usr/local/lib/node_modules
Node=node
Forever=forever
Case "$" in
Start
$forever start-l $LOG--pidfile $PID-a $DEAMON
;;
Stop
$forever Stop--pidfile $PID $DEAMON
;;
StopAll)
$forever StopAll--pidfile $PID
;;
Restartall)
$forever Restartall--pidfile $PID
;;
Reload|restart)
$forever restart-l $LOG--pidfile $PID-a $DEAMON
;;
List
$forever List
;;
*)
echo "Usage:/etc.init.d/node {start|stop|restart|reload|stopall|restartall|list}"
Exit 1
;;
Esac

The above code is node's start-up and error after the start of their own problems

is configured in the/etc/init.d/node file

Because forever is not self-priming under rc.local.

Configure MONGO

echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/db--logpath=/usr/local/mongodb/logs/ Mongodb.log--fork ">>/etc/rc.local

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.