(The executed commands are marked in green and the standby commands are marked in blue). Mongodb is a popular non-relational database recently.
The following describes how to install linux on a virtual machine.
Installation environment:
Virtual Machine: Oracle VM virtualbox 4.0.6
Linux: CentOS 5.6
1. Download mongodb
URL: http://www.mongodb.org/
Select the desired version
Use SSH Secure File Transfer Client to upload the File to linux (you need to ensure that the virtual machine linux System and the host system can ping each other to use the File. If the ping is not successful, you need to set the linux network settings ), here we put the mongodb-linux-x86_64-2.2.2.tgz under the linux root directory/
Enter the linux text terminal (ctrl + shift + f1 on the logon Interface ):
Enter the root directory/
Listing the files in the root directory shows that the mongodb-linux-x86_64-2.2.2.tgz is already in the directory.
Decompress
Tar zxf mongodb-linux-x86_64-2.2.2.tgz
Listing the documents under the root directory shows that the mongodb-linux-x86_64-2.2.2 directory has appeared
Before starting, we need to create a place for the database to store files. We can directly create the default data directory/data/db under the root directory (if this directory is not available, the startup will fail) (if it is created in another directory, make sure that the current account has the write permission on the data directory)
Mkdir-p/data/db
Ps1: You can use chown-R Account name: group name/data/db for directory write permission. Because the root account I use already has permission, I will not execute this command here.