본문 바로가기

Computer Science/Linux

아마존 리눅스(Amazon Linux)에서 몽고디비(mongoDB)설치 (yum repo 추가)

반응형

 

아마존 리눅스에서 이런 에러가 나타난다면 해당 repo 설정이 필요하다.

If such an error appears on Amazon Linux, the mongodb repo setting is required.

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

 

/etc/yum.repos.d/mongodb-org-5.0.repo 폴더를 새성하여 mongoDB repo정보를 추가

Create a /etc/yum.repos.d/mongodb-org-5.0.repo file so that you can install MongoDB directly using yum:

sudo vi /etc/yum.repos.d/mongodb-org-5.0.repo

 

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

 

최신 몽고디비 설치를 위해서는 다음 명령어를 수행

To install the latest stable version of MongoDB, issue the following command:

sudo yum install -y mongodb-org

 

설치 화면

installation message

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                          | 3.7 kB  00:00:00     
mongodb-org-5.0                                                                                                                     | 2.5 kB  00:00:00     
mongodb-org-5.0/primary_db                                                                                                          |  85 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:5.0.9-1.amzn2 will be installed
--> Processing Dependency: mongodb-org-database for package: mongodb-org-5.0.9-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-tools for package: mongodb-org-5.0.9-1.amzn2.x86_64
--> Processing Dependency: mongodb-mongosh for package: mongodb-org-5.0.9-1.amzn2.x86_64
--> Running transaction check
---> Package mongodb-mongosh.x86_64 0:1.5.0-1.el8 will be installed
---> Package mongodb-org-database.x86_64 0:5.0.9-1.amzn2 will be installed
--> Processing Dependency: mongodb-org-server for package: mongodb-org-database-5.0.9-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-mongos for package: mongodb-org-database-5.0.9-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-shell for package: mongodb-org-database-5.0.9-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-database-tools-extra for package: mongodb-org-database-5.0.9-1.amzn2.x86_64
---> Package mongodb-org-tools.x86_64 0:5.0.9-1.amzn2 will be installed
--> Processing Dependency: mongodb-database-tools for package: mongodb-org-tools-5.0.9-1.amzn2.x86_64
--> Running transaction check
---> Package mongodb-database-tools.x86_64 0:100.5.3-1 will be installed
--> Processing Dependency: cyrus-sasl-gssapi for package: mongodb-database-tools-100.5.3-1.x86_64
--> Processing Dependency: cyrus-sasl for package: mongodb-database-tools-100.5.3-1.x86_64
---> Package mongodb-org-database-tools-extra.x86_64 0:5.0.9-1.amzn2 will be installed
---> Package mongodb-org-mongos.x86_64 0:5.0.9-1.amzn2 will be installed
---> Package mongodb-org-server.x86_64 0:5.0.9-1.amzn2 will be installed
---> Package mongodb-org-shell.x86_64 0:5.0.9-1.amzn2 will be installed
--> Running transaction check
---> Package cyrus-sasl.x86_64 0:2.1.26-24.amzn2 will be installed
---> Package cyrus-sasl-gssapi.x86_64 0:2.1.26-24.amzn2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================
 Package                                             Arch                      Version                            Repository                          Size
===========================================================================================================================================================
Installing:
 mongodb-org                                         x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                    6.1 k
Installing for dependencies:
 cyrus-sasl                                          x86_64                    2.1.26-24.amzn2                    amzn2-core                          86 k
 cyrus-sasl-gssapi                                   x86_64                    2.1.26-24.amzn2                    amzn2-core                          42 k
 mongodb-database-tools                              x86_64                    100.5.3-1                          mongodb-org-5.0                     50 M
 mongodb-mongosh                                     x86_64                    1.5.0-1.el8                        mongodb-org-5.0                     41 M
 mongodb-org-database                                x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                    6.2 k
 mongodb-org-database-tools-extra                    x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                     11 k
 mongodb-org-mongos                                  x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                     20 M
 mongodb-org-server                                  x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                     28 M
 mongodb-org-shell                                   x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                     15 M
 mongodb-org-tools                                   x86_64                    5.0.9-1.amzn2                      mongodb-org-5.0                    6.1 k

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

