DBPlusEngine-Proxy #
Application Scenarios #
DBPlusEngine-Proxy is positioned as a transparent database proxy. Any client that uses MySQL, PostgreSQL, and openGauss protocols are supported to operate data, which is more friendly to heterogeneous languages and operation & maintenance scenarios.
Limitations #
DBPlusEngine-Proxy has limited support for system databases or tables (such as information_schema
and pg_catalog
).
When connecting to Proxy through graphical database clients, an error may be displayed in the clients or Proxy. You can use command-line clients (such as mysql
, psql
, and gsql
) to connect to the Proxy authentication function.
Prerequisite #
Additional dependencies are not required when using Docker to start DBPlusEngine-Proxy. When it comes to using binary distribution, Java JRE 8 or later versions are required for the environment.
Procedure #
- Get DBPlusEngine-Proxy
Currently, DBPlusEngine-Proxy can be obtained through the following methods:
- Rules Configuration
Edit %SHARDINGSPHERE_PROXY_HOME%/conf/server.yaml
.
Edit %SHARDINGSPHERE_PROXY_HOME%/conf/config-xxx.yaml
.
%SHARDINGSPHERE_PROXY_HOME% is the path after the Proxy is decompressed. For example,
/opt/shardingsphere-proxy-bin/
Please refer to the Configuration Manual for more details.
- Import Dependencies
If the backend database is PostgreSQL or Oracle, there’s no need for additional dependencies.
If the backend database is MySQL, please download: mysql-connector-java-5.1.47.jar or mysql-connector-java-8.0.11.jar, and put it into the %SHARDINGSPHERE_PROXY_HOME%/ext-lib
directory.
- Start the server
- Use default configuration items.
sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh
The default port is 3307
, and the default configuration file directory is
%SHARDINGSPHERE_PROXY_HOME%/conf/
.
- Customize port and configure file directory.
sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh ${proxy_port} ${proxy_conf_directory}
- Mandatory Startup.
sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh -f
-f
parameter is used to forcibly enable Proxy and it will ignore abnormal data sources during startup. Users can remove abnormal data sources through DistSQL after the Proxy is started.
- Use DBPlusEngine-Proxy
Execute MySQL, PostgreSQL, or openGauss client command to run DBPlusEngine-Proxy.
mysql -h${proxy_host} -P${proxy_port} -u${proxy_username} -p${proxy_password}
Use PostgreSQL client to connect to DBPlusEngine-Proxy:
psql -h ${proxy_host} -p ${proxy_port} -U ${proxy_username}
Use openGauss client to connect to DBPlusEngine-Proxy:
gsql -r -h ${proxy_host} -p ${proxy_port} -U ${proxy_username} -W ${proxy_password}