Install MongoDB 6.5 in CentOS 2.6 By chszs. Blog homepage: http://blog.csdn.net/chszs
Next we will install the latest MongoDB 2.6.0 on CentOS 6.5 x64 system.
The MongoDB v2.4.x software warehouse has two packages:
1) mongo-10gen-server
The package contains the latest mongod and mongos daemon, related configuration and initialization scripts.
2) mongo-10gen
This package contains all the latest MongoDB tools. These tools help you manage your MongoDB system.
However, there are a total of five packages in the MongoDB v2.6.0 software warehouse:
1) mongodb-org
This package is a metadata package. It can automatically install the following four package components.
2) mongodb-org-server
This package contains the mongod daemon and related configuration and initialization scripts.
3) mongodb-org-mongos
This package contains the mongos daemon.
4) mongodb-org-shell
This package contains the mongo shell environment.
5) mongodb-org-tools
This package contains the following MongoDB tools: mongoimport, bsondump, mongodump, mongoexport, program files, mongoimport, mongooplog, mongoperf, mongorestore, mongostat, and mongotop.
Control Script: The mongodb-org package contains various control scripts, including the initialization script/etc/rc. d/init. d/mongod.
Use the/etc/mongod. conf configuration file to configure MongoDB.
MongoDB 2.6.0 does not have mongos control scripts. Mongos processes are only used for sharding scenarios. You can use mongod to initialize the script to drive the mongos control script.
To install the latest 64-bit MongoDB 2.6.0, follow these steps:
1. Create a mongodb. repo File
Create the file mongodb. repo in the/etc/yum. repos. d/directory, which contains the configuration information of the MongoDB repository. The content is as follows:
[mongodb]name=MongoDB Repositorybaseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/gpgcheck=0enabled=1
2. Execute the installation command
$ Sudo yum install mongodb-org
Loaded plugins: securitybase | 3.7 kB 00:00 base/primary_db | 4.4 MB 00:01 extras | 3.4 kB 00:00 extras/primary_db | 19 kB 00:00 mongodb | 951 B 00:00 mongodb/primary | 24 kB 00:16 mongodb 155/155openlogic | 1.3 kB 00:00 openlogic/primary | 273 kB 00:00 openlogic 24/24updates | 3.4 kB 00:00 updates/primary_db | 2.6 MB 00:00 Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package mongodb-org.x86_64 0:2.6.0-1 will be installed--> Processing Dependency: mongodb-org-tools = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64--> Processing Dependency: mongodb-org-shell = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64--> Processing Dependency: mongodb-org-server = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64--> Processing Dependency: mongodb-org-mongos = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64--> Running transaction check---> Package mongodb-org-mongos.x86_64 0:2.6.0-1 will be installed---> Package mongodb-org-server.x86_64 0:2.6.0-1 will be installed---> Package mongodb-org-shell.x86_64 0:2.6.0-1 will be installed---> Package mongodb-org-tools.x86_64 0:2.6.0-1 will be installed--> Finished Dependency ResolutionDependencies Resolved============================================================================================ Package Arch Version Repository Size============================================================================================Installing: mongodb-org x86_64 2.6.0-1 mongodb 4.6 kInstalling for dependencies: mongodb-org-mongos x86_64 2.6.0-1 mongodb 6.8 M mongodb-org-server x86_64 2.6.0-1 mongodb 8.9 M mongodb-org-shell x86_64 2.6.0-1 mongodb 4.2 M mongodb-org-tools x86_64 2.6.0-1 mongodb 88 MTransaction Summary============================================================================================Install 5 Package(s)Total download size: 108 MInstalled size: 274 MIs this ok [y/N]: y……
3. Configure SELinux Firewall
Enable port 27017
4. Start MongoDB
$ Sudo service producer D start
5. Verify MongoDB
You can check the log file/var/log/mongodb/mongod. log to determine whether the mongod process is running normally.
You can also run the following command:
$ Sudo chkconfig mongod on
To stop MongoDB, run:
$ Sudo service producer D stop
To restart MongoDB, run:
$ Sudo service producer D restart