$ docker run --name mysql-5.6 -e MYSQL_ROOT_PASSWORD=1234 -d hub.c.163.com/library/mysql:5.6 $ docker run --name mysql-8.0 -e MYSQL_ROOT_PASSWORD=1234 -d hub.c.163.com/library/mysql:8.0
查看各容器IP地址
1
$ ip addr
172.17.0.2 mysql-5.6
172.17.0.3 mysql-8.0
查看各容器 mysql 对应版本
1 2 3
# 172.17.0.2 root@7ae2a6435ca1:/# /usr/bin/mysql -V /usr/bin/mysql Ver 14.14 Distrib 5.6.36, for Linux (x86_64) using EditLine wrapper
1 2 3
# 172.17.0.3 root@cc51ae9f3098:/# /usr/bin/mysql -V /usr/bin/mysql Ver 8.0.1-dmr for Linux on x86_64 (MySQL Community Server (GPL))
安装 vim 工具,用于编辑配置文件
由于仓库还是官方源,这里改成国内源,此处使用 163 源。
1 2 3 4 5 6 7 8 9 10 11 12
$ cat > /etc/apt/sources.list deb http://mirrors.163.com/debian/ jessie main non-free contrib deb http://mirrors.163.com/debian-archive/debian/ jessie-backports main non-free contrib deb-src http://mirrors.163.com/debian/ jessie main non-free contrib deb-src http://mirrors.163.com/debian-archive/debian/ jessie-backports main non-free contrib deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib # ctrl + c
# 由于 jessie 源在 163 上太久没有同步,忽略对文件有效期的校验。 # E: Release file for http://mirrors.163.com/debian-archive/debian/dists/jessie-backports/InRelease is expired (invalid since 632d12h 4min 50s). Updates for this repository will not be applied. $ apt-get -o Acquire::Check-Valid-Until=false update
vim /etc/mysql/mysql.conf.d/mysqld.cnf # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# # The MySQL Server configuration file. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
docker run --name mysql-5.6 -p 3307:3306 -d -e MYSQL_ROOT_PASSWORD=1234 hub.c.163.com/library/mysql:5.6
vim /etc/mysql/mysql.conf.d/mysqld.cnf # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# # The MySQL Server configuration file. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
docker run --name mysql-8.0 -p 3308:3306 -e MYSQL_ROOT_PASSWORD=1234 -d hub.c.163.com/library/mysql:8.0
canal
1 2 3 4 5 6
2020-11-17 17:55:34.093 [destination = example , address = /192.168.65.2:3307 , EventParser] WARN c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - ---> begin to find start position, it will be long time for reset or first position 2020-11-17 17:55:34.093 [destination = example , address = /192.168.65.2:3307 , EventParser] WARN c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - prepare to find start position by switch ::1605598704000 2020-11-17 17:55:34.109 [destination = example , address = /192.168.65.2:3307 , EventParser] WARN c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - Didn't find the corresponding binlog files from mysql-bin.000001 to mysql-bin.000001 2020-11-17 17:55:34.109 [destination = example , address = /192.168.65.2:3307 , EventParser] ERROR c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - dump address /192.168.65.2:3307 has an error, retrying. caused by com.alibaba.otter.canal.parse.exception.PositionNotFoundException: can't find start position for example 2020-11-17 17:55:34.110 [destination = example , address = /192.168.65.2:3307 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example[com.alibaba.otter.canal.parse.exception.PositionNotFoundException: can't find start position for exampl