테스트 해보니 debezium의 history topic에 정의된 내용은 다음과 같다.
/usr/local/confluent-5.1.2/bin/kafka-console-consumer --bootstrap-server kafka-test01.google.io:9092,kafka-test02.google.io:9092,kafka-test03.google.io:9092 --from-beginning --topic schema_changes_user
{
“source” : {
“server” : “test”
},
“position” : {
“file” : “mysql-bin.000022",
“pos” : 30567369,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1639464,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“snapshot” : true
},
“ddl” : “SET character_set_server=utf8mb4, collation_server=utf8mb4_general_ci;”
}
{
“source” : {
“server” : “test”
},
“position” : {
“file” : “mysql-bin.000022",
“pos” : 30567369,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1639464,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“snapshot” : true
},
“ddl” : “DROP TABLE IF EXISTS `test`.`user`”
}
{
“source” : {
“server” : “test”
},
“position” : {
“file” : “mysql-bin.000022",
“pos” : 30567369,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1639464,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“snapshot” : true
},
“databaseName” : “test”,
“ddl” : “DROP DATABASE IF EXISTS `test`”
}
{
“source” : {
“server” : “test”
},
“position” : {
“file” : “mysql-bin.000022",
“pos” : 30567369,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1639464,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“snapshot” : true
},
“databaseName” : “test”,
“ddl” : “CREATE DATABASE `test`”
}
{
“source” : {
“server” : “test”
},
“position” : {
“file” : “mysql-bin.000022",
“pos” : 30567369,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1639464,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“snapshot” : true
},
“databaseName” : “test”,
“ddl” : “USE `test`”
}
{
“source” : {
“server” : “test”
},
“position” : {
“file” : “mysql-bin.000022",
“pos” : 30567369,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1639464,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“snapshot” : true
},
“databaseName” : “test”,
“ddl” : “CREATE TABLE `user` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `username` varchar(1000) DEFAULT NULL,\n `vin` varchar(1000) DEFAULT NULL,\n `address` text,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=626927 DEFAULT CHARSET=utf8mb4"
}
{
“source” : {
“server” : “test”
},
“position” : {
“ts_sec” : 1554884849,
“file” : “mysql-bin.000022”,
“pos” : 33223606,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1645437,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745",
“server_id” : 1944318
},
“databaseName” : “”,
“ddl” : “CREATE USER ‘sj’@‘%’ IDENTIFIED WITH ‘mysql_native_password’ AS ‘*B1F9ACC9F58F4DA857A97AC2BA02FE1A51A82F32’”
}
{
“source” : {
“server” : “test”
},
“position” : {
“ts_sec” : 1554884857,
“file” : “mysql-bin.000022",
“pos” : 33242552,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1645480,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“server_id” : 1944318
},
“databaseName” : “”,
“ddl” : “GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE ON *.* TO ‘sj’@‘%’”
}
{
“source” : {
“server” : “test”
},
“position” : {
“ts_sec” : 1554884990,
“file” : “mysql-bin.000022”,
“pos” : 33577581,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1646234,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745",
“server_id” : 1944318
},
“databaseName” : “”,
“ddl” : “GRANT REPLICATION SLAVE ON *.* TO ‘sj’@‘%’”
}
{
“source” : {
“server” : “test”
},
“position” : {
“ts_sec” : 1554885199,
“file” : “mysql-bin.000022",
“pos” : 34099376,
“gtids” : “9a227629-491c-11e9-ae9d-fa163ea8d9a7:1-1647408,b0be07a9-491c-11e9-ae12-fa163ec49735:1-13745”,
“server_id” : 1944318
},
“databaseName” : “”,
“ddl” : “GRANT REPLICATION SLAVE ON *.* TO ‘test_ddl’@‘%’”
}