Skip to content

Commit

Permalink
[Doc] Add ws doc (#3882)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyan1998 authored Oct 20, 2024
1 parent 31bfa91 commit 0f52a56
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/docs/deploy_guide/docker_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ docker compose --profile ms -f docker-compose.yml -f docker-compose.dev.yml up
欢迎补充



## Nginx 配置
### Dinky 1.0-1.1版本
Dinky使用了SSE技术作为日志推流,如果您使用了nginx代理,需要配置Nginx支持SSE,否则默认Nginx配置会导致大量连接异常,造成页面极其卡顿,
需要在Nginx配置文件中添加以下配置:

Expand All @@ -133,3 +135,44 @@ proxy_cache off;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
```
### Dinky 1.2以后版本
Dinky使用了Websocket技术作为日志推流,如果您使用了nginx代理,需要配置Nginx支持Websocket,否则无法使用控制台等功能
需要在Nginx配置文件中添加以下配置:

> 注意,以下为参考配置,并非强制要求标准配置,请根据你的自身情况进行修改
```shell
location /api/ws/global {
proxy_pass ${你的后端地址};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /ws/sql-gateway/ {
proxy_pass ${你的后端地址};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

```
在Http节点加入配置支持websocket
```shell
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
```
43 changes: 43 additions & 0 deletions docs/docs/deploy_guide/normal_deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ Dinky 部署需要 MySQL5.7 以上版本

:::


## Nginx 配置
### Dinky 1.0-1.1版本
Dinky使用了SSE技术作为日志推流,如果您使用了nginx代理,需要配置Nginx支持SSE,否则默认Nginx配置会导致大量连接异常,造成页面极其卡顿,
需要在Nginx配置文件中添加以下配置:

Expand All @@ -257,3 +259,44 @@ proxy_cache off;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
```
### Dinky 1.2以后版本
Dinky使用了Websocket技术作为日志推流,如果您使用了nginx代理,需要配置Nginx支持Websocket,否则无法使用控制台等功能
需要在Nginx配置文件中添加以下配置:

> 注意,以下为参考配置,并非强制要求标准配置,请根据你的自身情况进行修改
```shell
location /api/ws/global {
proxy_pass ${你的后端地址};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /ws/sql-gateway/ {
proxy_pass ${你的后端地址};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

```
在Http节点加入配置支持websocket
```shell
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
```
41 changes: 41 additions & 0 deletions docs/docs/get_started/quick_experience.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ from datagen_source;


## Nginx 配置
### Dinky 1.0-1.1版本
Dinky使用了SSE技术作为日志推流,如果您使用了nginx代理,需要配置Nginx支持SSE,否则默认Nginx配置会导致大量连接异常,造成页面极其卡顿,
需要在Nginx配置文件中添加以下配置:

Expand All @@ -114,7 +115,47 @@ proxy_cache off;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
```
### Dinky 1.2以后版本
Dinky使用了Websocket技术作为日志推流,如果您使用了nginx代理,需要配置Nginx支持Websocket,否则无法使用控制台等功能
需要在Nginx配置文件中添加以下配置:

> 注意,以下为参考配置,并非强制要求标准配置,请根据你的自身情况进行修改
```shell
location /api/ws/global {
proxy_pass ${你的后端地址};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /ws/sql-gateway/ {
proxy_pass ${你的后端地址};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

```
在Http节点加入配置支持websocket
```shell
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
```

## 写在最后
至此,您已经了解了基础DInky使用流程,但Dinky的能力远不止于此,您可以继续阅读其他文档,了解更多Dinky的功能,尽享Dinky为你带来的丝滑开发体验

0 comments on commit 0f52a56

Please sign in to comment.