はじめに
Application Stream(AppStream)を利用してCentOS8にMariaDB10.3をインストール
親記事:MySQL, MariaDBの各種インストール方法とEOLまとめ - Qiita
参考:RHEL8のパッケージ構成 - BaseOSとApplication Stream - 赤帽エンジニアブログ
サポート
本手法で導入した場合、Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portalより、2023-05 2029-05がEOLだと思われる。
それ以降に報告された脆弱性や不具合への対応は実施されない可能性がある。
なおCentOS Linux 8が2021-12にEOLを迎えるため、それ以降の更新を受けるためにはCentOS Stream8を含めた他ディストリビューションへの移行が必要。
note
- MySQLを入れた後だと/var/lib/mysqlを削除してからインストールしないと起動に失敗した
LOG
インストール
# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)
# yum install -y @mariadb:10.3
... 略
mariadb起動/停止
# systemctl start mariadb
# systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2019-09-26 08:16:46 EDT; 32s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 8691 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 8558 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 8533 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 8659 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 30 (limit: 11109)
Memory: 82.8M
CGroup: /system.slice/mariadb.service
mq8659 /usr/libexec/mysqld --basedir=/usr
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: Please report any problems at http://mariadb.org/jira
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: The latest information about MariaDB is available at http://mariadb.org/.
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: You can find additional information about the MySQL part at:
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: http://dev.mysql.com
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: Consider joining MariaDB's strong and vibrant community:
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: https://mariadb.org/get-involved/
Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26 8:16:46 0 [Note] /usr/libexec/mysqld (mysqld 10.3.11-MariaDB) starting as process 8659 ...
Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26 8:16:46 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4184)
Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26 8:16:46 0 [Warning] Changed limits: max_open_files: 1024 max_connections: 151 (was 151) table_cache: 421 (was 2000)
Sep 26 08:16:46 localhost.localdomain systemd[1]: Started MariaDB 10.3 database server.
# systemctl stop mariadb
# systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: You can find additional information about the MySQL part at:
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: http://dev.mysql.com
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: Consider joining MariaDB's strong and vibrant community:
Sep 26 08:16:46 localhost.localdomain mysql-prepare-db-dir[8558]: https://mariadb.org/get-involved/
Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26 8:16:46 0 [Note] /usr/libexec/mysqld (mysqld 10.3.11-MariaDB) starting as process 8659 ...
Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26 8:16:46 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4184)
Sep 26 08:16:46 localhost.localdomain mysqld[8659]: 2019-09-26 8:16:46 0 [Warning] Changed limits: max_open_files: 1024 max_connections: 151 (was 151) table_cache: 421 (was 2000)
Sep 26 08:16:46 localhost.localdomain systemd[1]: Started MariaDB 10.3 database server.
Sep 26 08:18:03 localhost.localdomain systemd[1]: Stopping MariaDB 10.3 database server...
Sep 26 08:18:05 localhost.localdomain systemd[1]: Stopped MariaDB 10.3 database server.
mariadb自動起動設定/設定解除
# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
# systemctl list-unit-files --type=service |grep maria
mariadb.service enabled
mariadb@.service disabled
# systemctl disable mariadb
Removed /etc/systemd/system/multi-user.target.wants/mariadb.service.
Removed /etc/systemd/system/mysql.service.
Removed /etc/systemd/system/mysqld.service.
# systemctl list-unit-files --type=service |grep maria
mariadb.service disabled
mariadb@.service disabled
各種確認
# which mysql
/usr/bin/mysql
# systemctl start mariadb
# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.11-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select version();
+-----------------+
| version() |
+-----------------+
| 10.3.11-MariaDB |
+-----------------+
1 row in set (0.001 sec)