dtc.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #hash.custom: yes/no/enable/disable
  10. #hash.custom.module: ../lib/key-hash.so
  11. #hash.custom.functon: StringHash(1.128)
  12. data_lifecycle:
  13. single.query.count: 10
  14. lifecycle.tablename: 'data_lifecycle_table'
  15. rule.sql: 'uid = 0'
  16. rule.cron: '0 */1 * * * ?'
  17. connection: &connection
  18. addr: 127.0.0.1:3307
  19. user: username
  20. pwd: password
  21. primary:
  22. db: &db mydb
  23. table: &table name
  24. layered.rule: '(a>1 and a<3) or uid = 0'
  25. option.file.path: '../conf/my.conf'
  26. cache:
  27. field:
  28. - {name: &key uid, type: signed/unsigned/float/string/binary, size: 4}
  29. - {name: name, type: binary, size: 50, nullable: 1}
  30. - {name: city, type: string, size: 50, default: ""}
  31. - {name: sex, type: signed, size: 4, default: 0}
  32. - {name: age, type: signed, size: 4}
  33. hot:
  34. logic:
  35. {db: mydb_layer2, table: *table, connection: *connection}
  36. real:
  37. - {addr: mysql-01.local:3306, user: username, pwd: password, db: {prefix: &prefix [*db, _], start: 0, last: 10}}
  38. - {addr: mysql-02.local:3306, user: username, pwd: password, db: {prefix: *prefix, start: 11, last: 25}}
  39. - {addr: mysql-03.local:3306, user: username, pwd: password, db: {prefix: *prefix, start: 26, last: 29}}
  40. sharding:
  41. key: *key
  42. table: {prefix: [*table, _], start: 0, last: 9}
  43. full:
  44. logic:
  45. {db: mydb_layer3, table: *table, connection: *connection}
  46. real:
  47. - {addr: 127.0.0.1:3306, user: username, pwd: password, db: layer3}
  48. extension:
  49. - logic:
  50. {db: January, table: Monday, connection: *connection}
  51. real:
  52. - {addr: mysql-01.local:3306, user: username, pwd: password, db: January}
  53. - logic:
  54. {db: February, table: Tuesday, connection: *connection}
  55. real:
  56. - {addr: mysql-01.local:3306, user: username, pwd: password, db: February}