You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by to...@apache.org on 2022/06/07 05:51:46 UTC

[shardingsphere] branch master updated: Update documents about ShardingSphere-Proxy quick start (#18216)

This is an automated email from the ASF dual-hosted git repository.

totalo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new e89b3dc877b Update documents about ShardingSphere-Proxy quick start (#18216)
e89b3dc877b is described below

commit e89b3dc877bfe2bfe8711bd0835090edd22fcb7b
Author: 吴伟杰 <wu...@apache.org>
AuthorDate: Tue Jun 7 13:51:39 2022 +0800

    Update documents about ShardingSphere-Proxy quick start (#18216)
---
 .../shardingsphere-proxy-quick-start.cn.md         | 50 ++++++++++++++----
 .../shardingsphere-proxy-quick-start.en.md         | 60 ++++++++++++++++------
 2 files changed, 85 insertions(+), 25 deletions(-)

diff --git a/docs/document/content/quick-start/shardingsphere-proxy-quick-start.cn.md b/docs/document/content/quick-start/shardingsphere-proxy-quick-start.cn.md
index b84d2b67705..7bea62455fa 100644
--- a/docs/document/content/quick-start/shardingsphere-proxy-quick-start.cn.md
+++ b/docs/document/content/quick-start/shardingsphere-proxy-quick-start.cn.md
@@ -4,30 +4,49 @@ title = "ShardingSphere-Proxy"
 weight = 2
 +++
 
-## 获取 ShardingSphere-Proxy
+## 应用场景
+
+![shardingsphere-proxy](https://shardingsphere.apache.org/document/current/img/shardingsphere-proxy_v2.png)
+
+ShardingSphere-Proxy 的定位为透明化的数据库代理,理论上支持任何使用 MySQL、PostgreSQL、openGauss 协议的客户端操作数据,对异构语言、运维场景更友好。
+
+## 使用限制
+
+ShardingSphere-Proxy 对系统库/表(如 information_schema、pg_catalog)支持有限,通过部分图形化数据库客户端连接 Proxy 时,可能客户端或 Proxy 会有错误提示。可以使用命令行客户端(`mysql`、`psql`、`gsql` 等)连接 Proxy 验证功能。
+
+## 前提条件
+
+使用 Docker 启动 ShardingSphere-Proxy 无须额外依赖。
+使用二进制分发包启动 Proxy,需要环境具备 Java JRE 8 或更高版本。
+
+## 操作步骤
+
+1. 获取 ShardingSphere-Proxy
 
 目前 ShardingSphere-Proxy 可以通过以下方式:
 - [二进制发布包](/cn/user-manual/shardingsphere-proxy/startup/bin/)
 - [Docker](/cn/user-manual/shardingsphere-proxy/startup/docker/)
 - [Helm](/cn/user-manual/shardingsphere-proxy/startup/helm/)
 
-## 规则配置
-
-编辑 `%SHARDINGSPHERE_PROXY_HOME%/conf/config-xxx.yaml`。
+2. 规则配置
 
 编辑 `%SHARDINGSPHERE_PROXY_HOME%/conf/server.yaml`。
 
-> %SHARDINGSPHERE_PROXY_HOME% 为 Proxy 解压后的路径,例:/opt/shardingsphere-proxy-bin/
+编辑 `%SHARDINGSPHERE_PROXY_HOME%/conf/config-xxx.yaml`。
+
+> %SHARDINGSPHERE_PROXY_HOME% 为 Proxy 解压后的路径,例:`/opt/shardingsphere-proxy-bin/`
 
 详情请参见 [配置手册](/cn/user-manual/shardingsphere-proxy/yaml-config/)。
 
-## 引入依赖
+3. 引入依赖
 
 如果后端连接 PostgreSQL 数据库,不需要引入额外依赖。
 
 如果后端连接 MySQL 数据库,请下载 [mysql-connector-java-5.1.47.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar) 或者 [mysql-connector-java-8.0.11.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.11/mysql-connector-java-8.0.11.jar),并将其放入 `%SHARDINGSPHERE_PROXY_HOME%/ext-lib` 目录。
 
-## 启动服务
+如果后端连接 openGauss 数据库,请下载 [opengauss-jdbc-3.0.0.jar](https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/3.0.0/opengauss-jdbc-3.0.0.jar),并将其放入 `%SHARDINGSPHERE_PROXY_HOME%/ext-lib` 目录。
+
+4. 启动服务
 
 * 使用默认配置项
 
@@ -43,10 +62,21 @@ sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh
 sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh ${proxy_port} ${proxy_conf_directory}
 ```
 
-## 使用 ShardingSphere-Proxy
+5. 使用 ShardingSphere-Proxy
 
-执行 MySQL 或 PostgreSQL 的客户端命令直接操作 ShardingSphere-Proxy 即可。以 MySQL 举例:
+执行 MySQL / PostgreSQL / openGauss 的客户端命令直接操作 ShardingSphere-Proxy 即可。
 
+使用 MySQL 客户端连接 ShardingSphere-Proxy:
 ```bash
-mysql -u${proxy_username} -p${proxy_password} -h${proxy_host} -P${proxy_port}
+mysql -h${proxy_host} -P${proxy_port} -u${proxy_username} -p${proxy_password}
+```
+
+使用 PostgreSQL 客户端连接 ShardingSphere-Proxy:
+```bash 
+psql -h ${proxy_host} -p ${proxy_port} -U ${proxy_username}
+```
+
+使用 openGauss 客户端连接 ShardingSphere-Proxy:
+```bash 
+gsql -r -h ${proxy_host} -p ${proxy_port} -U ${proxy_username} -W ${proxy_password}
 ```
diff --git a/docs/document/content/quick-start/shardingsphere-proxy-quick-start.en.md b/docs/document/content/quick-start/shardingsphere-proxy-quick-start.en.md
index e128f2f3d37..977f6786399 100644
--- a/docs/document/content/quick-start/shardingsphere-proxy-quick-start.en.md
+++ b/docs/document/content/quick-start/shardingsphere-proxy-quick-start.en.md
@@ -4,49 +4,79 @@ title = "ShardingSphere-Proxy"
 weight = 2
 +++
 
-## Get ShardingSphere-Proxy
+## Scenarios
+
+![shardingsphere-proxy](https://shardingsphere.apache.org/document/current/img/shardingsphere-proxy_v2.png)
+
+ShardingSphere-Proxy is positioned as a transparent database proxy. It theoretically supports any client operation data using MySQL, PostgreSQL and openGauss protocols, and is friendly to heterogeneous languages and operation and maintenance scenarios.
+
+## Limitations
+
+Proxy provides limited support for system databases / tables (such as information_schema, pg_catalog). When connecting to Proxy through some graph database clients, the client or proxy may have an error prompt. You can use command-line clients (`mysql`, `psql`, `gsql`, etc.) to connect to the Proxy's authentication function.
+
+## Requirements
+
+Starting ShardingSphere-Proxy with Docker requires no additional dependency.
+To start the Proxy using binary distribution, the environment must have Java JRE 8 or higher.
+
+## Procedure
+
+1. Get ShardingSphere-Proxy.
 
 ShardingSphere-Proxy is available at:
 - [Binary Distribution](/en/user-manual/shardingsphere-proxy/startup/bin/)
 - [Docker](/en/user-manual/shardingsphere-proxy/startup/docker/)
 - [Helm](/en/user-manual/shardingsphere-proxy/startup/helm/)
 
-## Rule Configuration
-
-Edit `%SHARDINGSPHERE_PROXY_HOME%/conf/config-xxx.yaml`.
+2. Rule configuration.
 
 Edit `%SHARDINGSPHERE_PROXY_HOME%/conf/server.yaml`.
 
-> %SHARDINGSPHERE_PROXY_HOME% is the shardingsphere proxy extract path. for example: /opt/shardingsphere-proxy-bin/
+Edit `%SHARDINGSPHERE_PROXY_HOME%/conf/config-xxx.yaml`.
+
+> %SHARDINGSPHERE_PROXY_HOME% is the proxy extract path. for example: `/opt/shardingsphere-proxy-bin/`
 
 Please refer to [Configuration Manual](/en/user-manual/shardingsphere-proxy/yaml-config/) for more details.
 
-## Import Dependencies
+3. Import dependencies.
+
+If the backend database is PostgreSQL, no additional dependencies are required.
 
-If the backend database is PostgreSQL, there's no need for additional dependencies.
+If the backend database is MySQL, please download [mysql-connector-java-5.1.47.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar) or [mysql-connector-java-8.0.11.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.11/mysql-connector-java-8.0.11.jar) and put it into the `%SHARDINGSPHERE_PROXY_HOME%/ext-lib` directory.
 
-If the backend database is MySQL, please download [mysql-connector-java-5.1.47.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar) or [mysql-connector-java-8.0.11.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.11/mysql-connector-java-8.0.11.jar) and put it into `%SHARDINGSPHERE_PROXY_HOME%/ext-lib` directory.
+If the backend database is openGauss, please download [opengauss-jdbc-3.0.0.jar](https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/3.0.0/opengauss-jdbc-3.0.0.jar) and put it into the `%SHARDINGSPHERE_PROXY_HOME%/ext-lib` directory.
 
-## Start Server
+4. Start server.
 
-* Use default configuration to start
+* Use the default configuration to start
 
 ```bash
 sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh
 ```
 
-Default port is `3307`, default profile directory is `%SHARDINGSPHERE_PROXY_HOME%/conf/` .
+The default port is `3307`, while the default profile directory is `%SHARDINGSPHERE_PROXY_HOME%/conf/`.
 
 * Customize port and profile directory
 
 ```bash
-sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh ${port} ${proxy_conf_directory}
+sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh ${proxy_port} ${proxy_conf_directory}
 ```
 
-## Use ShardingSphere-Proxy
+5. Use ShardingSphere-Proxy.
 
-Use MySQL or PostgreSQL client to connect ShardingSphere-Proxy. For example with MySQL:
+Use MySQL or PostgreSQL or openGauss client to connect ShardingSphere-Proxy.
 
+Use the MySQL client to connect to the ShardingSphere-Proxy:
 ```bash
-mysql -u${proxy_username} -p${proxy_password} -h${proxy_host} -P${proxy_port}
+mysql -h${proxy_host} -P${proxy_port} -u${proxy_username} -p${proxy_password}
+```
+
+Use the PostgreSQL client to connect to the ShardingSphere-Proxy:
+```bash 
+psql -h ${proxy_host} -p ${proxy_port} -U ${proxy_username}
+```
+
+Use the openGauss client to connect to the ShardingSphere-Proxy:
+```bash 
+gsql -r -h ${proxy_host} -p ${proxy_port} -U ${proxy_username} -W ${proxy_password}
 ```