TiCDC mysql sink can not connect to ipv6 address #6135
Closed
Description
opened on Jul 1, 2022
What did you do?
Create a changefeed that replicate data to an ipv6 address MySQL server.
tiup cdc cli changefeed create --pd="http://[::1]:2379" --sink-uri="tidb://root:@[::1]:4005/" --changefeed-id="simple-replication-task" --sort-engine="unified"
tiflow/cdc/sink/mysql/mysql.go
Line 109 in ee4e36c
We should use net.JoinHostPort
for hostnames that are in literal IP addresses.
Workaround: use DNS domain name.
What did you expect to see?
Success.
What did you see instead?
Starting component cdc
: /Users/.tiup/components/cdc/v6.1.0/cdc cli changefeed create --pd=http://[::1]:2379 --sink-uri=tidb://root:@[::1]:4005/ --changefeed-id=simple-replication-task --sort-engine=unified
Error: [CDC:ErrMySQLConnectionError]fail to open MySQL connection: dial tcp [::1:4005]:3306: connect: no route to host
Versions of the cluster
TiCDC version (execute cdc version
):
v6.1.0
Activity