(前提条件)
・ OS標準版のMariaDBは、10.3なので古いためMariaDBのレポジトリより10.5をインストール
・ Zabbix 6.0 LTSCは、10.5以上が必要
MariaDB 10.3の削除
OS標準版のMariaDBがインストールされている場合は、以下の手順で削除する。
1 2 3 4 5 6 7 8 9 |
# インストール済みパッケージの確認 dnf --installed list|grep mariadb # インストール済みパッケージの削除 dnf -y remove mariadb mariadb-backup mariadb-common mariadb-connector-c mariadb-connector-c-config mariadb-errmsg mariadb-gssapi-server mariadb-server mariadb-server-utils # mariadb 10.3パッケージの残ディレクトリの移動または削除(影響を受けなくするため) mv /var/lib/mysql/ /var/lib/mysql_10.3 mv /etc/my.cnf.d /etc/my.cnf.d_10.3 |
MariaDB 10.5のインストール
1 2 3 4 5 6 7 |
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.5/centos8-amd64 module_hotfixes=1 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 enabled=1 |
1 |
dnf -y install MariaDB-server |
サーバのメモリが、4GBの場合のサンプル
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/share/mysql/ # # this is read by the standalone daemon and embedded servers [server] # this is only for the mysqld standalone daemon [mysqld] character-set-server = utf8 collation-server = utf8_bin skip-character-set-client-handshake innodb_file_per_table innodb_buffer_pool_size=1G innodb_log_file_size=256M read_buffer_size = 4M # # * Galera-related settings # [galera] # Mandatory settings #wsrep_on=ON #wsrep_provider= #wsrep_cluster_address= #binlog_format=row #default_storage_engine=InnoDB #innodb_autoinc_lock_mode=2 # # Allow server to accept connections on all interfaces. # #bind-address=0.0.0.0 # # Optional setting #wsrep_slave_threads=1 #innodb_flush_log_at_trx_commit=0 # this is only for embedded server [embedded] # This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb] # This group is only read by MariaDB-10.5 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-10.5] |
MariaDBの起動&初期設定
1 2 3 4 5 6 7 8 9 10 11 12 13 |
systemctl enable mariadb systemctl start mariadb mysql_secure_installation Enter current password for root (enter for none) Enterキー Switch to unix_socket authentication [Y/n] n Change root password? [Y/n] y : (rootのパスワードを設定する) Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y |