We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我们在用 canal-go 来消费多个 Destination 的 binlog 做数据同步,但是发现多个实例只有一个能够竞争到并且连接到 canal-server。
看代码实现 doConnect 的时候,zk 的 path 都是 /canal-consumer,如果启动了多个实例,要去监听不同的 Destination,看起来只有一个实例能够竞争到去 Connect。
/canal-consumer
修改了一下用 "/canal-consumer/" + destination 拼接成 zk 的 path 就可以了。不知道这里这样实现会不会有坑。
"/canal-consumer/" + destination
const ( runningFlag = byte(0) notRunningFlag = byte(0) path = "/canal-consumer" ) func NewClusterCanalConnector(canalNode *CanalClusterNode, username string, password string, destination string, soTimeOut int32, idleTimeOut int32) (*ClusterCanalConnector,error) { destinationPath := fmt.Sprintf("%s/%s", path, destination) err := checkRootPath(canalNode.zkClient, destinationPath) if err != nil { return nil, err } currentSequence, err := createEphemeralSequence(canalNode.zkClient, destinationPath) if err != nil { return nil,err } cluster := &ClusterCanalConnector{ canalNode: canalNode, username: username, password: password, destination: destination, soTimeOut: soTimeOut, idleTimeOut: idleTimeOut, RetryTimes: 0, currentSequence:currentSequence, zkVersion: 0, Path: destinationPath, } return cluster, nil }
The text was updated successfully, but these errors were encountered:
你好,可以考虑给我提个pr.
Sorry, something went wrong.
No branches or pull requests
你好,我们在用 canal-go 来消费多个 Destination 的 binlog 做数据同步,但是发现多个实例只有一个能够竞争到并且连接到 canal-server。
看代码实现 doConnect 的时候,zk 的 path 都是
/canal-consumer
,如果启动了多个实例,要去监听不同的 Destination,看起来只有一个实例能够竞争到去 Connect。修改了一下用
"/canal-consumer/" + destination
拼接成 zk 的 path 就可以了。不知道这里这样实现会不会有坑。The text was updated successfully, but these errors were encountered: