Print
카테고리: [ Amazon Web Services ]
조회수: 3438

아마존 리눅스 상에서 mongodb를 설치하려고 하니 아래와 같이 설치가 안됩니다.

$ sudo yum install mongodb-org
Loaded plugins: priorities, update-motd, upgrade-helper
No package mongodb-org available.
Error: Nothing to do

 

이때는 repo 파일을 만들어줍니다.

파일명은 /etc/yum.repos.d/mongodb-org-3.4.repo 이고 내용은 다음과 같습니다.

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

 

이제 yum으로 설치가 잘 됩니다.

$ sudo yum install mongodb-org
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main                                                                                                                      | 2.1 kB  00:00:00
amzn-updates                                                                                                                   | 2.3 kB  00:00:00
mongodb-org-3.4                                                                                                                | 2.5 kB  00:00:00
mongodb-org-3.4/primary_db                                                                                                     |  44 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:3.4.7-1.amzn1 will be installed
--> Processing Dependency: mongodb-org-tools = 3.4.7 for package: mongodb-org-3.4.7-1.amzn1.x86_64
--> Processing Dependency: mongodb-org-shell = 3.4.7 for package: mongodb-org-3.4.7-1.amzn1.x86_64
--> Processing Dependency: mongodb-org-server = 3.4.7 for package: mongodb-org-3.4.7-1.amzn1.x86_64
--> Processing Dependency: mongodb-org-mongos = 3.4.7 for package: mongodb-org-3.4.7-1.amzn1.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:3.4.7-1.amzn1 will be installed
---> Package mongodb-org-server.x86_64 0:3.4.7-1.amzn1 will be installed
---> Package mongodb-org-shell.x86_64 0:3.4.7-1.amzn1 will be installed
---> Package mongodb-org-tools.x86_64 0:3.4.7-1.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                                 Arch                        Version                               Repository                            Size
======================================================================================================================================================
Installing:
 mongodb-org                             x86_64                      3.4.7-1.amzn1                         mongodb-org-3.4                      5.8 k
Installing for dependencies:
 mongodb-org-mongos                      x86_64                      3.4.7-1.amzn1                         mongodb-org-3.4                       11 M
 mongodb-org-server                      x86_64                      3.4.7-1.amzn1                         mongodb-org-3.4                       18 M
 mongodb-org-shell                       x86_64                      3.4.7-1.amzn1                         mongodb-org-3.4                       10 M
 mongodb-org-tools                       x86_64                      3.4.7-1.amzn1                         mongodb-org-3.4                       38 M

Transaction Summary
======================================================================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 78 M
Installed size: 199 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/latest/mongodb-org-3.4/packages/mongodb-org-3.4.7-1.amzn1.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID a15703c6: NOKEY
Public key for mongodb-org-3.4.7-1.amzn1.x86_64.rpm is not installed
(1/5): mongodb-org-3.4.7-1.amzn1.x86_64.rpm                                                                                    | 5.8 kB  00:00:00
(2/5): mongodb-org-mongos-3.4.7-1.amzn1.x86_64.rpm                                                                             |  11 MB  00:00:00
(3/5): mongodb-org-server-3.4.7-1.amzn1.x86_64.rpm                                                                             |  18 MB  00:00:01
(4/5): mongodb-org-shell-3.4.7-1.amzn1.x86_64.rpm                                                                              |  10 MB  00:00:01
(5/5): mongodb-org-tools-3.4.7-1.amzn1.x86_64.rpm                                                                              |  38 MB  00:00:02
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                  20 MB/s |  78 MB  00:00:03
Retrieving key from https://www.mongodb.org/static/pgp/server-3.4.asc
Importing GPG key 0xA15703C6:
 Userid     : "MongoDB 3.4 Release Signing Key <이 이메일 주소가 스팸봇으로부터 보호됩니다. 확인하려면 자바스크립트 활성화가 필요합니다.>"
 Fingerprint: 0c49 f373 0359 a145 1858 5931 bc71 1f9b a157 03c6
 From       : https://www.mongodb.org/static/pgp/server-3.4.asc
Is this ok [y/N]:

 

위 방식을 통해 서비스 방식으로 설치되었으니 service mongod start, service mongod stop으로 기동/종료합니다.