CentOS installation Mogodb (online && offline)

Source: Internet
Author: User

The platform of the trend who can block? Take your net and dash it! Http://www.cnblogs.com/dunitian/p/4822808.html

First say recommended installation: Online installation, follow the official walk can avoid some problems

Newly learned MongoDB I still recommend the offline installation

1. Offline Installation: ( two batches, Linux basis and no foundation )

A comrade with a Linux base can look at:

Installation package:

Https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-3.4.1.tgz

installation process

Install the Pstree gadget, and its use

Close MongoDB

Set boot up:

No Linux-based comrades:

First go to the official Download offline installation package: https://www.mongodb.com/

FTP Connect the server, upload the offline package up

Xshell Connect:

Unzip the file (you can press the TAB key if you lose a bit, it will complete automatically):tar-xzf mongo*

Decompression command is not clear can go to the document library to see the basic command http://dnt.dkill.net/dnt

Switch to root user, copy folder to/usr/local directory (general software is installed here), rename folder

Cp-r MongoDB-...../usr/local/

MV Mongodb..../MongoDB

The command does not understand, see:

Switch to the/usr/local/mongodb directory, create a database directory and a journal file, run Mongod in the background (./represents the current directory )

mkdir DBS

Touch logs

./mongod--dbpath=/usr/local/mongodb/dbs/--logpath/usr/local/mongodb/logs--fork

View process, End process

Pstree-p | grep Mongod

Pkill Mongod

If the prompt does not have the Pstree command, you are also the smallest installation, do not panic, install can

Yum install-y Psmisc (For the ease of application, you can-y, fully automated installation, do not rest assured that they looked at each)

Is it too much trouble to start? can be simplified by = = "

If it is the first time to use VI, first click I, enter the editing mode, after the input is complete, press ESC, enter : Wq Enter. If you find that no matter how do not return, do not fear, strong back : q!

Enter ./mongod-f mongod.conf to start

In general, add the startup item so dry, the inverse of the day playing Kali is also so dry, the last time the SSH can not be started is so dry ~ ~ ~ but ... Do not know why, CentOS so do not, so, skip this step

Switch to this directory first:Cd/lib/systemd/system

Create a service for MongoDB:VI mongodb.service

Enter the following:

[Unit]

Description=mongodb
After=network.target Remote-fs.target Nss-lookup.target

[Service]
Type=forking
execstart=/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongod.conf
Execreload=/bin/kill-s HUP $MAINPID
execstop=/usr/local/mongodb/bin/mongod --shutdown--config /usr/local/mongodb/bin/mongod.conf
Privatetmp=true

[Install]
Wantedby=multi-user.target

Start Service:systemctl start Mongodb.service

Stop service:systemctl stop Mongodb.service

Boot start:systemctl enable Mongodb.service

Not clear can see common Linux documents: http://dnt.dkill.net/dnt/linux/cmd.html

Restart after the discovery ~mongodb has been powered on since the boot!

Now you can delete the beginning of the file ~

2. Online Installation:

Online installation is basically no difficulty, follow the official documents to go:

Package information

Note that the installation only supports 64 systems

Add File

The content is officially given:

Install it, it's incredibly slow.

has been installed, the following is not happy to continue to send, not fun, follow the official documents go again ~

Common errors encountered during novice installation: http://www.cnblogs.com/dunitian/p/6274437.html

Another day. Hey, here are some diagrams to prove that the database is fine.

CentOS installation Mogodb (online && offline)

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.