search
HomeDatabaseMysql TutorialCentOS 安装MongoDB

本人的实验环境为CentOS 5.5 ,32位系统,CentOS下,我们一般都会通过yum来安装相关软件,二话不说,我们先yum一下:

今天看到了MongoDB,熟悉了一下,便动手开始安装,在安装过程中遇到了一系列的问题,在此分享给大家,一来为自己做一个记录,二来方便大家遇到相同的问题时能够顺利解决。废话少说,直接进入正题吧。

本人的实验环境为CentOS5.5 ,32位系统,CentOS下,我们一般都会通过yum来安装相关软件,二话不说,我们先yum一下:

[root@h3 /]# yum install mongo-10gen-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: centos.ustc.edu.cn
 * base: centos.ustc.edu.cn
 * epel: mirror.neu.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
Setting up Install Process
No package mongo-10gen-server available.
Nothing to do
[root@h3 /]#

出现的错误是:找不到yum源,很简单,我们给它配置一份yum源吧。

我们在/etc/yum.repos.d目录下新建一个yum源文件,,10gen.repo

[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/RedHat/os/x86_64
gpgcheck=0

注意32位的操作系统配置如下:

[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
gpgcheck=0

如果你不知道自己的操作系统是多少位的,使用如下命令:

[root@h3 yum.repos.d]# getconf LONG_BIT
32
[root@h3 yum.repos.d]#

yum的更新原则应该是会将本地的repomod.xml文件的修改日期与yum服务器的更新文件repomd.xml 作比较,然后从其中选择一份最新的文件,所以我们需要运行如下命令清除一下:

[root@h3 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@h3 yum.repos.d]#

接下来,那么,接下来就是见证奇迹的时候了,在这里,我们直接yum  insall  mongo-10gen-server ,在这里稍作赘述,因为mongo分为客户端和服务端,而服务端依赖于客户端,因此我们直接安装 mongo-10gen-server就行了。

[root@h3 yum.repos.d]# yum install mongo-10gen-server
Loaded plugins: fastestmirror
Determining fastest mirrors
 * addons: mirror.esocc.com
 * base: mirror.esocc.com
 * epel: mirrors.hust.edu.cn
 * extras: mirror.esocc.com
 * updates: mirror01.idc.hinet.net
10gen                                                    |  951 B    00:00
10gen/primary                                            |  11 kB    00:00
10gen                                                                    96/96
addons                                                  | 1.9 kB    00:00
addons/primary_db                                        | 1.1 kB    00:00
base                                                    | 1.1 kB    00:00
base/primary                                            | 983 kB    00:00
base                                                                  2770/2770
epel                                                    | 3.6 kB    00:00
epel/primary_db                                          | 3.1 MB    00:02
extras                                                  | 2.1 kB    00:00
extras/primary_db                                        | 167 kB    00:00
updates                                                  | 1.9 kB    00:00
updates/primary_db                                      | 525 kB    00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mongo-10gen-server.i686 0:2.4.5-mongodb_1 set to be updated
--> Processing Dependency: mongo-10gen for package: mongo-10gen-server
--> Running transaction check
---> Package mongo-10gen.i686 0:2.4.5-mongodb_1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to solve the problem of mysql cannot open shared libraryHow to solve the problem of mysql cannot open shared libraryMar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

Reduce the use of MySQL memory in DockerReduce the use of MySQL memory in DockerMar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin)Run MySQl in Linux (with/without podman container with phpmyadmin)Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overviewWhat is SQLite? Comprehensive overviewMar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Running multiple MySQL versions on MacOS: A step-by-step guideRunning multiple MySQL versions on MacOS: A step-by-step guideMar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.