在CentOS 8.3上安装MariaDB 10.5

由於結構複雜,所以我寫下了筆記。

环境

CentOS Linux发布8.3.2011版。

    • イメージファイルは「CentOS-8-x86_64-1905-dvd1.iso」

 

    • 「最小限のインストール」でインストール

 

    実行したdnfコマンドはdnf -y updateとdnf -y install chronyのみ

想要做什么

我想在CentOS 8上安装最新版本(10.5.8)的MariaDB Community Server。

参考的步骤

实际步骤

通过mariadb_repo_setup进行仓库设置。

取决于你的努力和决心。

我已指定了操作系统类型(os-type)和操作系统版本(os-version)。
https://mariadb.com/kb/zh-cn/mariadb-package-repository-setup-and-usage/#using-the-mariadb-package-repository-setup-script

# curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --os-type=rhel --os-version=8

不成功

未指定os-type和os-version将导致失败。

# curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
[error] Detected RHEL or compatible but version () is not supported.
[error] The MariaDB Repository supports these Linux OSs, on x86-64 only:
    * RHEL/CentOS 6, 7, & 8
    * Ubuntu 16.04 LTS (xenial), 18.04 LTS (bionic), & 20.04 LTS (focal)
    * Debian 9 (stretch), & 10 (buster)
    * SLES 12 & 15
[error] See https://mariadb.com/kb/en/mariadb/mariadb-package-repository-setup-and-usage/#platform-support

从CentOS 8.3开始,CentOS的rpm软件包名称发生了变化,
这导致mariadb_repo_setup无法获取操作系统版本,这似乎是导致的原因。
(以前的名称可能是“centos-release-8.2-2.2004.0.2.el8.x86_64”等)

# rpm -qa | grep centos
centos-linux-release-8.3-1.2011.el8.noarch
centos-gpg-keys-8-2.el8.noarch
centos-linux-repos-8-2.el8.noarch

安装所需的软件包

取决于个人的努力、毅力和恒心。

将MaxScale存储库设为无效(将enabled = 1更改为enabled = 0)。

[mariadb-main]
name = MariaDB Server
baseurl = https://downloads.mariadb.com/MariaDB/mariadb-10.5/yum/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY
gpgcheck = 1
enabled = 1
module_hotfixes = 1

[mariadb-maxscale]
# To use the latest stable release of MaxScale, use "latest" as the version
# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version
name = MariaDB MaxScale
baseurl = https://dlm.mariadb.com/repo/maxscale/latest/centos/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 0

[mariadb-tools]
name = MariaDB Tools
baseurl = https://downloads.mariadb.com/Tools/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Enterprise-GPG-KEY
gpgcheck = 1
enabled = 1

安装所需的软件包

# dnf -y install perl-DBI libaio libsepol lsof boost-program-options rsync

失败

在MaxScale存储库中出现了SSL证书的认证错误,因此无法获取元数据。
我没有使用MaxScale存储库,所以我将其禁用了。

# dnf -y install perl-DBI libaio libsepol lsof boost-program-options rsync
MariaDB MaxScale                                0.0  B/s |   0  B     00:04
Errors during downloading metadata for repository 'mariadb-maxscale':
  - Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://storage.googleapis.com/downloads-cdn.mariadb.com/mariadbmaxscale/2.5/2.5.5/centos/8/x86_64/repodata/repomd.xml?GoogleAccessId=downloads-sync%40downloads-234321.iam.gserviceaccount.com&Expires=1607483040&Signature=EW6MGYvRwjxY%2BT7NHw6MZZygmHIwW2tJ1DxEf4tE99t9I6J0kGBdTRn5xYs0lyICGESaCwTbBCRvuU%2Bw6oXwFSsSj7N9U%2Bv0Uzlh2Q0Eeml3TIFM%2B6NZPJ1ny96cr7UqCYgO7S5Vj6jT4PxrRyJ%2BVl5i77qraEtR9OB3uxlPaEqfib7ODF%2FyfEHsRW7rcVsZ6ZzcKmDUN8VJUYDxMPulkUEUkBp%2FSuVM5bmUikvXlaR0sp%2FhnYt8sIZua%2B5xQUwZu9UXpIRF90eqz5wR%2B5HSXakjx0zYQd0wlwx8u4g1Tviw%2Fi%2F8ZQyHRaL1QfaD50DlDFYaTwZTs1fCwGqom4hAZw%3D%3D [SSL certificate problem: self signed certificate in certificate chain]

~ 中略 ~

エラー: repo 'mariadb-maxscale' のメタデータのダウンロードに失敗しました : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

安装MariaDB社区服务器

取决于个人的努力和毅力。

安装tar

dnf -y install tar

2.安装MariaDB社区服务器

# dnf -y install --repo=mariadb-main MariaDB-server

失败

在很多人指出”CentOS8没有tar”的情况下,这是一个没有tar而导致失败的可悲结局。

# dnf -y install --repo=mariadb-main MariaDB-server
メタデータの期限切れの最終確認: 0:00:26 時間前の 2020年12月09日 13時41分41秒 に 実施しました。
エラー:
 問題: cannot install the best candidate for the job
  - nothing provides tar needed by MariaDB-server-10.5.8-1.el8.x86_64
(インストール不可のパッケージをスキップするには、'--skip-broken' を追加してみて ください または、'--nobest' を追加して、最適候補のパッケージのみを使用しないでください)

在MariaDB-server-10.5.8-1.el8.x86_64中找不到所需的tar文件,我理解为”什么?找不到tar文件?”,然后纠结着想”难道是指tar命令?”,于是尝试了一下,结果成功了。

最后

这次我第一次接触CentOS8,但是与我熟悉的CentOS7的使用方式不同,让我感到非常困难和挣扎。

我意识到不经常接触新事物是不好的。

如果这篇文章对某人有所帮助,我将感到非常高兴,因为我花了更多时间来思考这个问题。非常感谢您一直阅读到最后。