Total download size: 154 M
Installed size: 568 M
Downloading packages:
(1/11): cyrus-sasl-gssapi-2.1.26-24.amzn2.x86_64.rpm                                                                                |  42 kB  00:00:00     
(2/11): cyrus-sasl-2.1.26-24.amzn2.x86_64.rpm                                                                                       |  86 kB  00:00:00     
warning: /var/cache/yum/x86_64/2/mongodb-org-5.0/packages/mongodb-mongosh-1.5.0.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID e2c63c11: NOKEY:00:03 ETA 
Public key for mongodb-mongosh-1.5.0.x86_64.rpm is not installed
(3/11): mongodb-mongosh-1.5.0.x86_64.rpm                                                                                            |  41 MB  00:00:00     
(4/11): mongodb-org-5.0.9-1.amzn2.x86_64.rpm                                                                                        | 6.1 kB  00:00:00     
(5/11): mongodb-org-database-5.0.9-1.amzn2.x86_64.rpm                                                                               | 6.2 kB  00:00:00     
(6/11): mongodb-org-database-tools-extra-5.0.9-1.amzn2.x86_64.rpm                                                                   |  11 kB  00:00:00     
(7/11): mongodb-database-tools-100.5.3.x86_64.rpm                                                                                   |  50 MB  00:00:03     
(8/11): mongodb-org-mongos-5.0.9-1.amzn2.x86_64.rpm                                                                                 |  20 MB  00:00:02     
(9/11): mongodb-org-shell-5.0.9-1.amzn2.x86_64.rpm                                                                                  |  15 MB  00:00:02     
(10/11): mongodb-org-server-5.0.9-1.amzn2.x86_64.rpm                                                                                |  28 MB  00:00:03     
(11/11): mongodb-org-tools-5.0.9-1.amzn2.x86_64.rpm                                                                                 | 6.1 kB  00:00:00     
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                       20 MB/s | 154 MB  00:00:07     
Retrieving key from https://www.mongodb.org/static/pgp/server-5.0.asc
Importing GPG key 0xE2C63C11:
 Userid     : "MongoDB 5.0 Release Signing Key <packaging@mongodb.com>"
 Fingerprint: f567 9a22 2c64 7c87 527c 2f8c b00a 0bd1 e2c6 3c11
 From       : https://www.mongodb.org/static/pgp/server-5.0.asc
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mongodb-org-database-tools-extra-5.0.9-1.amzn2.x86_64                                                                                  1/11 
  Installing : mongodb-mongosh-1.5.0-1.el8.x86_64                                                                                                     2/11 
  Installing : mongodb-org-shell-5.0.9-1.amzn2.x86_64                                                                                                 3/11 
  Installing : cyrus-sasl-2.1.26-24.amzn2.x86_64                                                                                                      4/11 
  Installing : mongodb-org-mongos-5.0.9-1.amzn2.x86_64                                                                                                5/11 
  Installing : cyrus-sasl-gssapi-2.1.26-24.amzn2.x86_64                                                                                               6/11 
  Installing : mongodb-database-tools-100.5.3-1.x86_64                                                                                                7/11 
  Installing : mongodb-org-tools-5.0.9-1.amzn2.x86_64                                                                                                 8/11 
  Installing : mongodb-org-server-5.0.9-1.amzn2.x86_64                                                                                                9/11 
Created symlink from /etc/systemd/system/multi-user.target.wants/mongod.service to /usr/lib/systemd/system/mongod.service.
  Installing : mongodb-org-database-5.0.9-1.amzn2.x86_64                                                                                             10/11 
  Installing : mongodb-org-5.0.9-1.amzn2.x86_64                                                                                                      11/11 
  Verifying  : mongodb-database-tools-100.5.3-1.x86_64                                                                                                1/11 
  Verifying  : mongodb-org-server-5.0.9-1.amzn2.x86_64                                                                                                2/11 
  Verifying  : cyrus-sasl-gssapi-2.1.26-24.amzn2.x86_64                                                                                               3/11 
  Verifying  : mongodb-org-5.0.9-1.amzn2.x86_64                                                                                                       4/11 
  Verifying  : mongodb-org-database-5.0.9-1.amzn2.x86_64                                                                                              5/11 
  Verifying  : mongodb-org-database-tools-extra-5.0.9-1.amzn2.x86_64                                                                                  6/11 
  Verifying  : mongodb-org-mongos-5.0.9-1.amzn2.x86_64                                                                                                7/11 
  Verifying  : cyrus-sasl-2.1.26-24.amzn2.x86_64                                                                                                      8/11 
  Verifying  : mongodb-org-tools-5.0.9-1.amzn2.x86_64                                                                                                 9/11 
  Verifying  : mongodb-org-shell-5.0.9-1.amzn2.x86_64                                                                                                10/11 
  Verifying  : mongodb-mongosh-1.5.0-1.el8.x86_64                                                                                                    11/11 

Installed:
  mongodb-org.x86_64 0:5.0.9-1.amzn2                                                                                                                       

Dependency Installed:
  cyrus-sasl.x86_64 0:2.1.26-24.amzn2           cyrus-sasl-gssapi.x86_64 0:2.1.26-24.amzn2      mongodb-database-tools.x86_64 0:100.5.3-1                  
  mongodb-mongosh.x86_64 0:1.5.0-1.el8          mongodb-org-database.x86_64 0:5.0.9-1.amzn2     mongodb-org-database-tools-extra.x86_64 0:5.0.9-1.amzn2    
  mongodb-org-mongos.x86_64 0:5.0.9-1.amzn2     mongodb-org-server.x86_64 0:5.0.9-1.amzn2       mongodb-org-shell.x86_64 0:5.0.9-1.amzn2                   
  mongodb-org-tools.x86_64 0:5.0.9-1.amzn2     

Complete!

 

 

설치가 잘 되었는지 확인.

To check that the installation was successful.

mongo -version
MongoDB shell version v5.0.9
Build Info: {
    "version": "5.0.9",
    "gitVersion": "6f7dae919422dcd7f4892c10ff20cdc721ad00e6",
    "openSSLVersion": "OpenSSL 1.0.2k-fips  26 Jan 2017",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "amazon2",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}
반응형