Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing MEVN Chapter 1


  1. To stop the mongod process:


$ sudo service mongod stop


  1. To restart the mongod process:


$ sudo service mongod restart

Installing MongoDB using tarball


  1. Download the binary file from https:/​/​www.mongodb.​ com/​ ​download-​center?​_
    ga=​2.​230171226.​752000573.​1511359743-​2029118384.​ 1508567417. Use this
    command:


$ curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-
3.4.10.tgz


  1. Extract the downloaded files:


$ tar -zxvf mongodb-linux-x86_64-3.4.10.tgz


  1. Copy and extract to the target directory:


$ mkdir -p mongodb
$ cp -R -n mongodb-linux-x86_64-3.4.10/ mongodb


  1. Set the location of the binary in the PATH variable:


$ export PATH=<mongodb-install-directory>/bin:$PATH


  1. Create a directory to be used by Mongo to store all database-related data:


$ mkdir -p /data/db


  1. To start the mongod process:


$ mongod

Installing MongoDB on Windows


Installing MongoDB from the installer is as easy as installing any other software on


Windows. Just like we did for Node.js, we can download the MongoDB installer for


Windows from the official website (https:/​/​www.​mongodb.​com/​download-​center#atlas).


This will download an executable file.

Free download pdf