MongoDB is a nosql type of database, high-performance, easy to deploy, easy to use features in the IT industry is very popular.
The following describes the installation of MongoDB, here we are installed under Linux, using the centos6.4 64-bit, you can download the corresponding installation package on the official website, the official site is https://www.mongodb.org/, can also be downloaded on my network disk, 64-bit and 32-bit installation packages are available, as well as a Mongovue, visual MongoDB management tool with a network address of: Http://pan.baidu.com/s/1c0ocQFu. Windows installation can refer to: http://www.cnblogs.com/huangxincheng/archive/2012/02/18/2356595.html 1, first look at their system is 32-bit or 64-bit, Use uname-a can see the number of bits of the operating system, if there are 64 of the typeface is 64 bits, if not 32 bits, and then download the corresponding installation package;
1, upload the installation package to the Linux server, unzip, and then we install MongoDB into the/usr/local/mongodb directory, in/usr/local/create a MongoDB folder, Then copy the contents of the MongoDB installation package just extracted to the/usr/local/mongodb directory, the command is as follows:
Tar xvf Mongodb-linux-x86_64-2.6.7.tar #解压安装包
Mkdir/usr/local/mongodb #创建mongodb文件夹
CD mongodb-linux-x86_64-2.6.7 #进去安装包目录
CP-RF */usr/local/mongodb #把安装包的内容复制到/usr/local/mongodb
2, create a folder to store MongoDB data and log file logs, the command is as follows:
Cd/usr/local/mongodb
Touch logs
3. Start MongoDB, write a startup script and close the script
VI start_mongodb.sh
#!/bin/bash
/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/logs--logappend-- port=27017--fork
Echo ' MongoDB started! ' #如果是32位的系统, when activated will be prompted to add--journal on the boot parameters, plus you can
Then save and write a stop script.
--dbpath means to specify the folder where the data is stored
--logpath means to specify the log storage file
--logappend means that logs are generated in an incremental manner.
--PORT Specifies the port, if not written, the default is 27017
--fork to run on behalf of the background
VI stop_mongodb.sh
#!/bin/bash
' MongoDB stoped '
Save and then assign the two scripts to the permissions that can be executed
chmod +x start_mongodb.sh stop_mongodb.sh
Then look at the process and whether there is a MongoDB process
Ps-ef|grep MongoDB
5, enter the MongoDB command line, you can see the version of MongoDB information and Input MongoDB command.
/usr/local/mongodb/bin/mongo# into the MongoDB command line
6, MongoDB installed successfully, if the command line operation is not convenient, you can download Mongovue visualization tool, Operation MongoDB, installation package in the above network disk link, decompression can be used, after the installation is completed input IP and port connection, the default no account password, The Mongovue interface is as follows:
Installing MongoDB under CentOS