You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 曹明勤 <m1...@163.com> on 2023/05/22 07:34:07 UTC

提问

在我提交的flink-cdc-mysql的任务中,需要flink同步多张表的数据,但是我遇到了server-id重复的问题。我尝试过设置随机数,但是server-id有一定的取值范围,并且随机数还是有可能重复。官方文档建议我将server-id设置为一个范围,比如5400-6400,并且设置flink的并行度。这些我都做了,但是当我同步表的数量较多时,还是会出现server-id重复的问题导致任务提交失败。我需要如何设置才能如何避免这种错误?




In the Flinks-cdc-mysql task I submitted, flink was required to synchronize data of multiple tables, but I encountered the problem of server-id duplication. I tried to set a random number, but server-id has a range of values, and random numbers can be repeated. The official documentation advised me to set server-id to a range, such as 5400-6400, and set flink's parallelism. I did all of this, but when I synchronized a large number of tables, I still had the problem of server-id duplication, which caused the task submission to fail. What do I need to set up to avoid this error?

Re: 提问

Posted by Leonard Xu <xb...@gmail.com>.
(1)可以检查下是不是其他作业或者同步工具使用了对应的server-id
(2) server-id 可以尝试用机器IP+时间戳来生成,这样能尽可能避免冲突

祝好,
雪尽

> On May 22, 2023, at 3:34 PM, 曹明勤 <m1...@163.com> wrote:
> 
> 在我提交的flink-cdc-mysql的任务中,需要flink同步多张表的数据,但是我遇到了server-id重复的问题。我尝试过设置随机数,但是server-id有一定的取值范围,并且随机数还是有可能重复。官方文档建议我将server-id设置为一个范围,比如5400-6400,并且设置flink的并行度。这些我都做了,但是当我同步表的数量较多时,还是会出现server-id重复的问题导致任务提交失败。我需要如何设置才能如何避免这种错误?
> 
> 
> 
> 
> In the Flinks-cdc-mysql task I submitted, flink was required to synchronize data of multiple tables, but I encountered the problem of server-id duplication. I tried to set a random number, but server-id has a range of values, and random numbers can be repeated. The official documentation advised me to set server-id to a range, such as 5400-6400, and set flink's parallelism. I did all of this, but when I synchronized a large number of tables, I still had the problem of server-id duplication, which caused the task submission to fail. What do I need to set up to avoid this error?