terraform/amazon/modules/shardingsphere/cloud-init.yml [23:117]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
write_files:
- path: /run/shardingsphere-proxy.service
  permissions: 0644
  content: |
    [Unit]
    Description=ShardingSphere Proxy Service
    Requires=network.target
    After=network.target
    [Service]
    Type=forking
    LimitNOFILE=65536
    ExecStart=/usr/local/shardingsphere-proxy/bin/start.sh
    ExecStop=/usr/local/shardingsphere-proxy/bin/stop.sh
    Restart=always
    RestartSec=3
    StartLimitInterval=0
    [Install]
    WantedBy=default.target

%{ if element(version_elems, 0) <= 5 && element(version_elems, 1) < 3 }
- path: /run/server.yaml
  permissions: 0644
  content: |
    mode:
      type: Cluster
      repository:
        type: ZooKeeper
        props:
          namespace: governance_ds
          server-lists: ${zk_servers}
          retryIntervalMilliseconds: 500
          timeToLiveSeconds: 60
          maxRetries: 3
          operationTimeoutMilliseconds: 500
    rules:
    - !AUTHORITY
      users:
        - root@%:root
        - sharding@:sharding
      provider:
        type: ALL_PERMITTED
    - !TRANSACTION
      defaultType: XA
      providerType: Atomikos
    - !SQL_PARSER
      sqlCommentParseEnabled: true
      sqlStatementCache:
        initialCapacity: 2000
        maximumSize: 65535
      parseTreeCache:
        initialCapacity: 128
        maximumSize: 1024
    props:
      max-connections-size-per-query: 1
      kernel-executor-size: 16  # Infinite by default.
      proxy-frontend-flush-threshold: 128  # The default value is 128.
      proxy-hint-enabled: false
      sql-show: false
      check-table-metadata-enabled: false
      # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
      # The default value is -1, which means set the minimum value for different JDBC drivers.
      proxy-backend-query-fetch-size: -1
      proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
      # Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution
      # and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL.
      proxy-backend-executor-suitable: OLAP
      proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
      # Available sql federation type: NONE (default), ORIGINAL, ADVANCED
      sql-federation-type: NONE
      # Available proxy backend driver type: JDBC (default), ExperimentalVertx
      proxy-backend-driver-type: JDBC
      proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the default version will be used.
      proxy-default-port: 3307 # Proxy default port.
      proxy-netty-backlog: 1024 # Proxy netty backlog.
%{ endif }
%{ if element(version_elems, 0) >= 5 && element(version_elems, 1) > 2 }
- path: /run/server.yaml
  permissions: 0644
  content: |
    mode:
      type: Cluster
      repository:
        type: ZooKeeper
        props:
          namespace: governance_ds
          server-lists: ${zk_servers}
          retryIntervalMilliseconds: 500
          timeToLiveSeconds: 60
          maxRetries: 3
          operationTimeoutMilliseconds: 500
%{ endif }
- path: /run/install_shardingsphere_proxy.sh
  permissions: 0700
  content: |
    echo Installing ShardingSphere v${version}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



terraform/huawei/cloud-init.yml [23:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
write_files:
- path: /run/shardingsphere-proxy.service
  permissions: 0644
  content: |
    [Unit]
    Description=ShardingSphere Proxy Service
    Requires=network.target
    After=network.target
    [Service]
    Type=forking
    LimitNOFILE=65536
    ExecStart=/usr/local/shardingsphere-proxy/bin/start.sh
    ExecStop=/usr/local/shardingsphere-proxy/bin/stop.sh
    Restart=always
    RestartSec=3
    StartLimitInterval=0
    [Install]
    WantedBy=default.target

%{ if element(version_elems, 0) <= 5 && element(version_elems, 1) < 3 }
- path: /run/server.yaml
  permissions: 0644
  content: |
    mode:
      type: Cluster
      repository:
        type: ZooKeeper
        props:
          namespace: governance_ds
          server-lists: ${zk_servers}
          retryIntervalMilliseconds: 500
          timeToLiveSeconds: 60
          maxRetries: 3
          operationTimeoutMilliseconds: 500
    rules:
    - !AUTHORITY
      users:
        - root@%:root
        - sharding@:sharding
      provider:
        type: ALL_PERMITTED
    - !TRANSACTION
      defaultType: XA
      providerType: Atomikos
    - !SQL_PARSER
      sqlCommentParseEnabled: true
      sqlStatementCache:
        initialCapacity: 2000
        maximumSize: 65535
      parseTreeCache:
        initialCapacity: 128
        maximumSize: 1024
    props:
      max-connections-size-per-query: 1
      kernel-executor-size: 16  # Infinite by default.
      proxy-frontend-flush-threshold: 128  # The default value is 128.
      proxy-hint-enabled: false
      sql-show: false
      check-table-metadata-enabled: false
      # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
      # The default value is -1, which means set the minimum value for different JDBC drivers.
      proxy-backend-query-fetch-size: -1
      proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
      # Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution
      # and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL.
      proxy-backend-executor-suitable: OLAP
      proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
      # Available sql federation type: NONE (default), ORIGINAL, ADVANCED
      sql-federation-type: NONE
      # Available proxy backend driver type: JDBC (default), ExperimentalVertx
      proxy-backend-driver-type: JDBC
      proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the default version will be used.
      proxy-default-port: 3307 # Proxy default port.
      proxy-netty-backlog: 1024 # Proxy netty backlog.
%{ endif }
%{ if element(version_elems, 0) >= 5 && element(version_elems, 1) > 2 }
- path: /run/server.yaml
  permissions: 0644
  content: |
    mode:
      type: Cluster
      repository:
        type: ZooKeeper
        props:
          namespace: governance_ds
          server-lists: ${zk_servers}
          retryIntervalMilliseconds: 500
          timeToLiveSeconds: 60
          maxRetries: 3
          operationTimeoutMilliseconds: 500
%{ endif }
- path: /run/install_shardingsphere_proxy.sh
  permissions: 0700
  content: |
    #!/bin/bash
    echo Installing ShardingSphere v${version}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



