Proxy Startup
Startup Steps
- Download the latest version of ShardingSphere-Proxy.
- If users use docker, they can execute
docker pull shardingsphere/shardingsphere-proxy
to get the image. Please refer to Docker Image for more details. - After the decompression, revise
conf/server.yaml
and documents begin withconfig-
prefix,conf/config-xxx.yaml
for example, to configure sharding rules and readwrite-splitting rules. Please refer to Configuration Manual for the configuration method. - Please run
bin/start.sh
for Linux operating system; runbin/start.bat
for Windows operating system to start ShardingSphere-Proxy. To configure start port and document location, please refer to Quick Start.
Using PostgreSQL
- Use any PostgreSQL client end to connect, such as
psql -U root -h 127.0.0.1 -p 3307
.
Using MySQL/openGauss
- Copy MySQL/openGauss’s JDBC driver to folder
ext-lib/
. - Use any MySQL/openGauss client end to connect, such as
mysql -u root -h 127.0.0.1 -P 3307
orgsql
.
Using user-defined sharding algorithm
When developer need to use user-defined sharding algorithm, it can not configure via inline expression in YAML file simply, should use the way below to configure sharding algorithm.
- Implement
ShardingAlgorithm
interface. - Package Java file to jar.
- Copy jar to ShardingSphere-Proxy’s
ext-lib/
folder. - Configure user-defined Java class into YAML file. Please refer to Configuration Manual for more details.
Notices
- ShardingSphere-Proxy uses 3307 port in default. Users can start the script parameter as the start port number, like
bin/start.sh 3308
. - ShardingSphere-Proxy uses
conf/server.yaml
to configure the registry center, authentication information and public properties. - ShardingSphere-Proxy supports multi-logic data source, with each yaml configuration document named by
config-
prefix as a logic data source.
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .