実験は詳しくMHAを構築する過程の出会う各種の問題を解きます
実験は詳しくMHAを構築する過程の出会う各種の問題を解きます一、MHA構築過程における問題集合 問題1: 問題2: 問題3: 問題4: 問題5: 問題6: 問題7: 問題8: 問題9: 問題10: 問題11: 問題12:
一、MHA構築過程における問題集合
問題1:
問題2:
問題3:
問題4:
質問5:
問題6:
質問7:
問題8:
質問9:
問題10:
問題11:
問題12:
一、MHA構築過程における問題集合
問題1:
Thu Aug 23 04:39:01 2018 - [warning] log-bin is not set on slave 192.168.0.189(192.168.0.189:3306). This host cannot be a master.
Thu Aug 23 04:39:01 2018 - [warning] log-bin is not set on slave 192.168.0.190(192.168.0.190:3306). This host cannot be a master.
:
binlog, log_bin=on,
[root@centos7-02 ~]# vi /etc/my.cnf
basedir = /usr/local/mysql
datadir = /data/mysql
socket = /tmp/mysql.sock
server-id=189
log_bin=on
問題2:
Can't exec "mysqlbinlog": at /usr/local/share/perl5/MHA/BinlogManager.pm line 106.
mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options
at /usr/local/bin/apply_diff_relay_logs line 493.
:
[root@centos7-01 ~]# ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
[root@centos7-01 ~]# ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
[root@centos7-02 ~]# ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
[root@centos7-02 ~]# ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
[root@centos7-03 ~]# ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
[root@centos7-03 ~]# ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
問題3:
Thu Aug 23 05:41:59 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln226] Failed to get master_ip_failover_script status with return code 1:0.
Thu Aug 23 05:41:59 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48
Thu Aug 23 05:41:59 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
:
[root@centos7-04 ~]# vi /etc/masterha/app1.cnf
#master_ip_failover_script= /usr/local/bin/master_ip_failover // , keepalived
:Failover : IP , 。MHA , , IP , keepalive , master_ip_failover。
問題4:
Thu Aug 23 18:17:14 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. Can't exec "/usr/local/bin/master_ip_failover": at /usr/local/share/perl5/MHA/ManagerUtil.pm line 68.
Thu Aug 23 18:17:14 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
:
chmod +x /usr/local/bin/master_ip_failover
質問5:
[error][/usr/local/share/perl5/MHA/ServerManager.pm, ln492] Server 192.168.0.190(192.168.0.190:3306) is dead, but must be alive! Check server settings.
:
[root@centos7-04 ~]# rm -rf /var/log/masterha/app1.log/app1.failover.complete # MHA
問題6:
[error][/usr/local/share/perl5/MHA/ServerManager.pm, ln492] Server 192.168.0.190(192.168.0.190:3306) is dead, but must be alive! Check server settings.
:
質問7:
[error][/usr/local/share/perl5/MHA/ServerManager.pm, ln492] Server 192.168.0.188(192.168.0.188:3306) is dead, but must be alive! Check server settings.
Fri Aug 24 23:50:37 2018 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/local/share/perl5/MHA/MasterMonitor.pm line 399
:
mysql
問題8:
[error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!
:
,
mysql> show slave status\G
Master_Server_Id: 189
質問9:
[error][/usr/local/share/perl5/MHA/ServerManager.pm, ln781] Multi-master configuration is detected, but two or more masters are either writable (read-only is not set) or dead! Check configurations for details. Master configurations are as below:
Master 192.168.0.189(192.168.0.189:3306), dead
Master 192.168.0.188(192.168.0.188:3306), replicating from 192.168.0.189(192.168.0.189:3306)
:
mysql -uroot -p -e "set global read_only=1"
問題10:
mysqlbinlog: unknown variable 'default-character-set=utf8'
mysqlbinlog version command failed with rc 7:0, please verify PATH, LD_LIBRARY_PATH, and client options
:
clinet default-character-set=utf8mb4
UTF8 utf8mb4
[client]
#default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
問題11:
root@ubuntu:~# su - mysql -c "/usr/local/bin/masterha_check_repl --conf=/etc/mha/mysql/app.cnf"
Fri May 15 14:22:05 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Fri May 15 14:22:05 2020 - [info] Reading application default configuration from /etc/mha/mysql/app.cnf..
Fri May 15 14:22:05 2020 - [info] Reading server configuration from /etc/mha/mysql/app.cnf..
Fri May 15 14:22:05 2020 - [info] MHA::MasterMonitor version 0.58.
Fri May 15 14:22:05 2020 - [error][/usr/local/share/perl/5.22.1/MHA/Server.pm, ln180] Got MySQL error when connecting 192.168.1.2(192.168.1.2:3306) :1045:Access denied for user 'mha'@'192.168.1.3' (using password: YES), but this is not a MySQL crash. Check MySQL server settings.
Fri May 15 14:22:05 2020 - [error][/usr/local/share/perl/5.22.1/MHA/Server.pm, ln180] Got MySQL error when connecting 192.168.1.1(192.168.1.1:3306) :1045:Access denied for user 'mha'@'192.168.1.3' (using password: YES), but this is not a MySQL crash. Check MySQL server settings.
Fri May 15 14:22:05 2020 - [error][/usr/local/share/perl/5.22.1/MHA/ServerManager.pm, ln301] at /usr/local/share/perl/5.22.1/MHA/ServerManager.pm line 297.
Fri May 15 14:22:05 2020 - [error][/usr/local/share/perl/5.22.1/MHA/ServerManager.pm, ln301] at /usr/local/share/perl/5.22.1/MHA/ServerManager.pm line 297.
Fri May 15 14:22:06 2020 - [error][/usr/local/share/perl/5.22.1/MHA/ServerManager.pm, ln309] Got fatal error, stopping operations
Fri May 15 14:22:06 2020 - [error][/usr/local/share/perl/5.22.1/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/local/share/perl/5.22.1/MHA/MasterMonitor.pm line 329.
Fri May 15 14:22:06 2020 - [error][/usr/local/share/perl/5.22.1/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Fri May 15 14:22:06 2020 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
:
mysql> grant all privileges on *.* to 'mha'@'Mysql1' identified by 'manager';
mysql> grant all privileges on *.* to 'mha'@'Mysql2' identified by 'manager';
mysql> grant all privileges on *.* to 'mha'@'Mysql3' identified by 'manager';
mysql> flush privileges;
問題12:
[root@mysql3 ~]# /usr/local/mysql/scripts/mysql_install_db \
> --basedir=/usr/local/mysql \
> --datadir=/usr/local/mysql/data \
> --user=mysql
bash: /usr/local/mysql/scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory
:
yum -y install autoconf