如何保护kafka connect,以便不记录connection.url和凭据?

u7up0aaq  于 2021-06-05  发布在  Kafka
关注(0)|答案(1)|浏览(237)

我遇到的问题是,运行连接器时正在记录凭据,我不想记录这些凭据。
任何线索都将不胜感激。

twh00eeo

twh00eeo1#

尝试使用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*

相关问题