diff --git a/site/src/site/sphinx/_static/tunnel-server-agents.png b/site/src/site/sphinx/_static/tunnel-server-agents.png new file mode 100644 index 000000000..c786e2a52 Binary files /dev/null and b/site/src/site/sphinx/_static/tunnel-server-agents.png differ diff --git a/site/src/site/sphinx/_static/tunnel-server-apps.png b/site/src/site/sphinx/_static/tunnel-server-apps.png new file mode 100644 index 000000000..67c116d6f Binary files /dev/null and b/site/src/site/sphinx/_static/tunnel-server-apps.png differ diff --git a/site/src/site/sphinx/en/tunnel.md b/site/src/site/sphinx/en/tunnel.md index 3318cea7b..b5807ea3e 100644 --- a/site/src/site/sphinx/en/tunnel.md +++ b/site/src/site/sphinx/en/tunnel.md @@ -101,11 +101,54 @@ Tunnel server will use `_` as a delimiter to extract `appName`, which is conveni > Alternatively, you can configure `appName` in `arthas.properties` in the unzipped arthas directory, or in `application.properties` of the spring boot application. +### Tunnel Server Management Page + +Start the tunnel-server locally, then use `as.sh` attach, and specify the application name `--app-name test`: + + +``` +$ as.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name test +telnet connecting to arthas server... current timestamp is 1627539688 +Trying 127.0.0.1... +Connected to 127.0.0.1. +Escape character is '^]'. + ,---. ,------. ,--------.,--. ,--. ,---. ,---. + / O \ | .--. ''--. .--'| '--' | / O \ ' .-' +| .-. || '--'.' | | | .--. || .-. |`. `-. +| | | || |\ \ | | | | | || | | |.-' | +`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' + + +wiki https://arthas.aliyun.com/doc +tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html +version 3.5.3 +main_class demo.MathGame +pid 65825 +time 2021-07-29 14:21:29 +id test_PE3LZO9NA9ENJYTPGL9L +``` + +Then visit tunnel-server, you can see a list of all connected applications: + +[http://localhost:8080/apps.html](http://localhost:8080/apps.html) + +![](_static/tunnel-server-apps.png) + +Then open the details, you can see a list of all connected agents: + +[http://localhost:8080/agents.html?app=test](http://localhost:8080/agents.html?app=test) + +![](_static/tunnel-server-agents.png) + + +### Authority Management + +At present, the tunnel server does not have special authority management. Users need to develop their own and authenticate the app name. ### Cluster Management If you want to deploy multiple tunnel servers, you can use nginx for forwarding and redis to store agent information. - +Nginx needs to configure sticky session to ensure that the user's web socket is connected to the same back-end tunnel server. The simple configuration method is to use `ip_hash`. ### How arthas tunnel server works ``` diff --git a/site/src/site/sphinx/tunnel.md b/site/src/site/sphinx/tunnel.md index b34f5d258..133b9971a 100644 --- a/site/src/site/sphinx/tunnel.md +++ b/site/src/site/sphinx/tunnel.md @@ -104,11 +104,53 @@ Tunnel server会以`_`做分隔符,提取出`appName`,方便按应用进行 > 另外,也可以在解压的arthas目录下的 `arthas.properties`,或者在spring boot应用的`application.properties`里配置`appName`。 +### Tunnel Server的管理页面 +在本地启动tunnel-server,然后使用`as.sh` attach,并且指定应用名`--app-name test`: + +``` +$ as.sh --tunnel-server 'ws://127.0.0.1:7777/ws' --app-name test +telnet connecting to arthas server... current timestamp is 1627539688 +Trying 127.0.0.1... +Connected to 127.0.0.1. +Escape character is '^]'. + ,---. ,------. ,--------.,--. ,--. ,---. ,---. + / O \ | .--. ''--. .--'| '--' | / O \ ' .-' +| .-. || '--'.' | | | .--. || .-. |`. `-. +| | | || |\ \ | | | | | || | | |.-' | +`--' `--'`--' '--' `--' `--' `--'`--' `--'`-----' + + +wiki https://arthas.aliyun.com/doc +tutorials https://arthas.aliyun.com/doc/arthas-tutorials.html +version 3.5.3 +main_class demo.MathGame +pid 65825 +time 2021-07-29 14:21:29 +id test_PE3LZO9NA9ENJYTPGL9L +``` + +然后访问 tunnel-server,可以看到所有连接的应用列表: + +[http://localhost:8080/apps.html](http://localhost:8080/apps.html) + +![](_static/tunnel-server-apps.png) + +再打开详情,则可以看到连接的所有agent列表: + +[http://localhost:8080/agents.html?app=test](http://localhost:8080/agents.html?app=test) + +![](_static/tunnel-server-agents.png) + + +### 权限管理 + +目前tunnel server没有专门的权限管理,用户需要自行开发,对app name鉴权。 ### 集群方式管理 如果希望部署多台 tunnel server,可以通过nginx做转发,redis来保存agent信息。 +* nginx需要配置sticky session,保证用户web socket连接到同一个后端tunnel server上。简单的配置方式是用`ip_hash`。 ### Arthas tunnel server的工作原理