dtc.dbaddition.ext.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # DTC configure file. v2
  3. # Cache with Datasource Test cases.
  4. # Scene 2: Single DB Sharding Table
  5. # table name: opensource_0 ... opensource_9
  6. # total: 10 tables.
  7. #
  8. props:
  9. log.level: debug
  10. listener.port.dtc: 20015
  11. shm.mem.size: 100 #MB
  12. connector.procs: 1
  13. connection: &connection
  14. addr: 127.0.0.1:3307
  15. user: username
  16. pwd: password
  17. primary:
  18. db: &db dtc
  19. table: &table opensource
  20. cache:
  21. field:
  22. - {name: &key uid, type: signed, size: 4}
  23. - {name: name, type: string, size: 50}
  24. - {name: city, type: string, size: 50}
  25. - {name: sex, type: signed, size: 4}
  26. - {name: age, type: signed, size: 4}
  27. hot:
  28. logic:
  29. {db: *db, table: *table, connection: *connection}
  30. real:
  31. - {addr: mysql:3306, user: root, pwd: 123456, db: layer2}
  32. sharding:
  33. key: *key
  34. table: {prefix: [*table, _], start: 0, last: 9}
  35. extension:
  36. - logic:
  37. {db: ext1, table: monday, connection: *connection}
  38. real:
  39. - {addr: mysql:3306, user: root, pwd: 123456, db: january}
  40. - logic:
  41. {db: ext2, table: tuesday, connection: *connection}
  42. real:
  43. - {addr: mysql:3306, user: root, pwd: 123456, db: weekdays}
  44. - logic:
  45. {db: ext2, table: &sunday sunday, connection: *connection}
  46. real:
  47. - {addr: mysql:3306, user: root, pwd: 123456, db: weekdays}
  48. sharding:
  49. key: day
  50. table: {prefix: [*sunday, _], start: 0, last: 2}