这个问题与:Debezium 如何使用 Kafka Connect 正确注册 SqlServer 连接器 - 连接被拒绝
在 Windows 10 中,我在 Docker 容器外部的 Microsoft SQL Server 实例上运行 Debezium.我每 390 毫秒收到以下警告:
In Windows 10, I have Debezium running on an instance of Microsoft SQL Server that is outside of a Docker container. I am getting the following warning every 390 milliseconds:
数据库中没有记录最大LSN;请确保 SQL服务器代理正在运行
[io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource]
No maximum LSN recorded in the database; please ensure that the SQL Server Agent is running
[io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource]
我在 Github 上检查了 Debezium 的代码,唯一能找到此警告的地方在代码注释中指出,只有在 Agent 未运行时才应抛出此警告.我已确认 SQL Server 代理正在运行.
I checked Debezium's code on Github and the only place that I can find this warning states in the code comments that this warning should only be thrown if the Agent is not running. I have confirmed that the SQL Server Agent is running.
为什么会出现此警告,我该如何解决?
Why is this warning showing up and how do I fix it?
注意:
我当前的解决方案似乎只适用于非生产环境 - 根据 Docker 的文档.
My current solution appears to only work in a non-production environment - per Docker's documentation.
LSN 是与 SQL Server 更改相关的片段"信息.如果您没有 LSN,则可能是您的 CDC 未运行或未正确配置.Debezium 使用 LSN 进行复制,因此您的 SQL Server 需要生成它.
LSN is the "pieces" of information related about your SQL Server changes. If you don't have LSN, is possible that your CDC is not running or not configured properly. Debezium consumes LSNs to replicate so, your SQL Server need to generate this.
一些方法:
SELECT s.name AS Schema_Name, tb.name AS Table_Name
, tb.object_id, tb.type, tb.type_desc, tb.is_tracked_by_cdc
FROM sys.tables tb
INNER JOIN sys.schemas s on s.schema_id = tb.schema_id
WHERE tb.is_tracked_by_cdc = 1
检查是否启用:
SELECT *
FROM sys.change_tracking_databases
WHERE database_id=DB_ID('MyDatabase')
并检查是否正在运行:
EXECUTE sys.sp_cdc_enable_db;
GO
EXEC sys.sp_cdc_start_job;
GO
null 处配置解决了我的问题(更多详细信息 此处)null solved my problem (more details here) EXEC sys.sp_cdc_enable_table
@source_schema=N'dbo',
@source_name=N'AD6010',
@capture_instance=N'ZZZZ_AD6010',
@role_name = NULL,
@filegroup_name=N'CDC_DATA',
@supports_net_changes=1
GO
这篇关于Debezium:数据库中没有记录最大LSN;请确保 SQL Server 代理正在运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
如何将 Apache Spark 与 MySQL 集成以将数据库表作为How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何将 Apache Spark 与 MySQL 集成以将数据库表作为
在 Apache Spark 2.0.0 中,是否可以从外部数据库获取In Apache Spark 2.0.0, is it possible to fetch a query from an external database (rather than grab the whole table)?(在 Apache Spark 2.0.0 中,是否可
分解表以按列进行透视(SQL、PYSPARK)Break down a table to pivot in columns (SQL,PYSPARK)(分解表以按列进行透视(SQL、PYSPARK))