I am also studying node. js and need to use the mongodb database. Although I have used the mongdb database in the company before, because of work, we have not been able to perform the following operations in the development environment.
I am also studying node. js and need to use the mongodb database. Although I have used the mongdb database in the company before, because of work, we have not been able to perform the following operations in the development environment.
I also learned node. because of js, mongodb databases are needed. Although we have used mongdb databases in the company before, we failed to connect to the internet in the development environment because of work. At that time, we used the tarz package version, non-source code installation version.
Here, we will mainly introduce the source code installation method and refer to the official website documentation ..
Prerequisites: The system is (because the virtual machine is used, only 1.8 GB of memory is allocated to meet basic development requirements .)
MongoDB details: click here
MongoDB: click here
Related reading:
MongoDB backup and recovery
CentOS compilation and installation of MongoDB
CentOS compilation and installation of php extensions for MongoDB and mongoDB
CentOS 6 install MongoDB and server configuration using yum
Install MongoDB2.4.3 in Ubuntu 13.04
How to create a new database and set in MongoDB
MongoDB beginners must read (both concepts and practices)
MongoDB authoritative Guide (The Definitive Guide) in English [PDF]
For details, refer to the official documentation:
Okay. You don't need to talk about it anymore .. Officially started ..
1. Create a mongodb yum Source:
Create a file:/etc/yum. repos. d/mongodb. repo if yum is not configured, refer to the blog about yum configuration in this blog ..
Root User Terminal command:
Vim/etc/yum. repos. d/mongodb. repo
Press I to enter the editing mode, and enter the following content (this is a 64-bit system ):
[Mongodb]
Name = MongoDB Repository
Base url = http://downloads-distro.mongodb.org/repo/RedHat/ OS /x86_64/
Gpgcheck = 0
Enabled = 1
The content of the 32-bit system is:
[Mongodb]
Name = MongoDB Repository
Base url = http://downloads-distro.mongodb.org/repo/redhat/ OS /i686/
Gpgcheck = 0
Enabled = 1
Run the esc key to exit the editing mode and enter wq (write save and close). Now, the yum source has been configured...
2. Install mongoDB using yum
Run the following command on the root user terminal: (install the latest version of mongoDB)
Yum install mongodb-org
If you need to install a version with the following:
Yum install mongodb-org-2.6.1 mongodb-org-server-2.6.1 mongodb-org-shell-2.6.1 mongodb-org-mongos-2.6.1 mongodb-org-tools-2.6.1
2.6.1 indicates the version you want to install.