Sen descrición

config-readwrite-splitting.yaml 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. ######################################################################################################
  18. #
  19. # Here you can configure the rules for the proxy.
  20. # This example is configuration of readwrite-splitting rule.
  21. #
  22. ######################################################################################################
  23. #
  24. #databaseName: readwrite_splitting_db
  25. #
  26. #dataSources:
  27. # primary_ds:
  28. # url: jdbc:postgresql://127.0.0.1:5432/demo_primary_ds
  29. # username: postgres
  30. # password: postgres
  31. # connectionTimeoutMilliseconds: 30000
  32. # idleTimeoutMilliseconds: 60000
  33. # maxLifetimeMilliseconds: 1800000
  34. # maxPoolSize: 50
  35. # minPoolSize: 1
  36. # replica_ds_0:
  37. # url: jdbc:postgresql://127.0.0.1:5432/demo_replica_ds_0
  38. # username: postgres
  39. # password: postgres
  40. # connectionTimeoutMilliseconds: 30000
  41. # idleTimeoutMilliseconds: 60000
  42. # maxLifetimeMilliseconds: 1800000
  43. # maxPoolSize: 50
  44. # minPoolSize: 1
  45. # replica_ds_1:
  46. # url: jdbc:postgresql://127.0.0.1:5432/demo_replica_ds_1
  47. # username: postgres
  48. # password: postgres
  49. # connectionTimeoutMilliseconds: 30000
  50. # idleTimeoutMilliseconds: 60000
  51. # maxLifetimeMilliseconds: 1800000
  52. # maxPoolSize: 50
  53. # minPoolSize: 1
  54. #
  55. #rules:
  56. #- !READWRITE_SPLITTING
  57. # dataSources:
  58. # readwrite_ds:
  59. # writeDataSourceName: primary_ds
  60. # readDataSourceNames:
  61. # - replica_ds_0
  62. # - replica_ds_1
  63. # loadBalancerName: random
  64. # loadBalancers:
  65. # random:
  66. # type: RANDOM
  67. ######################################################################################################
  68. #
  69. # If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
  70. #
  71. ######################################################################################################
  72. #databaseName: readwrite_splitting_db
  73. #
  74. #dataSources:
  75. # write_ds:
  76. # url: jdbc:mysql://127.0.0.1:3306/demo_write_ds?serverTimezone=UTC&useSSL=false
  77. # username: root
  78. # password:
  79. # connectionTimeoutMilliseconds: 30000
  80. # idleTimeoutMilliseconds: 60000
  81. # maxLifetimeMilliseconds: 1800000
  82. # maxPoolSize: 50
  83. # minPoolSize: 1
  84. # read_ds_0:
  85. # url: jdbc:mysql://127.0.0.1:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false
  86. # username: root
  87. # password:
  88. # connectionTimeoutMilliseconds: 30000
  89. # idleTimeoutMilliseconds: 60000
  90. # maxLifetimeMilliseconds: 1800000
  91. # maxPoolSize: 50
  92. # minPoolSize: 1
  93. # read_ds_1:
  94. # url: jdbc:mysql://127.0.0.1:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false
  95. # username: root
  96. # password:
  97. # connectionTimeoutMilliseconds: 30000
  98. # idleTimeoutMilliseconds: 60000
  99. # maxLifetimeMilliseconds: 1800000
  100. # maxPoolSize: 50
  101. # minPoolSize: 1
  102. #
  103. #rules:
  104. #- !READWRITE_SPLITTING
  105. # dataSources:
  106. # readwrite_ds:
  107. # writeDataSourceName: write_ds
  108. # readDataSourceNames:
  109. # - read_ds_0
  110. # - read_ds_1
  111. # loadBalancerName: random
  112. # loadBalancers:
  113. # random:
  114. # type: RANDOM