Skip to content

Commit

Permalink
Ehance remote debug docs (apache#28622)
Browse files Browse the repository at this point in the history
* Refactor : refactor the document

* Refactor : refactor the document
  • Loading branch information
taojintianxia authored Oct 6, 2023
1 parent 037432d commit 19ad0c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ IDEA -> Run -> Edit Configurations -> Add New Configuration -> Remote JVM Debug
编辑对应的信息:
- Name:一个描述性的名字,例如 e2e-debug。
- Host:可以访问 docker 的 IP,例如 127.0.0.1。
- Port:调试端口 3308
- Port:调试端口(需要在下一步中设置)
- use module classpath:项目根目录 shardingsphere。

编辑好上面的信息后,在 IDEA 中 Run -> Run -> e2e-debug 即可启动 IDEA 的远程 debug。
Expand All @@ -187,9 +187,9 @@ IDEA -> Run -> Edit Configurations -> Add New Configuration -> Remote JVM Debug
可以通过如下方式 debug Testcontainer 启动的 Proxy 容器:
- 在 Testcontainer 的相关启动类后打一个断点,例如 sql 测试中 E2EIT#setUp() -> `containerComposer.start();` 后面的一行打断点,此时相关容器一定已经启动。
- 通过快捷键 Alt + F8,进入断点调试模式,查看 containerComposer 下的 Proxy 对象 3308 映射的端口(Testcontainer 对外映射端口是随机的)。例如本次通过该表达式:`((ShardingSphereProxyClusterContainer)((java.util.LinkedList)((ITContainers)((ClusterContainerComposer)containerComposer).containers).dockerContainers).getLast()).getMappedPort(3308)` 获取到映射的对外随机端口为 51837。(或者通过命令 `docker ps` 查看)
- 参考 `远程调试通过镜像启动的 Proxy` 中的方式,Port 设置为上一步中获取到的端口。
- 参考 `远程调试通过镜像启动的 Proxy` 中的方式,将 Remote JVM Debug 配置中的 Port 设置为上一步中获取到的端口,例如 51837

编辑好上面的信息后,在 IDEA 中 Run -> Run -> e2e-debug 即可启动 IDEA 的远程 debug。
编辑好上面的信息后,在 IDEA 中 Run -> Run -> e2e-debug -> debug 即可启动 IDEA 的远程 debug。


#### 注意事项
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ IDEA -> Run -> Edit Configurations -> Add New Configuration -> Remote JVM Debug
Edit the corresponding information:
- Name: A descriptive name, such as e2e-debug.
- Host: A IP that can access docker, such as 127.0.0.1
- Port: debugging port 3308.
- Port: debugging port(will set in next step).
- use module classpath: The root directory of the project shardingsphere.

After editing the above information, run Run -> Run -> e2e-debug in IDEA to start the remote debug of IDEA.
Expand All @@ -187,9 +187,9 @@ After editing the above information, run Run -> Run -> e2e-debug in IDEA to star
Debug Testcontainer started Proxy container by the following method:
- Set a breakpoint in the relevant startup class of Testcontainer, for example, after the line `containerComposer.start();` in BaseE2EIT#setUp() in the suite test, at this time, the relevant containers must have been started.
- Access breakpoint debugging mode through shortcut key Alt + F8, and view the port mapped by the 3308 mapping of the Proxy object under the containerComposer (the external mapping port of Testcontainer is random). For example, the expression `((ShardingSphereProxyClusterContainer)((java.util.LinkedList)((ITContainers)((ClusterContainerComposer)containerComposer).containers).dockerContainers).getLast()).getMappedPort(3308)` get the mapped random port 51837.(or get mapped port by `docker ps`)
- See the `Remote debug Proxy started by docker image` method, set the Name, Host, Port, and use the port got in previous step.
- See the `Remote debug Proxy started by docker image` method, set the Name, Host, Port, and use the port got in previous step, e.g. 51837.

After editing the above information, run Run -> Run -> e2e-debug in IDEA to start the remote debug of IDEA.
After editing the above information, run Run -> Run -> e2e-debug -> debug in IDEA to start the remote debug of IDEA.

#### Notice

Expand Down

0 comments on commit 19ad0c4

Please sign in to comment.