dtc.yaml 1.8 KB

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