Linuxインストール
概要
Linuxでのmongodbのインストール方法
環境
VMPlayer
CentOS6.4
リポジトリファイルを作成
「vim /etc/yum.repos.d/10gen.repo」でファイルを新規作成する
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
「yum update」でリポジトリを更新
[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
10gen | 951 B 00:00
10gen/primary | 11 kB 00:00
10gen 96/96
Setting up Update Process
No Packages marked for Update
[root@localhost ~]#
「yum install mongo-10gen mongo-10gen-server」を実行してインストールを行う
[root@localhost ~]# yum install mongo-10gen mongo-10gen-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mongo-10gen.x86_64 0:2.4.5-mongodb_1 will be installed
---> Package mongo-10gen-server.x86_64 0:2.4.5-mongodb_1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================
Package Arch Version Repository Size
=================================================================================================================
Installing:
mongo-10gen x86_64 2.4.5-mongodb_1 10gen 72 M
mongo-10gen-server x86_64 2.4.5-mongodb_1 10gen 12 M
Transaction Summary
=================================================================================================================
Install 2 Package(s)
Total download size: 84 M
Installed size: 214 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): mongo-10gen-2.4.5-mongodb_1.x86_64.rpm | 72 MB 06:12
(2/2): mongo-10gen-server-2.4.5-mongodb_1.x86_64.rpm | 12 MB 00:05
-----------------------------------------------------------------------------------------------------------------
Total 226 kB/s | 84 MB 06:19
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mongo-10gen-2.4.5-mongodb_1.x86_64 1/2
Installing : mongo-10gen-server-2.4.5-mongodb_1.x86_64 2/2
Verifying : mongo-10gen-2.4.5-mongodb_1.x86_64 1/2
Verifying : mongo-10gen-server-2.4.5-mongodb_1.x86_64 2/2
Installed:
mongo-10gen.x86_64 0:2.4.5-mongodb_1 mongo-10gen-server.x86_64 0:2.4.5-mongodb_1
Complete!
[root@localhost ~]#
サービスの起動を行う
「service mongod start」を起動する
[root@localhost ~]# service mongod start
Starting mongod: about to fork child process, waiting until server is ready for connections.
forked process: 2387
all output going to: /var/log/mongo/mongod.log
child process started successfully, parent exiting
[ OK ]
[root@localhost ~]#
「chkconfig mongod on」で自動起動を設定
[root@localhost ~]# chkconfig mongod on
[root@localhost ~]# chkconfig --list mongod
mongod 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]#
最終更新:2013年09月17日 02:09