Red Hat installs MongoDB

Source: Internet
Author: User
Tags mongodb

Find a more convenient installation method, download the compressed package directly, unzip the directory into the/usr/local directory, and then add the Mongodb/bin to the path. This makes it possible to use the following:

Reference: http://www.runoob.com/mongodb/mongodb-linux-install.html

Download the installation package and unzip the tgz (the installation on 64-bit Linux is shown below).
curl-o https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz    # download
tar-zxvf Mongodb-linux-x86_64-3.0.6.tgz                                   # Unzip

mv  mongodb-linux-x86_64-3.0.6//usr/local/mongodb                         # The executable file that copies the unpacking package to the specified directory MongoDB is located in the

Bin directory, so it can be added to the path path:
export path=<mongodb-install-directory>/bin:$ Path
< mongodb-install-directory > for your MongoDB installation paths. As the/usr/local/mongodb of this article 

Just started to follow the steps on the official website (https://docs.mongodb.org/master/tutorial/install-mongodb-on-red-hat/) to install, but always can not access, prompting the HTTP connection timeout, Probably by the wall, because ping this domain name also does not pass. Later intends to start the installation from the source code, from GitHub after the download of the source code and the Python version of the dependency between the problem is not good solution, the server version of the software is too old, helpless found on the official website before the earlier version, such as 2.6, simply try it
Create a new/etc/yum.repos.d/mongodb-org-2.6.repo and write the following:

[mongodb-org-2.6]
NAME=MONGODB 2.6 Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck= 0
Enabled=1

Because

To install a specific release of MongoDB, specify each component package individually and append the version number to the Package name, as in the following example

So in http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/RPMS/found 2.6 of files, such as Mongodb-org-2.6.0-1, execute

Yum Install-y mongodb-org-2.6.0-1

The system will be all kinds of dependency to install

    Setting up Install Process resolving Dependencies-Running transaction Check---> Package mongodb-org.x86_64 0:2.6.0-1 set to be updated--processing dependency:mongodb-org-tools = 2.6.0 for package:mongodb-org--proces Sing Dependency:mongodb-org-shell = 2.6.0 for package:mongodb-org-to processing dependency:mongodb-org-server = 2.6 .0 for package:mongodb-org-processing Dependency:mongodb-org-mongos = 2.6.0 for package:mongodb-org-Runni NG Transaction Check---> Package mongodb-org-mongos.x86_64 0:2.6.0-1 set to being updated---> Package mongodb-org-ser Ver.x86_64 0:2.6.0-1 set to is updated---> Package mongodb-org-shell.x86_64 0:2.6.0-1 set to be updated---> packag E mongodb-org-tools.x86_64 0:2.6.0-1 set to be updated-finished Dependency Resolution Dependencies resolved ===== =============================================================================================================== ========================= Package                                Arch Version Repository Size =========================================================================================================== ================================== installing:mongodb-org x86_64 2.6.0-                      1 mongodb-org-2.6 4.6 k installing for Dependencies:mongodb-org-mongos x86_64 2.6.0-1 mongodb-org-2.6 6.8 M MongoDB                      -org-server x86_64 2.6.0-1 mongodb-org-2.6 8.9 M Mongodb-org-shell x86_64 2.6.0-1 mongodb-org-2                      .6 4.2 M Mongodb-org-tools x86_64 2.6.0-1        mongodb-org-2.6               M Transaction Summary ================================================================================= ============================================================ Install 5 Package (s) Upgrade 0 package (s) total                                                                                 Download size:108 M downloading Packages: (1/5): mongodb-org-2.6.0-1.x86_64.rpm |                                                                           4.6 KB 00:00 (2/5): mongodb-org-shell-2.6.0-1.x86_64.rpm |                                                                          4.2 MB 00:06 (3/5): mongodb-org-mongos-2.6.0-1.x86_64.rpm |                                                                          6.8 MB 00:06 (4/5): mongodb-org-server-2.6.0-1.x86_64.rpm |                                                                           8.9 MB 00:08 (5/5): mongodb-org-tools-2.6.0-1.x86_64.rpm  | 00:57 MB------------------------------------------------------------------------------------------------------------------                                                                                                        ---------------------------Total 1.3 Mb/s | 108 MB 01:21 Running rpm_check_debug Running Transaction test finished Transaction test Transaction test Succeede                                                                                                    D Running Transaction Installing:mongodb-org-server                                                                                                     1/5 Installing:mongodb-org-shell                                                                                                    2/5 Installing:mongodb-org-mongos                                                                                                     3/5 Installing:mongodb-org-tools 4/5 installing:m Ongodb-orG 5/5 Installed

Products updated.                                                                                                               

Installed:mongodb-org.x86_64 0:2.6.0-1 Dependency installed:mongodb-org-mongos.x86_64 0:2.6.0-1 mongodb-org-server.            

x86_64 0:2.6.0-1 mongodb-org-shell.x86_64 0:2.6.0-1 mongodb-org-tools.x86_64 0:2.6.0-1
 complete!

If you encounter a problem with insufficient space after startup, you can refer to this (http://stackoverflow.com/questions/14584393/ WHY-GETTING-ERROR-MONGOD-DEAD-BUT-SUBSYS-LOCKED-AND-INSUFFICIENT-FREE-SPACE-FOR)

I prompted Source:command not found when executing service Mongod start, and had to execute/etc/init.d/mongod start or/sbin/service mongod start to launch MONGO D.

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.