基于GTID配置从数据库起不来了

来源:5-6 基于GTID的复制

慕虎3045456

2018-12-10

环境:centos7 mysql8
从库配置如下:
bin_log=/var/lib/mysql/binlog
server_id = 200
#ENFORCE_GTID_CONSISTENCY = ON
gtid_mode = on
enforce-gtid-cnsistency = on
read_only = on
master_info_repository = TABLE
relay_log_info_repository = TABLE

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

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

从库报错信息如下:
[root@bogon ~]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-12-10 11:03:33 CST; 9s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 3155 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 3134 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 3155 (code=exited, status=1/FAILURE)
Status: “SERVER_BOOTING”

Dec 10 11:03:24 bogon systemd[1]: Starting MySQL Server…
Dec 10 11:03:33 bogon systemd[1]: mysqld.service: main process exit…E
Dec 10 11:03:33 bogon systemd[1]: Failed to start MySQL Server.
Dec 10 11:03:33 bogon systemd[1]: Unit mysqld.service entered faile…
Dec 10 11:03:33 bogon systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

mysqld.log日志信息:
2018-12-10T03:03:28.114480Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 3155
2018-12-10T03:03:32.006960Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in read-only mode.
2018-12-10T03:03:32.171239Z 0 [ERROR] [MY-010912] [Server] GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON.
2018-12-10T03:03:32.171298Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-10T03:03:33.727341Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.

请老师帮忙,实在找不到问题所在了,十分谢谢!

写回答

1回答

sqlercn

2018-12-10

GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON. 你在配置中把这个前面的#号去掉就可以了
0
6
weixin_慕村3424678
回复
sqlercn
https://coding.imooc.com/learn/questiondetail/128043.html 呵呵,前面刚提出这个问题。就看到还真有人照葫芦画瓢,把enforce_gtid_cnsistency写成enforce-gtid-cnsistency。大写的服。
2019-06-28
共6条回复

MySQL提升课程 全面讲解MySQL架构设计

面面俱到讲解影响MySQL性能的各个因素,让MySQL架构了然于胸。

4419 学习 · 547 问题

查看课程