dtc.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #
  2. # DTC configure file. v2
  3. #
  4. props:
  5. log.level: debug
  6. listener.port.agent: 12001
  7. listener.port.dtc: 20015
  8. listener.port.extension: 3745
  9. shm.mem.size: 100 #MB
  10. #hash.custom: yes/no/enable/disable
  11. #hash.custom.module: ../lib/key-hash.so
  12. #hash.custom.functon: StringHash(1.128)
  13. data_lifecycle:
  14. single.query.count: 10
  15. lifecycle.tablename: 'data_lifecycle_table'
  16. rule.sql: 'status = 0'
  17. rule.cron: '00 01 * * * ?'
  18. connection: &connection
  19. addr: 127.0.0.1:3306
  20. user: username
  21. pwd: password
  22. primary:
  23. table: &table name
  24. layered.rule: '(a>1 and a<3) or uid = 0'
  25. cache:
  26. field:
  27. - {name: &key uid, type: signed/unsigned/float/string/binary, size: 4}
  28. - {name: name, type: binary, size: 50}
  29. - {name: city, type: string, size: 50}
  30. - {name: sex, type: signed, size: 4}
  31. - {name: age, type: signed, size: 4}
  32. hot:
  33. logic:
  34. {db: &db L2, 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: L3, table: *table, connection: *connection}
  45. real:
  46. - {addr: 127.0.0.1:3306, user: username, pwd: password, db: L3}
  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}