liuxiaocs7 commented on issue #24874:
URL:
https://github.com/apache/shardingsphere/issues/24874#issuecomment-1486506701
Hi, @azexcy and @sandynz, thanks for your help!
I found my mistake, i modified `config-sharding.yaml` under
`apache-shardingsphere-5.3.1-shardingsphere-proxy-bin` rather than
`apache-shardingsphere-5.3.2-SNAPSHOT-shardingsphere-proxy-bin`.
After add these conf to `config-sharding.yaml` under
`apache-shardingsphere-5.3.2-SNAPSHOT-shardingsphere-proxy-bin`
```yaml
rules:
- !SHARDING
tables:
t_user:
actualDataNodes: ds_0.t_user
```
I can see output in console:
```shell
16:38:33.509 [nioEventLoopGroup-2-1] INFO
org.apache.shardingsphere.data.pipeline.cdc.client.handler.LoginRequestHandler
- Server greeting result, server version: 5.3.2-SNAPSHOT, protocol version: 1
16:38:33.557 [nioEventLoopGroup-2-1] INFO
org.apache.shardingsphere.data.pipeline.cdc.client.handler.LoginRequestHandler
- Login success, username root
16:38:43.986 [nioEventLoopGroup-2-1] INFO
org.apache.shardingsphere.data.pipeline.cdc.client.example.Bootstrap - records:
[before {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
before {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
after {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Int64Value"
value: "\b\002"
}
}
after {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.StringValue"
value: "\n\003bbb"
}
}
meta_data {
database: "sharding_db"
schema: ""
table: "t_user"
}
data_change_type: INSERT
, before {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
before {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
after {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Int64Value"
value: "\b\004"
}
}
after {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.StringValue"
value: "\n\004dddd"
}
}
meta_data {
database: "sharding_db"
schema: ""
table: "t_user"
}
data_change_type: INSERT
, before {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
before {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
after {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Int64Value"
value: "\b\003"
}
}
after {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.StringValue"
value: "\n\003ccc"
}
}
meta_data {
database: "sharding_db"
schema: ""
table: "t_user"
}
data_change_type: INSERT
, before {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
before {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
after {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Int64Value"
value: "\b\001"
}
}
after {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.StringValue"
value: "\n\003aaa"
}
}
meta_data {
database: "sharding_db"
schema: ""
table: "t_user"
}
data_change_type: INSERT
, before {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
before {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
after {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Int64Value"
value: "\b\005"
}
}
after {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.StringValue"
value: "\n\003eee"
}
}
meta_data {
database: "sharding_db"
schema: ""
table: "t_user"
}
data_change_type: INSERT
]
```

This matches the database initial information, and i try to add a new record:
```
mysql> insert into t_user(id, name) values(6, "ffffff");
Query OK, 1 row affected (0.01 sec)
```
```
16:43:07.107 [nioEventLoopGroup-2-1] INFO
org.apache.shardingsphere.data.pipeline.cdc.client.example.Bootstrap - records:
[before {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
before {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.Empty"
}
}
after {
name: "id"
value {
type_url: "type.googleapis.com/google.protobuf.Int32Value"
value: "\b\006"
}
}
after {
name: "name"
value {
type_url: "type.googleapis.com/google.protobuf.BytesValue"
value: "\n\006ffffff"
}
}
meta_data {
database: "sharding_db"
schema: ""
table: "t_user"
}
data_change_type: INSERT
]
```
Incremental changes can be seen.

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]