Use Docker

    Using Docker to start ShardingSphere-Proxy does not require additional package supoort.

    1. Acquire Docker Image
    • Method 1 (Recommended): Pull from DockerHub
    • Method 2: Acquire latest master branch image master:

    1. mvn clean install
    2. cd shardingsphere-distribution/shardingsphere-proxy-distribution
    3. mvn clean package -Prelease,docker

    If the following problems emerge, please make sure Docker daemon Process is running.

    1. Configure conf/server.yaml and conf/config-*.yaml
    1. docker cp tmp:/opt/shardingsphere-proxy/conf /host/path/to/conf

    Since the network conditions inside the container may differ from those of the host, if errors such as “cannot connect to the database” occurs, please make sure that the IP of the database specified in the conf/config-*.yaml configuration file can be accessed from inside the Docker container.

    For details, please refer to ShardingSphere-Proxy quick start manual - binary distribution packages.

    1. (Optional) Introduce third-party dependencies or customized algorithms

    If you have any of the following requirements:

    • ShardingSphere-Proxy Backend use MySQL Database;
    • Implement customized algorithms;
    • Use Etcd as Registry Center in cluster mode.

    Please create ext-lib directory anywhere inside the host and refer to the steps in .

    1. Start ShardingSphere-Proxy container

    ext-lib is not necessary during the process. Users can mount it at will. ShardingSphere-Proxy default portal 3307 can be designated according to environment variable -e PORT Customized JVM related parameters can be set according to environment variable JVM_OPTS

    Note:

    Support setting environment variable CGROUP_ MEM_ OPTS: used to set related memory parameters in the container environment. The default values in the script are:

    1. -XX:InitialRAMPercentage=80.0 -XX:MaxRAMPercentage=80.0 -XX:MinRAMPercentage=80.0
    1. Use Client to connect to ShardingSphere-Proxy

    Please refer to ShardingSphere-Proxy quick start manual - binary distribution packages.