我正在尝试设置从 MySQL 到 Postgres 的简单复制。相同的模式。按照 Demo Tutorial 中的步骤操作后经过轻微的更改(使用 MySQL 和 Postgres 驱动程序),我仍然无法使复制工作。
根据运行 bin/sym
后的投诉,需要进行一些更改
SET GLOBAL show_compatibility_56 = ON
需要在 MySQL 数据库中设置- 对于 Postgres,我需要使用
protocolVersion=3
而不是示例中设置的 2。
奇怪的是,SymmetricDS 能够创建 sym_*
表,但提示无法读取它们。我已经验证这些表在 bin/sym
运行之前不存在,但在运行之后确实存在。这是日志的摘录
// Successful creation of table
[store-001] - PostgreSqlSymmetricDialect - DDL applied: CREATE TABLE "sym_notification"(
"notification_id" VARCHAR(128) NOT NULL,
...
PRIMARY KEY ("notification_id")
)
...
// Unable to read from created table
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_notification
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_notification
[store-001] - AbstractDatabaseWriter - Did not find the sym_notification table in the target database
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_monitor
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_monitor
[store-001] - AbstractDatabaseWriter - Did not find the sym_monitor table in the target database
同样的错误适用于所有 sym_*
表。
数据库在 Docker 中运行,但由于 SymmetricDS 没有提示无法连接,并且能够创建表,我认为它与 Docker 无关。
Postgres DB 中的数据库是由 engines/store-001.properties
中指定的同一用户创建的。这是否仍然与角色和访问权限有关?
最佳答案
如果您从 Postgres 升级到最新的 JDBC 驱动程序,它将可以工作。
从此处的最新版本替换 lib 目录中的现有 Postgres 驱动程序:https://jdbc.postgresql.org/download.html
关于postgresql - SymmetricDS Postgres 目标为所有 sym_* 表提供 "Failed to read table",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40888672/