gpt4 book ai didi

azure - 将 SymmetricDS 与 Azure SQL 数据库结合使用时的权限问题

转载 作者:行者123 更新时间:2023-12-03 04:19:06 25 4
gpt4 key购买 nike

我有两个引擎:postgres.properties(主节点)和azure.properties。两者都在同一台机器上。一个数据库位于本地,一个位于云端。

当 SymmetricDS 启动时,它会为我的 azure 引擎提供以下错误:

2018-06-05 06:49:30,476 WARN [azure] [JdbcSqlTemplate] [symmetric-engine-startup-1] CREATE TABLE permission denied in database 'master'..  Failed to execute: CREATE TABLE "sym_channel"(
"channel_id" VARCHAR(128) NOT NULL,
"processing_order" INT DEFAULT 1 NOT NULL,
"max_batch_size" INT DEFAULT 1000 NOT NULL,
"max_batch_to_send" INT DEFAULT 60 NOT NULL,
"max_data_to_route" INT DEFAULT 100000 NOT NULL,
"extract_period_millis" INT DEFAULT 0 NOT NULL,
"enabled" SMALLINT DEFAULT 1 NOT NULL,
"use_old_data_to_route" SMALLINT DEFAULT 1 NOT NULL,
"use_row_data_to_route" SMALLINT DEFAULT 1 NOT NULL,
"use_pk_data_to_route" SMALLINT DEFAULT 1 NOT NULL,
"reload_flag" SMALLINT DEFAULT 0 NOT NULL,
"file_sync_flag" SMALLINT DEFAULT 0 NOT NULL,
"contains_big_lob" SMALLINT DEFAULT 0 NOT NULL,
"batch_algorithm" VARCHAR(50) DEFAULT 'default' NOT NULL,
"data_loader_type" VARCHAR(50) DEFAULT 'default' NOT NULL,
"description" VARCHAR(255),
"queue" VARCHAR(25) DEFAULT 'default' NOT NULL,
"max_network_kbps" DECIMAL(10,3) DEFAULT 0.000 NOT NULL,
"data_event_action" CHAR(1),
"create_time" DATETIME,
"last_update_by" VARCHAR(50),
"last_update_time" DATETIME,
PRIMARY KEY ("channel_id")
)

这是因为“主”数据库是 read-only in Azure SQL databases 。之后,[azure] 节点关闭。

INFO [azure] [AbstractSymmetricEngine] [symmetric-engine-startup-1] Stopping SymmetricDS externalId=001 version=3.9.7 database=Microsoft SQL Server

..然后 [postgres] 节点对此有这样的说法:

WARN [postgres] [PushService] [postgres-push-default-3] Cannot push to node '001' in the group 'azure'. The sync url is blank

同步 URL 和注册 URL 是为两个引擎设置的,所以我认为真正的问题在于权限问题。

问题:

如何修复此错误?我假设我需要指示 SymmetricDS 使用“master”以外的数据库,但是如何操作?

postgres.properties

engine.name=postgres
db.driver=org.postgresql.Driver

# The JDBC URL used to connect to the database
db.url=jdbc:postgresql://127.0.0.1/<redacted>

# The user to login as who can create and update tables
db.user=<redacted>

# The password for the user to login as
db.password=<redacted>

registration.url=
sync.url=http://localhost:31415/sync/postgres-000

# Do not change these for running the demo
group.id=postgres
external.id=000

# Don't muddy the waters with purge logging
job.purge.period.time.ms=7200000

# This is how often the routing job will be run in milliseconds
job.routing.period.time.ms=5000
# This is how often the push job will be run.
job.push.period.time.ms=10000
# This is how often the pull job will be run.
job.pull.period.time.ms=10000
# Kick off initial load
initial.load.create.first=true

azure.properties

engine.name=azure
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver # located in the libs folder

# The JDBC URL used to connect to the database
db.url=jdbc:jtds:sqlserver://<redacted>

# The user to login as who can create and update tables
db.user=<redacted>

# The password for the user to login as
db.password=<redacted>

sync.url=http://localhost:31415/sync/azure-001
registration.url=http://localhost:31415/sync/postgres-000

group.id=azure
external.id=001

# This is how often the routing job will be run in milliseconds
job.routing.period.time.ms=5000
# This is how often the push job will be run.
job.push.period.time.ms=10000
# This is how often the pull job will be run.
job.pull.period.time.ms=10000

最佳答案

在文件 azure.properties 中,带有 sync.url 的行被注释掉:

# sync.url=http://localhost:31415/sync/azure-001

经验法则是 symmetryDs 代理应尽可能靠近它同步的数据库。应该有一个 symmetry-ds 代理在主节点附近运行,另一个在云中靠近 azure 实例运行。您将无法同步只读数据库。 SymmetricDs需要写/读,甚至创建表、函数、包和触发器权限才能正常工作

关于azure - 将 SymmetricDS 与 Azure SQL 数据库结合使用时的权限问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50692519/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com