安裝好 Docker 之後,執行避免每次執行都要 sudo
盤點 group 是否已經存在:
sudo cat /etc/group | grep docker
如果 group 不存在就執行以下:
sudo groupadd docker
sudo usermod -aG docker ${USER}
sudo chmod a+rw /var/run/docker.sock
= 文件尾 =
自己是沒有定期更新內容的習慣..... 但這陣子因為工作上的因素,想了想也跟 MariaDB 這個軟體一起工作了三年時光。
2022/6/15這一天讓我在客戶的生產環境下通過了考驗,有感而發......對自己寫一點紀錄吧。
十幾年前我老是羨慕為何有些公司能夠提供永遠不會打烊的軟體服務,
拜當今疫情關係,網路上充滿免費的活動與課程,
現在我也能夠輕易打造出來,而且居然還能在客戶面前一步一步表演MariaDB的災害復原。
考核的當下我感覺我不是面對考核官員,而是面對著十幾年前的我。有感而發......對自己寫下了此文。
同時... 我思考著這場旅途似乎在靠近終點站,該思考下一條成長動能的新旅途。
I am not in the habit of updating my page on a regular basis.....
I have been working with MariaDB for 3 years now,
but I think I passed the test in a customer's production environment on 2022/6/15.
I was inspired in the moment... I'd like to write a little record for myself.
A decade ago I was always envious of how some companies could offer software services that never closed,
and thanks to the current epidemic, the internet is full of free events and courses.
At the time of the appraisal I felt like I was not facing an appraisal officer,
but the person I was over 10 years ago.
I was inspired in the moment. I wrote this article to myself.
Meanwhile... I think about how this journey seems to be approaching the end of the line,
and how it is time to think about the next journey of growth momentum.
The knowledge that has allowed me to grow is here for those who are interested to share it
https://galeracluster.com/library/documentation/weighted-quorum.html
https://severalnines.com/database-blog/multiple-data-center-setups-using-galera-cluster-mysql-or-mariadb
很重要! 請先參照備份與還原章節實施備份,再繼續往下。
以下假設由 4 台 MariaDB 組成了 Galery Cluster
服務全停的【關閉】順序:
…
(略) …
View:
id: 1c06ce49-bcd3-11ec-b14e-8b8dee207a31:1172
status: primary
protocol_version: 4
capabilities: MULTI-MASTER, CERTIFICATION,
PARALLEL_APPLYING, REPLAY, ISOLATION, PAUSE, CAUSAL_READ, INCREMENTAL_WS,
UNORDERED, PREORDERED, STREAMING, NBO
final: no
own_index: 1
members(3):
0:
07b735c5-c5f1-11ec-960f-dfe621728932, node3
1: ce7be80b-c5f0-11ec-97f3-633bd2a0f1e8,
node2
2: f3284315-c633-11ec-8919-96b52b18760a,
node1
3: 01b775c5-c5f1-12ec-ab0f-dfe621246932c,
node4
(原文:https://galeracluster.com/2016/11/introducing-the-safe-to-bootstrap-feature-in-galera-cluster )
資料庫叢集MariaDB Galera Cluster 的設計是朝服務啟動之後就永不停止,在平時的運作上不需要關閉整座叢集。然而實際運維過程上有可能遭遇到意外,例如被無預警斷網、停電等等。因此為了因應各種無預警狀況,導入了一項被稱為【Safe-To-Bootstrap】的管制機制。
其原理是當一個健康叢集所有成員(資料庫節點)均處於服務運作狀態時,每一台節點的【Safe-To-Bootstrap】值被設置為0,而健康叢集運行過程會推選出領頭羊(Primary) 節點,只有按順序將領頭羊節點留在最後一台關機者,該領頭羊的【Safe-To-Bootstrap】才會被設置為1。而被設置為1者,並且在所有節點重新復原啟動過程中,【還必須】是第一台開機啟動者,這樣叢集才能夠自動的恢復起來。
在此引用名詞【柵欄】形容用來阻擋資料庫成員脫離了MariaDB Galera Cluster後獨自對外提供服務,導致發生比災難更大的災難。也就是資料庫發生腦裂現象(split-brain)。資料被打散個別儲存於MariaDB Galera Cluster之內與外,嚴重程度到無法重新復原。為阻止此現象,透過【柵欄】設計,阻擋資料庫服務節點於不正常關閉停止後服務又被自動啟動,如此降低發生腦裂現象風險。
而這樣的刻意設計安排,目的是希望經由人員介入判斷後再排除障礙使其恢復MariaDB Galera Cluster服務。現實中有很高的機率在搶時間恢復服務壓力下,直接啟動所有的資料庫節點服務。而這樣的行為,如果不阻擋很容易演變人為介入的資料庫腦裂現象。而這就常演變為服務中斷時間愈來愈久。