Can changefeed specify multiple sink-uris?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: changefeed 可以指定多个sink-uri吗?

| username: Daniel-W

[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?

| username: hey-hoho | Original post link

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.

| username: zxgaa | Original post link

If multiple tidb-servers are part of the same cluster, you can use a proxy for load balancing.

| username: chenhanneu | Original post link

Is there a reference example for writing to multiple Kafka topics?

| username: 大飞哥online | Original post link

You can check this document.

| username: 大飞哥online | Original post link

–sink-uri=“mysql://user:password@host1:port1,host2:port2/db_name”

host1:port1 and host2:port2 represent the addresses of two standby databases respectively.

| username: WalterWj | Original post link

Learned 6

| username: Daniel-W | Original post link

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”


| username: Kongdom | Original post link

:+1: :+1: :+1: Impressive

| username: 大飞哥online | Original post link

Give it a five-star rating, hahaha.

| username: 大飞哥online | Original post link

You let me win, you let me win, hahaha.

| username: Jellybean | Original post link

I didn’t realize it could be used this way, it’s really cool :+1: :+1:

| username: 像风一样的男子 | Original post link

It can be written like this! Learned something new.

| username: hey-hoho | Original post link

This document has it.

| username: 大飞哥online | Original post link

Got it, that’s good, hahaha :stuck_out_tongue_winking_eye:

| username: 大飞哥online | Original post link

Now discovered :face_with_peeking_eye:

| username: dba远航 | Original post link

Try using –sink-uri=“mysql://user:password@host1:port1,host2:port2/db_name”

| username: Daniel-W | Original post link

I will go for further testing to see if it can switch automatically.

| username: 随缘天空 | Original post link

Hidden experts in the community

| username: TiDBer_小阿飞 | Original post link

Learned! :+1: :+1: :+1: