dyrnq / docker-canal

docker-canal
https://github.com/alibaba/canal
0 stars 0 forks source link

start multiple canal-server with the local configuration running cluster mode? #5

Open dyrnq opened 12 hours ago

dyrnq commented 12 hours ago

3 canal-server + local +zookeeper = cluster?

dyrnq commented 12 hours ago

即使不使用 Canal Admin,Canal Server 仍然可以通过 Zookeeper 实现高可用性(HA)。Zookeeper 用于协调多个 Canal Server 实例的状态和任务。

Canal Admin有点complicated and complicated。

dyrnq commented 10 hours ago
### HA with canal-admin

1. run canal-admin.
2. login canal-admin with user/password.
3. create cluster.
4. config main config for the cluster which step 3 created.
5. modify the main config which step 4 created. some key configs e.g. `canal.zkServers = zoo1:2181,zoo2:2181,zoo3:2181` `canal.serverMode = rocketMQ` `rocketmq.namesrv.addr = 192.168.88.123:9876`
6. add instance config and modify instance config. some key configs e.g. `canal.instance.master.address=main-db5:3306`
7. run canal-server with *local* parameter. see [canal_local.properties](https://github.com/alibaba/canal/wiki/Canal-Admin-ServerGuide#%E5%8F%98%E5%8C%96%E7%82%B9)

### HA without canal-admin

1. configs all `canal.properties` for all the canal-server. see [canal.properties](https://github.com/alibaba/canal/blob/master/deployer/src/main/resources/canal.properties). 
2. keep the `canal.properties` configs same.
3. config instance configs for all the canal-server.
4. run canal-server.
dyrnq commented 10 hours ago
## HA with canal-admin
-Dcanal.conf=/home/admin/canal-server/bin/../conf/canal_local.properties

## HA without canal-admin
-Dcanal.conf=/home/admin/canal-server/bin/../conf/canal.properties
dyrnq commented 10 hours ago

canal/wiki/Canal-Admin-ServerGuide#%E5%8F%98%E5%8C%96%E7%82%B9

设计理念

引入了canal-admin之后,canal-server之前面向命令行的运维方式需要有一些变化,主要的变化在于配置体系上,每个server节点上不应该再去维护复杂而且冗长的canal.properties/instance.properties,应该选择以最小化、无状态的方式去启动,因此在canal 1.1.4上,对于配置做了一些重构来支持canal-admin,同时也兼容了原先的命令行运维模式.

变化点

引入canal_local.properties,针对canal-server启动所需要的配置,做了最小化配置,只需要关注和admin请求的必要参数即可

# register ip
canal.register.ip =

# canal admin config
canal.admin.manager = 127.0.0.1:8089
canal.admin.port = 11110
canal.admin.user = admin
canal.admin.passwd = 4ACFE3202A5FF5CF467898FC58AAB1D615029441
# admin auto register
canal.admin.register.auto = true
canal.admin.register.cluster =