MySQL 5.7 から MySQL 8 へマイグレートするには、少なくとも Pandora FMS バージョン NG 760 MR 52 へアップグレードする必要があります。
mysql --version
次のような出力が得られます。
mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper
/etc/init.d/pandora_server stop /etc/init.d/pandora_agent_daemon stop
systemctl stop httpd.service
または、
/etc/init.d/httpd stop
mysqldump -u root -p pandora \ --skip-add-drop-table \ --complete-insert \ --no-create-info > backup_pandora.sql
mysqldump -u root -p pandora > backup_pandora_5.7.sql
my.cnf
)をバックアップします。cp /etc/my.cnf /tmp/my.cnf.BACK
rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
percona-release setup ps80
yum install percona-server-server
my.cnf
ファイルをリストアします。mv /tmp/my.cnf.BACK /etc/my.cnf
query_cache_*
を無効化するように my.cnf
ファイルを修正します。sed -i -e "s/^query_cache_type.*/#query_cache_type/g" /etc/my.cnf sed -i -e "s/^query_cache_size.*/#query_cache_size/g" /etc/my.cnf sed -i -e "s/^query_cache_min_res_unit.*/#query_cache_min_res_unit/g" /etc/my.cnf sed -i -e "s/^query_cache_limit.*/#query_cache_limit/g" /etc/my.cnf
mysqld
セクションの次のコマンドでバイナリログを無効化します。skip-log-bin
my.cnf
ファイルのチェックには、“最適化と問題解決” も参照してください。
systemctl start mysql
または、
service mysqld start
mysql --version
次のような出力を確認できます。
mysql Ver 8.0.28-19 for Linux on x86_64 (Percona Server (GPL), Release 19, Revision 31e88966cd3)
pandora
データベースを削除します。pandora
データベースを作成します。pandora
データベースを開き、Pandora FMS Web コンソールにあるスキーマをインポートします。mysql -u root -p pandora
drop database pandora; create database pandora; use pandora; source /var/www/html/pandora_console/pandoradb.sql; source backup_pandora.sql;
mysql
にログインしていない場合 は、 root ユーザ(パスワードは対応するものを利用)として以下を実行します:mysql -u root -p <password>
UNINSTALL COMPONENT 'file://component_validate_password';
CREATE USER "<DBUSER>"@'%' IDENTIFIED BY "<DBPASS>";
注意 : データベースへの接続 IP アドレスを制限したい場合は、%
を接続元の IP アドレスに変更する必要があります。
mysql
にネイティブパスワードを設定します。ALTER USER "<DBUSER>"@'%' IDENTIFIED WITH mysql_native_password BY "<DBPASS>";
pandora
)に対して grant を行います。GRANT ALL PRIVILEGES ON pandora.* TO "<DBUSER>"@'%';
flush privileges; exit
データベースの対応が完了したら、次のステップを実行します。
/etc/init.d/pandora_server start /etc/init.d/pandora_agent_daemon start
systemctl start httpd.service
または、
/etc/init.d/httpd start
/etc/init.d/pandora_server stop /etc/init.d/pandora_agent_daemon stop
systemctl stop httpd.service
または、
/etc/init.d/httpd stop
mysqldump -u root -p pandora \ --skip-add-drop-table \ --complete-insert \ --no-create-info> backup_pandora.sql
mysqldump -u root -p pandora > backup_pandora_5.7.sql
my.cnf
)をバックアップします。cp /etc/my.cnf /tmp/my.cnf.BACK
rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
percona-release setup ps80
dnf install percona-server-server
my.cnf
ファイルをリストアします。mv /tmp/my.cnf.BACK /etc/my.cnf
query_cache_*
を無効化するために my.cnf
を修正します。sed -i -e "s/^query_cache_type.*/#query_cache_type/g" /etc/my.cnf sed -i -e "s/^query_cache_size.*/#query_cache_size/g" /etc/my.cnf sed -i -e "s/^query_cache_min_res_unit.*/#query_cache_min_res_unit/g" /etc/my.cnf sed -i -e "s/^query_cache_limit.*/#query_cache_limit/g" /etc/my.cnf
[mysqld]
セクションの次のコマンドでバイナリログを無効化します。skip-log-bin
my.cnf
ファイルのチェックには、“最適化と問題解決” も参照してください。
systemctl start mysql
または、
service mysqld start
mysql --version
次のような出力が見られます。
mysql Ver 8.0.28-19 for Linux on x86_64 (Percona Server (GPL), Release 19, Revision 31e88966cd3)
pandora
データベースを削除します。pandora
データベースを作成します。pandora
データベースを開き、Pandora FMS Web コンソールにあるスキーマをインポートします。mysql -u root -p pandora
drop database pandora; create database pandora; use pandora; source /var/www/html/pandora_console/pandoradb.sql; source backup_pandora.sql;
/etc/init.d/pandora_server start /etc/init.d/pandora_agent_daemon start
systemctl start httpd.service
または、
/etc/init.d/httpd start