You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SymmetricDS在K8s部署中出现601注册错误求助

SymmetricDS K8s部署中601注册错误解决方法

SymmetricDS返回的601错误核心原因是当前节点作为主节点(源节点)不需要执行注册流程,却配置了指向自身的注册地址,导致节点反复尝试向自己注册引发异常。结合你的部署场景(1源2目标同步),以下是具体修复方案:

一、核心配置修正

1. 移除主节点的注册地址

主节点是初始化节点,负责创建同步schema和节点组,不需要向任何节点注册。修改engine.properties中的registration.url,直接注释或删除该配置:

# 原配置,需删除/注释
# registration.url=http://symmetricds-service:31415/sync/register

2. 修正触发器正则表达式

原trigger.include.tables.regex写法错误,无法正确匹配非系统库的表,替换为正确的负向预查正则:

trigger.include.tables.regex=^(?!mysql\.|information_schema\.|performance_schema\.|sys\.).*$

3. 添加节点组同步链接配置

明确源节点组source到两个目标节点组target、additional的同步方向,添加以下配置:

node.group.link.source.target=source->target,source->additional

4. 优化数据库连接参数

为避免SSL和权限问题,在JDBC链接中添加必要参数:

db.url=jdbc:mysql://mariadb1-service:3306/source_db?useSSL=false&allowPublicKeyRetrieval=true
db.target.url=jdbc:mysql://mariadb2-service:3306/target_db?useSSL=false&allowPublicKeyRetrieval=true
db.additional.url=jdbc:mysql://mariadb3-service:3306/additional_db?useSSL=false&allowPublicKeyRetrieval=true

二、调整K8s部署启动命令

简化启动流程(SymmetricDS 3.15.7已内置MariaDB驱动,无需额外下载),修改后的SymmetricDS容器配置片段:

containers:
- name: symmetricds
  image: jumpmind/symmetricds:3.15.7
  ports:
  - containerPort: 31415
  command: ["/bin/sh", "-c"]
  args:
    - |
      mkdir -p /opt/symmetric-ds/engines &&
      echo "engine.name=master-engine
      db.driver=org.mariadb.jdbc.Driver
      db.url=jdbc:mysql://mariadb1-service:3306/source_db?useSSL=false&allowPublicKeyRetrieval=true
      db.user=root
      db.password=root_password1
      group.id=source
      external.id=node1
      sync.url=http://symmetricds-service:31415/sync/master-engine
      db.target.driver=org.mariadb.jdbc.Driver
      db.target.url=jdbc:mysql://mariadb2-service:3306/target_db?useSSL=false&allowPublicKeyRetrieval=true
      db.target.user=root
      db.target.password=root_password2
      db.additional.driver=org.mariadb.jdbc.Driver
      db.additional.url=jdbc:mysql://mariadb3-service:3306/additional_db?useSSL=false&allowPublicKeyRetrieval=true
      db.additional.user=root
      db.additional.password=root_password3
      channel.default.max_batch_size=1000
      channel.default.enabled=true
      create.sym_node_group=true
      create.sym_node_group_link=true
      node.group.link.source.target=source->target,source->additional
      trigger.exclude.tables.regex=^(mysql|information_schema|performance_schema|sys)\..*$
      trigger.include.tables.regex=^(?!mysql\.|information_schema\.|performance_schema\.|sys\.).*$
      sync.interval.ms=60000
      log.level=INFO
      initial.load.create.first=true
      " > /opt/symmetric-ds/engines/engine.properties &&
      /opt/symmetric-ds/bin/sym

三、验证修复流程

  1. 删除现有部署:
kubectl delete -f your-deployment-file.yaml
  1. 应用修改后的配置:
kubectl apply -f your-deployment-file.yaml
  1. 查看SymmetricDS启动日志,确认无601错误:
kubectl logs -f deployment/symmetricds-deployment
  1. 登录源数据库,检查sym_node、sym_node_group、sym_node_group_link表,确认节点和同步链路已正确创建。

四、额外优化建议

为避免MariaDB未就绪导致SymmetricDS连接失败,给MariaDB容器添加探针:

# 在MariaDB容器配置中添加
livenessProbe:
  exec:
    command: ["mysqladmin", "ping", "-uroot", "-proot_password1"]
  initialDelaySeconds: 30
  periodSeconds: 10
readinessProbe:
  exec:
    command: ["mysql", "-uroot", "-proot_password1", "-e", "SELECT 1"]
  initialDelaySeconds: 5
  periodSeconds: 5

内容的提问来源于stack exchange,提问作者AL VN27

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 12:35:03