Use Binary Tar #
Startup Steps #
- Download the latest version of ShardingSphere-Proxy.
- 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 database protocol #
Using PostgreSQL #
- Use any PostgreSQL terminal to connect, such as
psql -U root -h 127.0.0.1 -p 3307
.
Using MySQL #
- Copy MySQL’s JDBC driver to folder
ext-lib/
. - Use any MySQL terminal to connect, such as
mysql -u root -h 127.0.0.1 -P 3307
.
Using openGauss #
- Copy openGauss’s JDBC driver whose package prefixed with
org.opengauss
to folderext-lib/
. - Use any openGauss terminal to connect, such as
gsql -U root -h 127.0.0.1 -p 3307
.
Using metadata persist repository #
Using ZooKeeper #
Integrated ZooKeeper Curator client by default.
Using Etcd #
- Copy Etcd’s client driver to folder
ext-lib/
.
Using Distributed Transaction #
Same with ShardingSphere-JDBC. please refer to Distributed Transaction for more details.
Using user-defined algorithm #
When developer need to use user-defined algorithm, should use the way below to configure algorithm, use sharding algorithm as example.
- Implement
ShardingAlgorithm
interface. - Create
META-INF/services
directory in theresources
directory. - Create a new file
org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
in theMETA-INF/services
directory. - Absolute path of the implementation class are write to the file
org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
- 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 #
- DBPlusEngine-Proxy uses
3307
port in default. Users can start the script parameter as the start port number, likebin/start.sh 3308
. - DBPlusEngine-Proxy uses
conf/server.yaml
to configure the registry center, authentication information and public properties. - DBPlusEngine-Proxy supports multi-logic data sources, with each yaml configuration document named by
config-
prefix as a logic data source. - DBPlusEngine-Proxy uses 0.0.0.0 as default listening address. Users can specify the listening address through the startup script, like
bin/start.sh --help
.