如何保护 kafka 连接,以便不记录 connection.url 显示凭据?



我遇到的问题是在运行连接器时记录了凭据,我不想记录这些凭据。

任何线索将不胜感激。

尝试使用 connection.password 属性,该值应在日志记录时被屏蔽。像这样:

curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d 
'{ 
"name":"jdbc_source_mysql_01",
"config":{    
"connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector"         
"connection.url":"jdbc:mysql://mysql:3306/demo",
"connection.user":"connect_user",
"connection.password":"password",
"topic.prefix":"mysql-01-",
"mode":"bulk"
}
}'

发布此日志应如下所示:

INFO JdbcSourceTaskConfig values:
batch.max.rows = 100
connection.attempts = 3
connection.backoff.ms = 10000
connection.password = null
connection.url = jdbc:mysql://*REDACTED*

相关内容

最新更新