代理 server 配置

  • conf/server.yaml 配置文件
  • Sharding-Proxy 使用 conf/server.yaml 配置注册中心、认证信息以及公用属性

一. 配置模板

  1. # 数据治理
  2. orchestration:
  3. # 数据治理实例名称
  4. name: orchestration_ds
  5. # 本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准
  6. overwrite: true
  7. # 注册中心配置
  8. registry:
  9. # 连接注册中心服务器的列表。包括IP地址和端口号。多个地址用逗号分隔。如: host1:2181,host2:2181
  10. serverLists: localhost:2181
  11. # 注册中心的命名空间
  12. namespace: orchestration
  13. # 其他属性
  14. digest: #连接注册中心的权限令牌。缺省为不需要权限验证
  15. operationTimeoutMilliseconds: #操作超时的毫秒数,默认500毫秒
  16. maxRetries: #连接失败后的最大重试次数,默认3次
  17. retryIntervalMilliseconds: #重试间隔毫秒数,默认500毫秒
  18. timeToLiveSeconds: #临时节点存活秒数,默认60秒
  19. # 权限验证
  20. authentication:
  21. username: root
  22. password: root
  23. # 公用属性
  24. props:
  25. # 每个查询的最大连接大小
  26. max.connections.size.per.query: 1
  27. # 用于设置接收客户端请求的工作线程个数,默认为CPU核数*2
  28. acceptor.size: 16
  29. # 工作线程数量,默认值: CPU核数
  30. executor.size: 16
  31. # 是否开启事务, 目前仅支持XA事务,默认为不开启
  32. proxy.transaction.enabled: false
  33. # 是否开启链路追踪功能,默认为不开启。详情请参见[链路追踪]
  34. proxy.opentracing.enabled: false
  35. # 打印 sql
  36. sql.show: true

二. 配置案例

  1. authentication:
  2. username: root
  3. password:
  4. props:
  5. max.connections.size.per.query: 1
  6. acceptor.size: 16 # The default value is available processors count * 2.
  7. executor.size: 16 # Infinite by default.
  8. proxy.transaction.enabled: true
  9. proxy.opentracing.enabled: false
  10. sql.show: true