edit the grastate.dat file manually and set safe_to_bootstrap to 1
1、嘗試重啟mysql資料庫時報錯
[root@galera01 ~]# /etc/init.d/mysqld start --wsrep-new-cluster
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
2、檢視啟動報錯日誌
2017-07-24T02:45:41.972508Z 0 [ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the
updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 .
2017-07-24T02:45:41.972511Z 0 [ERROR] WSREP: wsrep::connect(gcomm://192.168.56.111,192.168.56.112,192.168.56.113) failed: 7
2017-07-24T02:45:41.972513Z 0 [ERROR] Aborting
2017-07-24T02:45:41.972516Z 0 [Note] Giving 0 client threads a chance to die gracefully
2017-07-24T02:45:41.972519Z 0 [Note] WSREP: Service disconnected.
2017-07-24T02:45:42.972895Z 0 [Note] WSREP: Some threads may fail to exit.
2017-07-24T02:45:42.972937Z 0 [Note] Binlog end
2017-07-24T02:45:42.973014Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
3、嘗試先啟動其他節點,相同報錯
從錯誤日誌提示報錯提示,當前節點不是叢集中最後離開的節點,也就是說當前節點可能未能包含所有的更新。
如果強制啟動當前節點,需要修改grastate.dat檔案將safe_to_bootstrap的值置為1。
嘗試先啟動其他節點,相同報錯。
4、修改grastate.dat檔案
該檔案主要描述GALERA保持的狀態資訊,按指引修改safe_to_bootstrap的值置為1。
# cat grastate.dat
# GALERA saved state
version: 2.1
uuid: df4a1da6-701a-11e7-87fe-e6c3a440d1ec
seqno: -1
safe_to_bootstrap: 1 ---由原來的0修改為1再次啟動
# /etc/init.d/mysqld start --wsrep-new-cluster
Starting mysqld: [ OK ]
5、mysql叢集啟動成功
mysql> show global status like 'wsrep%';
+------------------------------+-------------------------------------------------------------+
| Variable_name | Value |
+------------------------------+-------------------------------------------------------------+
| wsrep_local_state_uuid | df4a1da6-701a-11e7-87fe-e6c3a440d1ec |
| wsrep_protocol_version | 7 |
| wsrep_last_committed | 0 |
| wsrep_replicated | 0 |
| wsrep_replicated_bytes | 0 |
| wsrep_repl_keys | 0 |
| wsrep_repl_keys_bytes | 0 |
| wsrep_repl_data_bytes | 0 |
| wsrep_repl_other_bytes | 0 |
| wsrep_received | 10 |
| wsrep_received_bytes | 752 |
| wsrep_local_commits | 0 |
| wsrep_local_cert_failures | 0 |
| wsrep_local_replays | 0 |
| wsrep_local_send_queue | 0 |
| wsrep_local_send_queue_max | 1 |
| wsrep_local_send_queue_min | 0 |
| wsrep_local_send_queue_avg | 0.000000 |
| wsrep_local_recv_queue | 0 |
| wsrep_local_recv_queue_max | 1 |
| wsrep_local_recv_queue_min | 0 |
| wsrep_local_recv_queue_avg | 0.000000 |
| wsrep_local_cached_downto | 18446744073709551615 |
| wsrep_flow_control_paused_ns | 0 |
| wsrep_flow_control_paused | 0.000000 |
| wsrep_flow_control_sent | 0 |
| wsrep_flow_control_recv | 0 |
| wsrep_cert_deps_distance | 0.000000 |
| wsrep_apply_oooe | 0.000000 |
| wsrep_apply_oool | 0.000000 |
| wsrep_apply_window | 0.000000 |
| wsrep_commit_oooe | 0.000000 |
| wsrep_commit_oool | 0.000000 |
| wsrep_commit_window | 0.000000 |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| wsrep_cert_index_size | 0 |
| wsrep_causal_reads | 0 |
| wsrep_cert_interval | 0.000000 |
| wsrep_incoming_addresses | 192.168.56.111:3306,192.168.56.112:3306,192.168.56.113:3306 |
| wsrep_desync_count | 0 |
| wsrep_evs_delayed | |
| wsrep_evs_evict_list | |
| wsrep_evs_repl_latency | 0/0/0/0/0 |
| wsrep_evs_state | OPERATIONAL |
| wsrep_gcomm_uuid | df49c18f-701a-11e7-aaaa-9659aa7ef9f8 |
| wsrep_cluster_conf_id | 3 |
| wsrep_cluster_size | 3 |
| wsrep_cluster_state_uuid | df4a1da6-701a-11e7-87fe-e6c3a440d1ec |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| wsrep_local_bf_aborts | 0 |
| wsrep_local_index | 0 |
| wsrep_provider_name | Galera |
| wsrep_provider_vendor | Codership Oy |
| wsrep_provider_version | 3.20(r7e383f7) |
| wsrep_ready | ON |
+------------------------------+-------------------------------------------------------------+
57 rows in set (0.00 sec)
-----------------------------------End By TangYun--------------------------------------------------
[root@galera01 ~]# /etc/init.d/mysqld start --wsrep-new-cluster
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
2、檢視啟動報錯日誌
2017-07-24T02:45:41.972508Z 0 [ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the
updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 .
2017-07-24T02:45:41.972511Z 0 [ERROR] WSREP: wsrep::connect(gcomm://192.168.56.111,192.168.56.112,192.168.56.113) failed: 7
2017-07-24T02:45:41.972513Z 0 [ERROR] Aborting
2017-07-24T02:45:41.972516Z 0 [Note] Giving 0 client threads a chance to die gracefully
2017-07-24T02:45:41.972519Z 0 [Note] WSREP: Service disconnected.
2017-07-24T02:45:42.972895Z 0 [Note] WSREP: Some threads may fail to exit.
2017-07-24T02:45:42.972937Z 0 [Note] Binlog end
2017-07-24T02:45:42.973014Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
3、嘗試先啟動其他節點,相同報錯
從錯誤日誌提示報錯提示,當前節點不是叢集中最後離開的節點,也就是說當前節點可能未能包含所有的更新。
如果強制啟動當前節點,需要修改grastate.dat檔案將safe_to_bootstrap的值置為1。
嘗試先啟動其他節點,相同報錯。
4、修改grastate.dat檔案
該檔案主要描述GALERA保持的狀態資訊,按指引修改safe_to_bootstrap的值置為1。
# cat grastate.dat
# GALERA saved state
version: 2.1
uuid: df4a1da6-701a-11e7-87fe-e6c3a440d1ec
seqno: -1
safe_to_bootstrap: 1 ---由原來的0修改為1再次啟動
# /etc/init.d/mysqld start --wsrep-new-cluster
Starting mysqld: [ OK ]
5、mysql叢集啟動成功
mysql> show global status like 'wsrep%';
+------------------------------+-------------------------------------------------------------+
| Variable_name | Value |
+------------------------------+-------------------------------------------------------------+
| wsrep_local_state_uuid | df4a1da6-701a-11e7-87fe-e6c3a440d1ec |
| wsrep_protocol_version | 7 |
| wsrep_last_committed | 0 |
| wsrep_replicated | 0 |
| wsrep_replicated_bytes | 0 |
| wsrep_repl_keys | 0 |
| wsrep_repl_keys_bytes | 0 |
| wsrep_repl_data_bytes | 0 |
| wsrep_repl_other_bytes | 0 |
| wsrep_received | 10 |
| wsrep_received_bytes | 752 |
| wsrep_local_commits | 0 |
| wsrep_local_cert_failures | 0 |
| wsrep_local_replays | 0 |
| wsrep_local_send_queue | 0 |
| wsrep_local_send_queue_max | 1 |
| wsrep_local_send_queue_min | 0 |
| wsrep_local_send_queue_avg | 0.000000 |
| wsrep_local_recv_queue | 0 |
| wsrep_local_recv_queue_max | 1 |
| wsrep_local_recv_queue_min | 0 |
| wsrep_local_recv_queue_avg | 0.000000 |
| wsrep_local_cached_downto | 18446744073709551615 |
| wsrep_flow_control_paused_ns | 0 |
| wsrep_flow_control_paused | 0.000000 |
| wsrep_flow_control_sent | 0 |
| wsrep_flow_control_recv | 0 |
| wsrep_cert_deps_distance | 0.000000 |
| wsrep_apply_oooe | 0.000000 |
| wsrep_apply_oool | 0.000000 |
| wsrep_apply_window | 0.000000 |
| wsrep_commit_oooe | 0.000000 |
| wsrep_commit_oool | 0.000000 |
| wsrep_commit_window | 0.000000 |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| wsrep_cert_index_size | 0 |
| wsrep_causal_reads | 0 |
| wsrep_cert_interval | 0.000000 |
| wsrep_incoming_addresses | 192.168.56.111:3306,192.168.56.112:3306,192.168.56.113:3306 |
| wsrep_desync_count | 0 |
| wsrep_evs_delayed | |
| wsrep_evs_evict_list | |
| wsrep_evs_repl_latency | 0/0/0/0/0 |
| wsrep_evs_state | OPERATIONAL |
| wsrep_gcomm_uuid | df49c18f-701a-11e7-aaaa-9659aa7ef9f8 |
| wsrep_cluster_conf_id | 3 |
| wsrep_cluster_size | 3 |
| wsrep_cluster_state_uuid | df4a1da6-701a-11e7-87fe-e6c3a440d1ec |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| wsrep_local_bf_aborts | 0 |
| wsrep_local_index | 0 |
| wsrep_provider_name | Galera |
| wsrep_provider_vendor | Codership Oy |
| wsrep_provider_version | 3.20(r7e383f7) |
| wsrep_ready | ON |
+------------------------------+-------------------------------------------------------------+
57 rows in set (0.00 sec)
-----------------------------------End By TangYun--------------------------------------------------
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24930246/viewspace-2142470/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Create database manuallyDatabase
- 452 Error writing file: A file cannot be larger than the value set by ulimit.ErrorMIT
- Edit with EmacsMac
- jar editJAR
- iOS Edit PhoneNumiOS
- Edit SAP tables
- How to drop Oracle RAC database manually?OracleDatabase
- Ultraedit Clipboards (Edit Menu)
- eBook Edit Pro 3.21
- How to Deinstall Oracle Clusterware Home ManuallyOracle
- (問題解決)Cannot set LC_CTYPE to default locale: No such file or directory
- oracle安裝遇到:CreateFile() error 32 when trying set file timeOracleError
- Ultra Edit中取消警告
- "log file sync"等待事件-1事件
- libcap.so.1:cannot open shared object file: No such file or directoryObject
- libz.so.1: cannot open shared object file: No such file or directoryObject
- [Leetcode] Edit DistanceLeetCode
- Leetcode Edit DistanceLeetCode
- Save and Edit a Report Specification locally
- 字串函式 sha1_file ()字串函式
- Java IO1:IO和FileJava
- R.java was modified manually! Reverting to generated version!Java
- Manually Backup - Restore or Clone a Database to Another Node [ID 562556.1]RESTDatabase
- Shell重定向&>file、2>&1、1>&2的區別
- MySQL:MGR 學習(1):寫集合(Write set)MySql
- Objective-C中get/set方法初探(1)Object
- unexpected inconsistency;RUN fsck MANUALLY 解決方案
- Leetcode-Edit DistanceLeetCode
- Edit Distance leetcode javaLeetCodeJava
- 《Google File System》讀書筆記(1)Go筆記
- python的__get__、__set__、__delete__(1)Pythondelete
- 問題1.libXp.so.6: cannot open shared object file: No such file or directoryObject
- 10. MySQL Galera Cluster全解析 Part 10 grastate.dat檔案詳解MySqlAST
- Leetcode-One Edit DistanceLeetCode
- 具有edit功能的combobox (轉)
- 執行hadoop作業 No job jar file set. User classes may not be found. See Job orHadoopJAR
- alter system set events相關知識(轉帖1)
- goldengate 11g patch set 1的新特性Go