溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

MGR自增序列參數(shù)設(shè)置步驟

發(fā)布時間:2020-05-25 16:47:27 來源:億速云 閱讀:520 作者:鴿子 欄目:MySQL數(shù)據(jù)庫

一、官網(wǎng)說明
When Group Replication is started on a server, the value of auto_increment_increment is changed to the value of group_replication_auto_increment_increment, which defaults to 7, and the value of auto_increment_offset is changed to the server ID. The changes are reverted when Group Replication is stopped. These settings avoid the selection of duplicate auto-increment values for writes on group members, which causes rollback of transactions. The default auto increment value of 7 for Group Replication represents a balance between the number of usable values and the permitted maximum size of a replication group (9 members).

The changes are only made and reverted if auto_increment_increment and auto_increment_offset each have their default value of 1. If their values have already been modified from the default, Group Replication does not alter them. From MySQL 8.0, the system variables are also not modified when Group Replication is in single-primary mode, where only one server writes.

敲黑板,劃重點(diǎn),在MySQL8.0的版本中,組復(fù)制在單主模式下(只有一個寫服務(wù)器),系統(tǒng)變量(自增序列參數(shù))是不會自動修改的。這是新版本中增加的一段話,我也是在測試中發(fā)現(xiàn)了了這個問題,在官網(wǎng)中得到了證實(shí)。知識就是知識或者別人告訴你,或者你自己找答案,找答案的過程是很有意思的。

二、驗(yàn)證過程
1、系統(tǒng)默認(rèn)參數(shù)
MGR自增序列參數(shù)設(shè)置步驟

2、自增序列表,自增是按照默認(rèn)參數(shù)自增的,并沒有修改
MGR自增序列參數(shù)設(shè)置步驟

三、建議
1、建議大家還是用MGR中的單主模式
2、要對你要修改的每一個參數(shù)了如指掌,不然就不要改動。
3、紙上得來終覺淺,多做測試和實(shí)驗(yàn)也要多分享。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI