1. version: "2"
    2. services:
    3. mysql:
    4. restart: always
    5. image: debezium/example-mysql:1.1
    6. container_name: mysql-server
    7. volumes:
    8. - /data/mysql/db:/var/lib/mysql
    9. - /opt/workspace/docker-compose/my.cnf:/etc/my.cnf
    10. # 数据库还原目录 可将需要还原的sql文件放在这里
    11. #- /apps/mysql/source:/docker-entrypoint-initdb.d
    12. ports:
    13. - 3307:3306
    14. environment:
    15. - MYSQL_ROOT_PASSWORD=123456
    1. [mysqld]
    2. user=mysql
    3. default-storage-engine=INNODB
    4. character-set-server=utf8
    5. character-set-client-handshake=FALSE
    6. collation-server=utf8_unicode_ci
    7. init_connect='SET NAMES utf8'
    8. server_id=1
    9. log-bin=mysql-bin
    10. binlog_format=row
    11. [client]
    12. default-character-set=utf8
    13. [mysql]
    14. default-character-set=utf8

    代码:
    https://gitee.com/wt_study_demo/hadoop_learning
    注意:checkpoint 必须成功提交