You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/07/26 02:12:01 UTC

[shardingsphere] branch master updated: Add : add the remote debug docker conainter document (#19538)

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

panjuan 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 a5b59ad95ea Add : add the remote debug docker conainter document (#19538)
a5b59ad95ea is described below

commit a5b59ad95ea0c6d6092c7354f7303dbdba69af7c
Author: 孙念君 Nianjun Sun <su...@sphere-ex.com>
AuthorDate: Tue Jul 26 10:11:54 2022 +0800

    Add : add the remote debug docker conainter document (#19538)
---
 .../content/test-manual/integration-test/_index.cn.md   | 17 +++++++++++++++++
 .../content/test-manual/integration-test/_index.en.md   | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/docs/document/content/test-manual/integration-test/_index.cn.md b/docs/document/content/test-manual/integration-test/_index.cn.md
index 67b9f9ecd7b..7f7eae2734d 100644
--- a/docs/document/content/test-manual/integration-test/_index.cn.md
+++ b/docs/document/content/test-manual/integration-test/_index.cn.md
@@ -165,6 +165,23 @@ it.cluster.databases=H2,MySQL,Oracle,SQLServer,PostgreSQL
 ./mvnw -B clean install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Pit.env.docker -Dit.cluster.adapters=proxy,jdbc -Dit.scenarios=${scenario_name_1,scenario_name_1,scenario_name_n} -Dit.cluster.databases=MySQL
 ```
 
+#### 远程 debug Docker 容器中的 Proxy 代码
+
+```shell
+docker run -itd -p 3307:3307 -p 3308:3308 -v ${PWD}:/opt/shardingsphere-proxy/conf/ apache/shardingsphere-proxy-test:latest
+```
+运行以上命令可以启动测试镜像并暴露 proxy 与 proxy 远程 debug 的端口,使用 IDEA 等 IDE 工具可以通过如下方式连接并 debug 容器中的 Proxy 代码:
+
+IDEA -> Run -> Edit Configurations -> Add New Configuration -> Remote JVM Debug
+
+编辑对应的信息:
+Name : 一个描述性的名字,例如 docker-debug
+Host : 可以访问 docker 的 IP,例如本机启动的 Docker 127.0.0.1
+Port : 调试端口 3308
+use module classpath : 项目根目录 shardingsphere
+
+编辑好上面的信息后,Run -> Run -> docker-debug 即可启动 IDEA 的远程 debug。
+
 #### 注意事项
 
 1. 如需测试 Oracle,请在 pom.xml 中增加 Oracle 驱动依赖;
diff --git a/docs/document/content/test-manual/integration-test/_index.en.md b/docs/document/content/test-manual/integration-test/_index.en.md
index a81bdc51fb5..465c56d8e61 100644
--- a/docs/document/content/test-manual/integration-test/_index.en.md
+++ b/docs/document/content/test-manual/integration-test/_index.en.md
@@ -140,6 +140,23 @@ Use the following command to skip the image building and run the integration tes
 ./mvnw -B clean install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Pit.env.docker -Dit.cluster.adapters=proxy,jdbc -Dit.scenarios=${scenario_name_1,scenario_name_1,scenario_name_n} -Dit.cluster.databases=MySQL
 ```
 
+#### debug the Proxy inside docker container
+
+```shell
+docker run -itd -p 3307:3307 -p 3308:3308 -v ${PWD}:/opt/shardingsphere-proxy/conf/ apache/shardingsphere-proxy-test:latest
+```
+execute the upon command will expose Proxy port and Proxy debug port, use IDE like IDEA could connect and debug the Proxy in container by following steps:
+
+IDEA -> Run -> Edit Configurations -> Add New Configuration -> Remote JVM Debug
+
+Edit the corresponding info:
+Name : a name for this, like docker-debug
+Host : the IP could access container, like 127.0.0.1
+Port : the debug port 3308
+use module classpath : project root directory shardingsphere
+
+after edit and save the upon info,Run -> Run -> docker-debug will start the remote debug to the Proxy inside docker container.
+
 ## Notice
 
 1. If Oracle needs to be tested, please add Oracle driver dependencies to the pom.xml.