Log_daemon_msg "Restarting $DESC" "$NAME"ġ) log_end_msg 1 # Old process is still running # If the "reload" option is implemented then remove the #log_daemon_msg "Reloading $DESC" "$NAME" # and leave 'force-reload' as an alias for 'restart'. # If do_reload() is not implemented then leave this commented out & log_daemon_msg "Stopping $DESC" "$NAME" & log_daemon_msg "Starting $DESC" "$NAME"Ġ|1) & log_end_msg 0 Ģ) & log_end_msg 1 Start-stop-daemon -stop -signal 1 -quiet -pidfile $PIDFILE -name $NAME # restarting (for example, when it is sent a SIGHUP), # If the daemon can reload its configuration without # Function that sends a SIGHUP to the daemon/service # Many daemons don't delete their pidfiles when they exit. Start-stop-daemon -stop -signal 2 -q -pidfile $PIDFILE -name $NAME Start-stop-daemon -Sbm -p $PIDFILE -exec $DAEMON - $DAEMON_ARGSĮcho -e "Stopping $DESC by sending ctrl+c \n" # Function that starts the daemon/service # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. # Load the VERBOSE setting and other rcS variables #If security matters, please change arg to -auth #Please do not forget to give correct path PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/mongodb # Check the paths and data dir with additional options at startup. # -sysinfo print some diagnostic system information # -oplogSize custom size if creating new replication operation log # -oplog 0=off 1=W 2=R 3=both 7=W+some reads # -nohttpinterface disable http interface # -appsrvpath root directory for the babble app server # -objcheck inspect client data for validity on receipt # -v+ increase verbose level -v = -verbose
# -cpu show cpu+iowait utilization periodically # -dbpath directory for datafiles, default is /data/db/ # -port specify port number, default is 27017 # quicktest just check basic assertions and exit # longmsg send a long test message to the db server # msglots send many test messages, and then wait for answer on the last one # msg send a request to the db server listening on port (or default) # Please check the startup params and replication options # Description: Mongodb start stop daemon sends SIGINT to terminate # Short-Description: Mongodb startup script The file should have the following content: In order for MongoDB to be launched on boot, we’ll need to create an init script.įirst, create the file using the command:
Having done the update, we now install the MongoDB server and its command line tools.Īpt-get install -y -allow-unauthenticated mongodb-org
Having added the new repository, we’ll next need to update the list of packages. Now we’ll actually add the MongoDB repositories to your sources.list file so apt-get can retrieve the package list and install Mongo.Įcho "deb trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt//mongodb-org-3.2.list We’ll fetch the GPG key for their repositories so the packages can be verified on installation.Īpt-key adv -keyserver hkp://:80 -recv EA312927 MongoDB is shipped in package repositories for a variety of distributions and versions. Perform this step regularly on this server to keep it secure and performant.
Not only does this prevent download errors later, but it also applies all available bugfixes and security patches. Begin by updating your packages and package cache. When we’re done, MongoDB will be running and ready to integrate into your app or service.
In this guide we will install MongoDB on an Ubuntu 14.04 server, giving you MongoDB’s reliability along with Ubuntu’s stability and long-term support. Its flexibility and features make MongoDB a database that will grow with you, accommodating your requirements as your application develops.
MongoDB is used by a variety of large companies in mission-critical roles, but is still easy to start with and develop against. It features easy sharding for high availability, a variety of index types ranging from geospatial to full-text, an expressive query language, and a JSON superset for serializing records. MongoDB is a document-oriented, NoSQL database.