Project: ShardingSphere (App Definition and Development / Database)
File: bin.en.md

+++ title = "Use Binary Tar" weight = 1 +++ This section describes how to start ShardingSphere-Proxy by binary release packages Start the Proxy with a binary package requires an environment with Java JRE 8 or later. Obtain the binary release package of ShardingSphere-Proxy Obtain the binary release package of ShardingSphere-Proxy on the . Configure `conf/global.yaml` ShardingSphere-Proxy's operational mode is configured on `global.yaml`, and its configuration mode is the same with that of ShardingSphere-JDBC. Refer to . Please refer to the following links for other configuration items: Configure `conf/database-*.yaml` Modify files named with the prefix `database-` in the `conf` directory, such as `conf/database-sharding.yaml` file and configure sharding rules and read/write splitting rules. See for configuration methods. The `` part of the `database-.yaml` file can be named whatever you want. ShardingSphere-Proxy supports multiple logical data sources. Each YAML configuration file named with the prefix `database-` is a logical data source. Introduce database driver (Optional) 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 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, please copy and that Etcd depends on into the `ext-lib` 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) If you need to use a user-defined algorithm class, you can configure custom algorithm in the following ways: Implement the algorithm implementation class defined by `ShardingAlgorithm`. Create a `META-INF/services` directory under the project `resources` directory. Create file `org.apache.shardingsphere.sharding.spi.ShardingAlgorithm` under the directory `META-INF/services`. Writes the fully qualified class name of the implementation class to a file `org.apache.shardingsphere.sharding.spi.ShardingAlgorithm` Package the above Java files into jar packages. Copy the above jar package to the `ext-lib` directory. Configure the Java file reference of the above custom algorithm implementation class in a YAML file, see for more details. 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: ```bash bin/start.sh [port] [/path/to/conf] ``` Connect ShardingSphere-Proxy with client Run the MySQL/PostgreSQL/openGauss client command to directly operate ShardingSphere-Proxy. Connect ShardingSphere-Proxy with MySQL client: ```bash mysql -h${proxyhost} -P${proxyport} -u${proxyusername} -p${proxypassword} ``` Connect ShardingSphere-Proxy with PostgreSQL: ```bash psql -h ${proxyhost} -p ${proxyport} -U ${proxy_username} ``` Connect ShardingSphere-Proxy with openGauss client: ```bash gsql -r -h ${proxyhost} -p ${proxyport} -U ${proxyusername} -W ${proxypassword} ```