Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: changefeed 可以指定多个sink-uri吗?
[TiDB Usage Environment] Production Environment
[TiDB Version] v6.5.2
Can multiple addresses be specified for sink-uri when changefeed is synchronized to the standby database?
From my own testing, only one address can be specified. The current issue is that the standby database has multiple tidb-servers. If only one is specified and that tidb-server goes down, it will affect the changefeed. Can multiple connection strings be written?
I’ve tried writing multiple instances with Kafka, and it works. I haven’t tried it with TiDB server. Let’s see how you write multiple instances.
If multiple tidb-servers are part of the same cluster, you can use a proxy for load balancing.
Is there a reference example for writing to multiple Kafka topics?
You can check this document.
–sink-uri=“mysql://user:password@host1:port1,host2:port2/db_name”
host1:port1
and host2:port2
represent the addresses of two standby databases respectively.
Awesome!
Just tested it, and there’s a detail to note:
I just tested 4 syntax forms, and only 1 and 2 are correct. A slash (/) needs to be added after the port, and the last one can be optional.
–sink-uri=“mysql://user:password@host1:port1/,host2:port2/”
–sink-uri=“mysql://user:password@host1:port1/,host2:port2”
–sink-uri=“mysql://user:password@host1:port1,host2:port2/”
–sink-uri=“mysql://user:password@host1:port1,host2:port2”
Give it a five-star rating, hahaha.
You let me win, you let me win, hahaha.
I didn’t realize it could be used this way, it’s really cool
It can be written like this! Learned something new.
Got it, that’s good, hahaha
Try using –sink-uri=“mysql://user:password@host1:port1,host2:port2/db_name”
I will go for further testing to see if it can switch automatically.
Hidden experts in the community