운영중인 시스템에 mariabackup 을 통해서 받은 백업에 대해 복구 테스트를 진행해야 하는 상황

운영중인 시스템은 CentOS 7, MariaDB 10.4.18 로 운영중이어서 최대한 비슷한 환경으로 맞춰서 테스트 진행하기 위해

Virtual Box 에 CentOS 7을 설치하고 덤프 파일을 내려 받음

MariaDB 10.4.X 버전을 설치 하기로 함

0. 도움 받은 글

https://bangu4.tistory.com/128

1. OS 버전 확인

[root@DEVSVR01 download]# rpm --query centos-release
centos-release-7-9.2009.1.el7.centos.x86_64
[root@DEVSVR01 download]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[root@DEVSVR01 download]# cat /etc/system-release
CentOS Linux release 7.9.2009 (Core)
[root@DEVSVR01 download]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@DEVSVR01 download]#

$ rpm --query centos-release 명령이 가장 정확한 버전을 보여줌

2. yum 에 MariaDB Repository 추가

원하는 버전의 Repository 확인

https://downloads.mariadb.org/mariadb/repositories

 

Download MariaDB Server - MariaDB.org

REST API Release Schedule Reporting Bugs … Continue reading "Download MariaDB Server"

mariadb.org

사이트에서 CentOS 7 (x86_64)를 선택하면 MariaDB 버전은 10.4 밖에 나오지 않는다.

다운 받을 미러 사이트 선택 (그나마 일본이 좀 안전하다는 뇌피셜...)

다른 버전이 없는지 사이트 확인

https://mirror.mariadb.org/yum/

10.4.27 버전이 사용하고 있는 10.4.17 보다 약간 상위 버전으로 해당 패키시 설치 하기로 선택함

위 사이트에서 나온 내용에 baseurl 을 https://mirrors.xtom.jp/mariadb/yum/10.4.27/centos7-amd64

로 바꾸고 미러사이트에 존재 하는지 확인 (브라우저로 확인)후 mariadb.repo 생성

[root@DEVSVR01 download]# vi /etc/yum.repos.d/mariadb.repo
# MariaDB 10.4 CentOS repository list - created 2022-12-02 01:12 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirrors.xtom.jp/mariadb/yum/10.4.27/centos7-amd64
gpgkey=https://mirrors.xtom.jp/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
~                                                                                                                                                                                
~                                                                                                                                                                                
~                                                                                                                                                                                
~

 

3. yum 을 이용하여 MariaDB 설치

[root@DEVSVR01 download]# yum install MariaDB-server MariaDB-client
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                      | 7.0 kB  00:00:00     
 * base: mirror.kakao.com
 * epel: mirror-jp.misakamikoto.network
 * extras: mirror.kakao.com
 * updates: mirror.navercorp.com
base                                                                                                                                                      | 3.6 kB  00:00:00     
epel                                                                                                                                                      | 4.7 kB  00:00:00     
extras                                                                                                                                                    | 2.9 kB  00:00:00     
mariadb                                                                                                                                                   | 3.4 kB  00:00:00     
updates                                                                                                                                                   | 2.9 kB  00:00:00     
(1/5): mariadb/updateinfo                                                                                                                                 | 5.9 kB  00:00:00     
(2/5): mariadb/primary_db                                                                                                                                 |  65 kB  00:00:00     
(3/5): epel/x86_64/primary_db                                                                                                                             | 7.0 MB  00:00:01     
(4/5): epel/x86_64/updateinfo                                                                                                                             | 1.0 MB  00:00:01     
(5/5): updates/7/x86_64/primary_db                                                                                                                        |  18 MB  00:00:02     
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.4.27-1.el7.centos will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: MariaDB-client-10.4.27-1.el7.centos.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: MariaDB-client-10.4.27-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-client-10.4.27-1.el7.centos.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: MariaDB-client-10.4.27-1.el7.centos.x86_64
---> Package MariaDB-server.x86_64 0:10.4.27-1.el7.centos will be installed
--> Processing Dependency: perl(DBI) for package: MariaDB-server-10.4.27-1.el7.centos.x86_64
--> Processing Dependency: galera-4 for package: MariaDB-server-10.4.27-1.el7.centos.x86_64
--> Processing Dependency: lsof for package: MariaDB-server-10.4.27-1.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-common.x86_64 0:10.4.27-1.el7.centos will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.4.27-1.el7.centos.x86_64
---> Package galera-4.x86_64 0:26.4.13-1.el7.centos will be installed
--> Processing Dependency: socat for package: galera-4-26.4.13-1.el7.centos.x86_64
--> Processing Dependency: libboost_program_options-mt.so.1.53.0()(64bit) for package: galera-4-26.4.13-1.el7.centos.x86_64
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lsof.x86_64 0:4.87-6.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.4.27-1.el7.centos will be obsoleting
---> Package boost-program-options.x86_64 0:1.53.0-28.el7 will be installed
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
---> Package socat.x86_64 0:1.7.3.2-2.el7 will be installed
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
 Package                                            Arch                              Version                                           Repository                          Size
