亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

為什么MySQL 5.7主庫崩潰切備庫

發布時間:2021-10-11 10:24:07 來源:億速云 閱讀:120 作者:柒染 欄目:MySQL數據庫

這期內容當中小編將會給大家帶來有關為什么MySQL 5.7主庫崩潰切備庫,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

場景:

MySQL主庫無故宕機:判斷是IO問題導致。

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains

information that should help you find out what is causing the crash.

200118 02:11:39 mysqld_safe Number of processes running now: 0

200118 02:11:39 mysqld_safe mysqld restarted

原來主庫的my.cnf:

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

# *** default location during install, and will be replaced if you

# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin

# These are commonly set, remove the # and set as required.

# basedir = .....

# datadir = .....

# port = .....

# server_id = .....

# socket = .....

basedir=/usr/local/mysql

datadir=/data/bak1

socket=/tmp/mysql.sock

server-id =11224722

default_password_lifetime=0

log-bin=/data/bak1/mysql-bin2

expire_logs_days = 1

max_binlog_size =600M

binlog_format = MIXED

#max_allowed_packet =1*1024*1024*1024

max_allowed_packet =1024M

event_scheduler = 1

transaction-isolation = READ-COMMITTED

max_connections=5000

innodb_buffer_pool_size = 80G

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

1.確保所有的relay log全部更新完畢,在每個從庫上執行stop slave io_thread; show processlist;

直到看到Has read all relay log,則表示從庫更新都執行完畢了。

2.登陸所有從庫,查看master.info文件,對比選擇pos最大的作為新的主庫,這里我們選擇192.168.112.10為新的主庫。

為什么MySQL 5.7主庫崩潰切備庫

3.登陸192.168.112.10,執行stop slave; 并進入數據庫目錄,刪除master.info和relay-log.info文件, 配置my.cnf文件,

開啟log-bin,如果有log-slaves-updates和read-only則要注釋掉,執行reset master。

新主庫的my.cnf:

[mysqld]

#datadir=/var/lib/mysql

#socket=/var/lib/mysql/mysql.sock

datadir=/data/db

socket=/tmp/mysql.sock

server-id =111210

log-bin = /data/db/mysql-bin.log

# binlog_format = MIXED

#relay-log = rep_relay_log1

#relay-log-index = rep_relay_log1

#log-error=/data/bak/mysqld1.err

#skip-slave-start = 1

default_password_lifetime=0

# binlog-ignore-db=mysql  

#expire_logs_days =7

max_connections = 2000

# user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

#symbolic-links=0

max_allowed_packet =1024M

#master_info_repository=table

#relay_log_info_repository=table

#relay_log_recovery=1

#transaction-isolation = READ-COMMITTED

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

4.SHOW MASTER STATUS; 查詢主庫狀態。

OK。

上述就是小編為大家分享的為什么MySQL 5.7主庫崩潰切備庫了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

宜城市| 呼和浩特市| 陈巴尔虎旗| 湖南省| 新蔡县| 韶山市| 土默特左旗| 渭源县| 怀集县| 佛学| 全南县| 朝阳区| 江北区| 中阳县| 西林县| 曲沃县| 淮北市| 哈尔滨市| 泸水县| 永济市| 和林格尔县| 汉川市| 石门县| 湖南省| 永修县| 溧阳市| 东乌珠穆沁旗| 集贤县| 瑞金市| 广平县| 喀什市| 自贡市| 上林县| 清丰县| 繁峙县| 奎屯市| 洪雅县| 团风县| 马关县| 磐石市| 砀山县|