文章目录
- 配置debezium
- 示例
- debezium 相关命令
- mysql 链接
- sql server 链接配置
配置debezium
提交Connector用户配置
curl 'http://10.100.11.36:8083/connectors' -X POST -i -H "Content-Type:application/json" -d '{\
"name": "yxconnectors",\
"config": {\
"connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",\
"database.hostname": "10.100.11.4",\
"database.port": "1433",\
"database.user": "sa",\
"database.password": "sclzsa",\
"database.dbname": "yxtest",\
"database.server.name": "yxconnectors",\
"table.whitelist": "dbo.yxtest",\
"database.history.kafka.bootstrap.servers": "localhost:9092",\
"database.history.kafka.topic": "dbhistory.yxconnector"\
}}'
示例
curl 'http://10.100.11.36:8083/connectors' -X POST -i -H "Content-Type:application/json" -d '{"name": "yxconnectora","config":{"connector.class":"io.debezium.connector.sqlserver.SqlServerConnector","database.hostname":"10.100.11.4","database.port":"1433","database.user":"sa","database.password":"sclzsa","database.dbname":"yxtest","database.server.name":"yxconnectora","table.whitelist":"dbo.yxtest,dbo.AbmsLogin","database.history.kafka.bootstrap.servers":"localhost:9092","database.history.kafka.topic":"dbhistory.yxconnectora"}}'
debezium 相关命令
安装jq: yum install jq
查看链接名
curl -s 10.100.11.36:8083/connectors | jq
查看connector的信息
curl -s 10.100.11.36:8083/connectors/yxconnector | jq
查看connector下运行的task信息
curl -s 10.100.11.36:8083/connectors/yxconnector/tasks | jq
查看connector当前状态
curl -s 10.100.11.36:8083/connectors/yxconnector/status | jq
暂停/重启 Connector
# curl -s -X PUT 10.100.11.36:8083/connectors/yxconnector/pause | jq
# curl -s -X PUT 10.100.11.36:8083/connectors/yxconnectorcdc/resume | jq
删除 Connector
curl -s -X DELETE 10.100.11.36:8083/connectors/yxconnector | jq
mysql 链接
{
"name": "mysql-connectord",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"database.user": "shutong",
"database.server.id": "1",
"database.history.kafka.bootstrap.servers": "10.100.11.29:9092,10.100.11.30:9092,10.100.11.31:9092",
"database.history.kafka.topic": "dbhistory.mysqld",
"database.server.name": "mysqld",
"database.port": "3306",
"include.schema.changes": "true",
"decimal.handling.mode": "string",
"database.hostname": "10.2.2.162",
"database.password": "rePHqUz$e4",
"name": "mysql-connectord",
"database.whitelist": "abtc_appcenter,abtc_user_manage,abtc_subsidize"
}
}
#属性说明 https://debezium.io/documentation/reference/0.10/connectors/mysql.html
sql server 链接配置
{
"name": "sqlserverCWXT555",
"config": {
"connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
"database.user": "samove",
"database.dbname": "u8ab",
"decimal.handling.mode": "string",
"database.hostname": "10.100.11.4",
"database.password": "samove20190902",
"database.history.kafka.bootstrap.servers": "10.100.11.29:9092,10.100.11.30:9092,10.100.11.31:9092",
"database.history.kafka.topic": "dbhistory.sqlserverCW1",
"name": "sqlserverCWXT555",
"database.server.name": "sqlserverCWXT5",
"database.port": "1433",
"table.whitelist": "dbo.ysyfxz_m,dbo.yszkzk,dbo.ywyysyf"
}
}
#属性说明 https://debezium.io/documentation/reference/0.10/connectors/sqlserver.html (官网地址)
#属性说明 https://debezium.io/documentation/reference/0.10/connectors/oracle.html(官网地址)