Software

Got error 261 ‘DML count in transaction exceeds config parameter

匯入 NDB 的時候發生了一個錯誤 ERROR 1296 (HY000) at line 65: Got error 261 'DML count in transaction exceeds config parameter MaxDMLOperationsPerTransaction/MaxNoOfConcurrentOp' from NDBCLUSTER 看起來的問題應該是匯入的 INSERT INTO 量太大了,所以要將 MaxNoOfConcurrentOperations 這個參數條大 [ndbd default] # 在 config 裡面定義這兩個參數就可以了 MaxNoOfConcurrentOperations=1048576 MaxNoOfConcurrentTransactions=1048576

Continue Reading
Software

GitLab Runner 安裝及設定

依照官方的方式有很多種,使用的是比較簡單的 packages 安裝 1 安裝時執行 Repository curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash 2 安裝最新版的 git runner sudo apt-get install gitlab-runner 4 註冊/設定 runners sudo gitlab-runner register #輸入 gitlab 的 url Enter the GitLab instance URL (for example, https://gitlab.com/): #輸入 gitlab 的 token Enter the registration token: #對這個 runner 的描述 Enter a description for the runner: …

Continue Reading
Software

Cannot update GTID_PURGED with the Group Replication plugin running

今天將 GR 的資料做 mysqldump 的時候發生了這樣子的警告訊息,然後在匯入到新環境的時候就發生了錯誤 Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass –set-gtid-purged=OFF. To make a complete dump, pass –all-databases –triggers –routines –events. 主要是因為 MGR 狀態的時候會啟動 …

Continue Reading
Software

清理 mysql binlog

繼上一篇的 GCP 硬碟炸掉的文章裡面發現主要讓他滿出來的問題主是因為 MySQL Binlog 的問題,所以就算是把空間擴大了但是主要還是要移除過期的 Binlog 才可以 一般來說 BingLog 有兩個很大的用途 資料恢復 Binlog 記錄了所有的 SQL 動作,所以如果 binlog 完整了話就有可以恢復到某個指定的時間點。 主從複製 從屬 DB 會去訂閱 binlog 的動作然後進而產生資料庫同步的效果 但是有時候過多的 binlog 會造成硬碟的負擔,使用下面的語句可以指定保留幾天內的 binglog PURGE MASTER LOGS BEFORE DATE_SUB(CURRENT_DATE, INTERVAL 3 DAY); 或是在 my.cnf 裡面加上 #只保留三天的 bin log expire_logs_days=3 基本上這種清 bin log 的機制不管是手動還是自動最好還是有一個機制會比較恰當 例如輸出備份後刪除,因為 bin log 用途很廣泛,所以盡可能的保留下來

Continue Reading
Software

OSError: [Errno 28] No space left on device

突然有一天早上發現 GCP 上面有台 CE 無法開機 經過 Serial port 的查詢出現了 OSError: [Errno 28] No space left on device 的訊息 查了一下應該是硬碟空間不足造成了 解法就是擴充現在有硬碟空間 但是問題來了,沒辦法 SSH 進去所以只能使用另外一台機器掛載上去後再擴充然後再掛回去 以下是擴充的指令 確認磁碟編號 sudo fdisk -l ### 出現了剛剛擴充的空間,但是還沒分配 GPT PMBR size mismatch (62914559 != 268435455) will be corrected by write. The backup GPT table is not on the end of the device. This …

Continue Reading