CentOS under Installation MongoDB

Source: Internet
Author: User
Tags install mongodb stop script

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:

            # Unpacking the installation package            # Create a MongoDB folder            # go to install package directory            # Copy the contents of the installation package to/usr/local/mongodb

2, create a folder to store MongoDB data and log file logs, the command is as follows:

            cd/usr/local/mongodb            mkdir data            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             '  MongoDB started! '             # if it is a 32-bit system, the boot 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            /usr/local/mongodb/bin/mongod  -- Shutdown--dbpath/usr/local/mongodb/data/            'mongodb stoped'

Save and then assign the two scripts to the permissions that can be executed

            chmod +x start_mongodb.sh stop_mongodb.sh

4, MongoDB installation is complete, now execute startup script start MongoDB

            SH start_mongodb.sh# will output MongoDB started! after successful execution

Then look at the process and whether there is a MongoDB process

            Ps-ef|grep MongoDB

You can see that there's a mongodb process, and it's started successfully.

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:

Use Mongovue, found error, error message is as follows: System.ArgumentException: The Font "Courier New" does not support the style "Regular". Indicates that the native fonts are not installed enough: The full courier New font needs to be installed, after Baidu is downloaded, and the. ttf files are copied to C:\Windows\Fonts, Windows installs automatically. At this point, then open Mongovue can be used normally.

  

CentOS under Installation MongoDB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.