1. 程式人生 > >處理PXC初始化和啟動報錯三例

處理PXC初始化和啟動報錯三例

報錯一:pxc初始化報錯
-bash-4.1$ cd /usr/local/mysql
-bash-4.1$ ./scripts/mysql_install_db
./bin/my_print_defaults: error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory
FATAL ERROR: Neither host 'mvxl0782' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option

解決方法:
1.檢查openssl是否安裝
rpm -qa|grep openssl
若沒有安裝,執行yum install openssl openssl-devel
2.若有安裝,建立軟連結檔案
ln -sf /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.6
ln -sf /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.6

報錯二:pxc第一個節點啟動報錯
-bash-4.1$ /etc/init.d/mysql bootstrap-pxc
Bootstrapping PXC (Percona XtraDB Cluster)MySQL (Percona XtraDB Cluster) is not running, but PID file exists[FAILED]

解決:
刪除pid檔案
cd /data/mysql/mysql_3306/data
rm -f mvxl0782.pid

報錯三:pxc其它節點啟動報錯
-bash-4.1$ /etc/init.d/mysql start
Starting MySQL (Percona XtraDB Cluster)..........The server quit without updating PID file (/data/mysql/mysql_3306/data/mvxl0784.pid).[FAILED]
MySQL (Percona XtraDB Cluster) server startup failed![FAILED]

檢視error log:
2016-06-22 17:27:49 10996 [ERROR] WSREP: Local state seqno (8) is greater than group seqno (7): states diverged. Aborting to avoid p
otential data loss. Remove '/data/mysql/mysql_3306/data//grastate.dat' file and restart if you wish to continue. (FATAL)
         at galera/src/replicator_str.cpp:state_transfer_required():33
2016-06-22 17:27:49 10996 [Note] WSREP: applier thread exiting (code:8)
2016-06-22 17:27:49 10996 [ERROR] Aborting

2016-06-22 17:27:51 10996 [Note] WSREP: Service disconnected.
2016-06-22 17:27:51 10996 [Note] WSREP: rollbacker thread exiting
2016-06-22 17:27:52 10996 [Note] WSREP: Some threads may fail to exit.
2016-06-22 17:27:52 10996 [Note] Binlog end
2016-06-22 17:27:52 10996 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

Error in my_thread_global_end(): 1 threads didn't exit
160622 17:27:57 mysqld_safe mysqld from pid file /data/mysql/mysql_3306/data/mvxl0783.pid ended


解決:
刪除grastate.dat,重新啟動mysql即可。