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
   ]
   ```
   
   
![image](https://user-images.githubusercontent.com/42756849/228189415-67283f28-fa7c-42ac-8c7d-1a28993fee41.png)
   
   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.
   
   
![image](https://user-images.githubusercontent.com/42756849/228190487-980dad89-1ac4-4c2b-8bf7-ff71074263eb.png)
   
   


-- 
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]

Reply via email to