目次

MySQL 5.7 から MySQL 8 へのアップグレード

Pandora FMS ドキュメント一覧に戻る

前提条件

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

CentOS 7

/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
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
mv /tmp/my.cnf.BACK /etc/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
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)
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 -u root -p <password>
UNINSTALL COMPONENT 'file://component_validate_password';
CREATE USER "<DBUSER>"@'%' IDENTIFIED BY "<DBPASS>";

注意 : データベースへの接続 IP アドレスを制限したい場合は、% を接続元の IP アドレスに変更する必要があります。

ALTER USER "<DBUSER>"@'%' IDENTIFIED WITH mysql_native_password BY "<DBPASS>";
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

Rocky Linux 8/AlmaLinux 8/RHEL 8

/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
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
mv /tmp/my.cnf.BACK /etc/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
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)
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

Pandora FMS ドキュメント一覧に戻る