当 debezium 连接器从您的 sql 服务器获取数据时,有没有办法限制 kafka 连接堆 space

is there a way to limit kafka connect heap space when debezium connector is fetching data from your sql server

我正在尝试设置一个连接器,从 SQL 服务器获取数据以与 apache kafka 一起使用。我已经使用 docker-compose 文件设置了所有的 kafka 服务,但是 SQL 服务器在另一台服务器上。 这是我在 ksqldb 中的 debezium 连接器的配置:

create source connector sql_connector with 
('connector.class'='io.debezium.connector.sqlserver.SqlServerConnector',
'database.server.name'='sqlserver',
'database.hostname'= 'xxxxx',
'database.port'='1433',
'database.user'= 'xxxx',
'database.password'= 'xxxxxx',
'database.dbname'='xxxxxxxxx',
'database.history.kafka.bootstrap.servers'='broker:29092',
'database.history.kafka.topic'='dbz_dbhistory.sqlserver.asgard-01');

当我这样做时,我收到连接器已成功创建的响应,但是当我通过使用 'show connectors' 作为连接器查询 ksqldb 时,我收到以下错误消息:

io.confluent.ksql.util.KsqlServerException: org.apache.http.conn.HttpHostConnectException: Connect to connect:8083 [connect/172.18.0.6] failed: Connection refused (Connection refused)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to
        connect:8083 [connect/172.18.0.6] failed: Connection refused (Connection
        refused)
Caused by: Could not connect to the server.
Caused by: Could not connect to the server.

当我检查我的 kafka 连接日志时,我可以看到它向服务器发出 select 语句,但过了一会儿我收到以下错误并且我的 kafka 连接关闭:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000b5400000, 118489088, 0) failed; error='Not enough space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 118489088 bytes for committing reserved memory.
# An error report file with more information is saved as:

关于如何解决这个问题有什么想法吗?其他只是给我的服务器更多的内存。

您的计算机的可用内存少于 ~118MB:

Native memory allocation (mmap) failed to map 118489088 bytes for committing reserved memory

您需要增加或释放机器上的内存才能启动 JVM。如果是运行,您可以使用以下环境变量更改JVM的堆内存设置:

KAFKA_HEAP_OPTS="-Xms256M -Xmx2G"