Use Binary Tar
Start the Proxy with a binary package requires an environment with Java JRE 8 or later.
Obtain the binary release package of ShardingSphere-Proxy on the .
- Configure
ShardingSphere-Proxy’s operational mode is configured on server.yaml
, and its configuration mode is the same with that of ShardingSphere-JDBC. Refer to mode of configuration.
Please refer to the following links for other configuration items:
- Configure
conf/config-*.yaml
Modify files named with the prefix config-
in the conf
directory, such as file and configure sharding rules and read/write splitting rules. See for configuration methods. The *
part of the config-*.yaml
file can be named whatever you want.
If the backend is connected to a PostgreSQL or openGauss database, no additional dependencies need to be introduced.
If the backend is connected to a MySQL database, please download mysql-connector-java-5.1.47.jar or , and put it into the ext-lib
directory.
- Introduce dependencies required by the cluster mode (Optional)
ShardingSphere-Proxy integrates the ZooKeeper Curator client by default. ZooKeeper is used in cluster mode without introducing other dependencies.
If the cluster mode uses Etcd, the client drivers of Etcd jetcd-core 0.5.0 need to be copied into the directory.
- Introduce dependencies required by distributed transactions (Optional)
It is the same with ShardingSphere-JDBC. Please refer to for more details.
- Introduce custom algorithm (Optional)
- Start ShardingSphere-Proxy
In Linux or macOS, run bin/start.sh
. In Windows, run bin/start.bat
to start ShardingSphere-Proxy. The default listening port is 3307
and the default configuration directory is the conf
directory in Proxy. The startup script can specify the listening port and the configuration file directory by running the following command:
Run the MySQL/PostgreSQL/openGauss client command to directly operate ShardingSphere-Proxy.
Connect ShardingSphere-Proxy with MySQL client:
Connect ShardingSphere-Proxy with PostgreSQL:
Connect ShardingSphere-Proxy with openGauss client: