version: "2"
services:
mysql:
restart: always
image: debezium/example-mysql:1.1
container_name: mysql-server
volumes:
- /data/mysql/db:/var/lib/mysql
- /opt/workspace/docker-compose/my.cnf:/etc/my.cnf
# 数据库还原目录 可将需要还原的sql文件放在这里
#- /apps/mysql/source:/docker-entrypoint-initdb.d
ports:
- 3307:3306
environment:
- MYSQL_ROOT_PASSWORD=123456
[mysqld]
user=mysql
default-storage-engine=INNODB
character-set-server=utf8
character-set-client-handshake=FALSE
collation-server=utf8_unicode_ci
init_connect='SET NAMES utf8'
server_id=1
log-bin=mysql-bin
binlog_format=row
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
代码:
https://gitee.com/wt_study_demo/hadoop_learning
注意:checkpoint 必须成功提交