=================================================================================================================================================================================
Installing:
 MariaDB-client                                     x86_64                            10.4.27-1.el7.centos                              mariadb                             12 M
 MariaDB-compat                                     x86_64                            10.4.27-1.el7.centos                              mariadb                            2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.el7
 MariaDB-server                                     x86_64                            10.4.27-1.el7.centos                              mariadb                             26 M
Installing for dependencies:
 MariaDB-common                                     x86_64                            10.4.27-1.el7.centos                              mariadb                             81 k
 boost-program-options                              x86_64                            1.53.0-28.el7                                     base                               156 k
 galera-4                                           x86_64                            26.4.13-1.el7.centos                              mariadb                             10 M
 libaio                                             x86_64                            0.3.109-13.el7                                    base                                24 k
 lsof                                               x86_64                            4.87-6.el7                                        base                               331 k
 perl-Compress-Raw-Bzip2                            x86_64                            2.061-3.el7                                       base                                32 k
 perl-Compress-Raw-Zlib                             x86_64                            1:2.061-4.el7                                     base                                57 k
 perl-DBI                                           x86_64                            1.627-4.el7                                       base                               802 k
 perl-IO-Compress                                   noarch                            2.061-2.el7                                       base                               260 k
 perl-Net-Daemon                                    noarch                            0.48-5.el7                                        base                                51 k
 perl-PlRPC                                         noarch                            0.2020-14.el7                                     base                                36 k
 socat                                              x86_64                            1.7.3.2-2.el7                                     base                               290 k

Transaction Summary
=================================================================================================================================================================================
Install  3 Packages (+12 Dependent packages)

