错误代码:
0 1 |
mysql> drop database zz; ERROR 1047 (08S01): WSREP has not yet prepared node for application use |
原因分析:
0 1 2 3 4 5 6 7 8 9 |
mysql> show status like '%wsrep_cluster%'; +--------------------------+--------------------------------------+ | Variable_name | Value | +--------------------------+--------------------------------------+ | wsrep_cluster_conf_id | 18446744073709551615 | | wsrep_cluster_size | 2 | | wsrep_cluster_state_uuid | e35b3ad5-788e-11e8-8767-6750dfa85f8e | | wsrep_cluster_status | non-Primary | +--------------------------+--------------------------------------+ 4 rows in set (0.01 sec) |
PXC(Percona Xtradb Cluster)为了保证数据一致性只允许小于50%的节点脱离集群,当节点数小于50%的子集群会进入非主模式拒绝对外提供服务.会导致集群暂时无法对外提供服务.
修复方法:
0 1 2 3 4 5 6 7 8 9 10 |
mysql> SET GLOBAL wsrep_provider_options = 'pc.bootstrap=true'; mysql> show status like '%wsrep_cluster%'; +--------------------------+--------------------------------------+ | Variable_name | Value | +--------------------------+--------------------------------------+ | wsrep_cluster_conf_id | 15 | | wsrep_cluster_size | 2 | | wsrep_cluster_state_uuid | e35b3ad5-788e-11e8-8767-6750dfa85f8e | | wsrep_cluster_status | Primary | +--------------------------+--------------------------------------+ |
查看服务器最佳提交:
0 1 2 3 4 5 6 |
mysql> show status like 'wsrep_last_committed'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | wsrep_last_committed | 3 | +----------------------+-------+ 1 row in set (0.00 sec) |
参考:
1:https://stackoverflow.com/questions/40653238/mariadb-galera-error-when-a-node-shutdown-error-1047-wsrep-has-not-yet-prepare
2:https://www.j4ml.com/t/37207SourceByrd's Weblog-https://note.t4x.org/error/wsrep-has-not-yet-prepared-node-for-application-use/
SourceByrd's Weblog-https://note.t4x.org/error/wsrep-has-not-yet-prepared-node-for-application-use/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!