dtc.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # DTC configure file. v2
  3. #
  4. props:
  5. log.level: debug
  6. listener.port.dtc: 20015
  7. listener.port.extension: 2002
  8. shm.mem.size: 100 #MB
  9. data_lifecycle:
  10. single.query.count: 10
  11. lifecycle.tablename: 'data_lifecycle_table'
  12. rule.sql: 'uid = 0'
  13. rule.cron: '0 */1 * * * ?'
  14. connection: &connection
  15. addr: 127.0.0.1:3307
  16. user: username
  17. pwd: password
  18. primary:
  19. db: &db mydb
  20. table: &table name
  21. layered.rule: '(a>1 and a<3) or uid = 0'
  22. option.file.path: '../conf/my.conf'
  23. cache:
  24. field:
  25. - {name: &key uid, type: signed/unsigned/float/string/binary, size: 4}
  26. - {name: name, type: binary, size: 50, nullable: 1}
  27. - {name: city, type: string, size: 50, default: ""}
  28. - {name: sex, type: signed, size: 4, default: 0}
  29. - {name: age, type: signed, size: 4}
  30. hot:
  31. logic:
  32. {db: mydb_layer2, table: *table, connection: *connection}
  33. real:
  34. - {addr: mysql-01.local:3306, user: username, pwd: password, db: {prefix: &prefix [*db, _], start: 0, last: 10}}
  35. - {addr: mysql-02.local:3306, user: username, pwd: password, db: {prefix: *prefix, start: 11, last: 25}}
  36. - {addr: mysql-03.local:3306, user: username, pwd: password, db: {prefix: *prefix, start: 26, last: 29}}
  37. sharding:
  38. key: *key
  39. table: {prefix: [*table, _], start: 0, last: 9}
  40. full:
  41. logic:
  42. {db: mydb_layer3, table: *table, connection: *connection}
  43. real:
  44. - {addr: 127.0.0.1:3306, user: username, pwd: password, db: layer3}
  45. extension:
  46. - logic:
  47. {db: January, table: Monday, connection: *connection}
  48. real:
  49. - {addr: mysql-01.local:3306, user: username, pwd: password, db: January}
  50. - logic:
  51. {db: February, table: Tuesday, connection: *connection}
  52. real:
  53. - {addr: mysql-01.local:3306, user: username, pwd: password, db: February}