Total download size: 52 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/mariadb/packages/MariaDB-common-10.4.27-1.el7.centos.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEYB/s |    0 B  --:--:-- ETA 
Public key for MariaDB-common-10.4.27-1.el7.centos.x86_64.rpm is not installed
(1/15): MariaDB-common-10.4.27-1.el7.centos.x86_64.rpm                                                                                                    |  81 kB  00:00:00     
(2/15): MariaDB-compat-10.4.27-1.el7.centos.x86_64.rpm                                                                                                    | 2.2 MB  00:00:00     
(3/15): boost-program-options-1.53.0-28.el7.x86_64.rpm                                                                                                    | 156 kB  00:00:00     
(4/15): MariaDB-server-10.4.27-1.el7.centos.x86_64.rpm                                                                                                    |  26 MB  00:00:02     
(5/15): libaio-0.3.109-13.el7.x86_64.rpm                                                                                                                  |  24 kB  00:00:00     
(6/15): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm                                                                                                     |  57 kB  00:00:00     
(7/15): lsof-4.87-6.el7.x86_64.rpm                                                                                                                        | 331 kB  00:00:00     
(8/15): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm                                                                                                    |  32 kB  00:00:00     
(9/15): perl-IO-Compress-2.061-2.el7.noarch.rpm                                                                                                           | 260 kB  00:00:00     
(10/15): perl-PlRPC-0.2020-14.el7.noarch.rpm                                                                                                              |  36 kB  00:00:00     
(11/15): perl-Net-Daemon-0.48-5.el7.noarch.rpm                                                                                                            |  51 kB  00:00:00     
(12/15): perl-DBI-1.627-4.el7.x86_64.rpm                                                                                                                  | 802 kB  00:00:00     
(13/15): socat-1.7.3.2-2.el7.x86_64.rpm                                                                                                                   | 290 kB  00:00:00     
(14/15): galera-4-26.4.13-1.el7.centos.x86_64.rpm                                                                                                         |  10 MB  00:00:01     
(15/15): MariaDB-client-10.4.27-1.el7.centos.x86_64.rpm                                                                                                   |  12 MB  00:00:05     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                            8.9 MB/s |  52 MB  00:00:05     
Retrieving key from https://mirrors.xtom.jp/mariadb/yum/RPM-GPG-KEY-MariaDB
Importing GPG key 0x1BB943DB:
 Userid     : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"
 Fingerprint: 1993 69e5 404b d5fc 7d2f e43b cbcb 082a 1bb9 43db
 From       : https://mirrors.xtom.jp/mariadb/yum/RPM-GPG-KEY-MariaDB
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libaio-0.3.109-13.el7.x86_64                                                                                                                                 1/16 
  Installing : lsof-4.87-6.el7.x86_64                                                                                                                                       2/16 
  Installing : MariaDB-common-10.4.27-1.el7.centos.x86_64                                                                                                                   3/16 
  Installing : MariaDB-compat-10.4.27-1.el7.centos.x86_64                                                                                                                   4/16 
  Installing : MariaDB-client-10.4.27-1.el7.centos.x86_64                                                                                                                   5/16 
  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                                                   6/16 
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                                                  7/16 
  Installing : perl-IO-Compress-2.061-2.el7.noarch                                                                                                                          8/16 
  Installing : boost-program-options-1.53.0-28.el7.x86_64                                                                                                                   9/16 
  Installing : perl-Net-Daemon-0.48-5.el7.noarch                                                                                                                           10/16 
  Installing : perl-PlRPC-0.2020-14.el7.noarch                                                                                                                             11/16 
  Installing : perl-DBI-1.627-4.el7.x86_64                                                                                                                                 12/16 
  Installing : socat-1.7.3.2-2.el7.x86_64                                                                                                                                  13/16 
  Installing : galera-4-26.4.13-1.el7.centos.x86_64                                                                                                                        14/16 
  Installing : MariaDB-server-10.4.27-1.el7.centos.x86_64                                                                                                                  15/16 


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at http://mariadb.com/kb

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

  Erasing    : 1:mariadb-libs-5.5.68-1.el7.x86_64                                                                                                                          16/16 
  Verifying  : galera-4-26.4.13-1.el7.centos.x86_64                                                                                                                         1/16 
  Verifying  : socat-1.7.3.2-2.el7.x86_64                                                                                                                                   2/16 
  Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                                                                                                                            3/16 
  Verifying  : MariaDB-compat-10.4.27-1.el7.centos.x86_64                                                                                                                   4/16 
  Verifying  : MariaDB-client-10.4.27-1.el7.centos.x86_64                                                                                                                   5/16 
  Verifying  : boost-program-options-1.53.0-28.el7.x86_64                                                                                                                   6/16 
  Verifying  : lsof-4.87-6.el7.x86_64                                                                                                                                       7/16 
  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                                                  8/16 
  Verifying  : perl-PlRPC-0.2020-14.el7.noarch                                                                                                                              9/16 
  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                                                  10/16 
  Verifying  : perl-DBI-1.627-4.el7.x86_64                                                                                                                                 11/16 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                                                                                                                12/16 
  Verifying  : MariaDB-server-10.4.27-1.el7.centos.x86_64                                                                                                                  13/16 
  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                                                                                                                         14/16 
  Verifying  : MariaDB-common-10.4.27-1.el7.centos.x86_64                                                                                                                  15/16 
  Verifying  : 1:mariadb-libs-5.5.68-1.el7.x86_64                                                                                                                          16/16 

Installed:
  MariaDB-client.x86_64 0:10.4.27-1.el7.centos              MariaDB-compat.x86_64 0:10.4.27-1.el7.centos              MariaDB-server.x86_64 0:10.4.27-1.el7.centos             

Dependency Installed:
  MariaDB-common.x86_64 0:10.4.27-1.el7.centos   boost-program-options.x86_64 0:1.53.0-28.el7   galera-4.x86_64 0:26.4.13-1.el7.centos        libaio.x86_64 0:0.3.109-13.el7  
  lsof.x86_64 0:4.87-6.el7                       perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7   perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7   perl-DBI.x86_64 0:1.627-4.el7   
  perl-IO-Compress.noarch 0:2.061-2.el7          perl-Net-Daemon.noarch 0:0.48-5.el7            perl-PlRPC.noarch 0:0.2020-14.el7             socat.x86_64 0:1.7.3.2-2.el7    

Replaced:
  mariadb-libs.x86_64 1:5.5.68-1.el7                                                                                                                                             

Complete!
[root@DEVSVR01 download]#

정상 설치 완료

[root@DEVSVR01 download]# systemctl status mariadb
● mariadb.service - MariaDB 10.4.27 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: inactive (dead)
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
[root@DEVSVR01 download]#
[root@DEVSVR01 download]# mariadb --version
mariadb  Ver 15.1 Distrib 10.4.27-MariaDB, for Linux (x86_64) using readline 5.1
[root@DEVSVR01 download]#

 

+ Recent posts