Skip to content

Commit 1d27c0e

Browse files
committed
feat: doc
2 parents 1c02200 + a6ac2fc commit 1d27c0e

15 files changed

Lines changed: 136 additions & 44 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"position": 2,
3-
"label": "快速开始",
3+
"label": "快速部署",
44
"collapsible": true,
55
"collapsed": true
66
}

docs/guides/gettingStarted/admin.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: '监控及告警'
3-
sidebar_position: 5
2+
title: '运维系统'
3+
sidebar_position: 9
44
---
55

66

@@ -10,7 +10,6 @@ docker compose部署时,会自动部署如下组件,如使用源码部署,
1010

1111
| 组件名称 | 组件说明 | 部署说明 |
1212
|-------------|-----------------------------------------|--------------------------------------|
13-
| openim-admin | 管理后台,提供监控页面入口 | Docker和源码部署均自动开启 |
1413
| prometheus | 用于收集和存储指标数据的监控系统组件 | 需手动启用 |
1514
| alertmanager | 管理和发送告警的组件 | 需手动启用 |
1615
| grafana | 用于展示监控数据的仪表板组件 | 需手动启用 |

docs/guides/gettingStarted/cluster.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: '源码集群部署指南'
3-
sidebar_position: 6
2+
title: '集群部署-源码'
3+
sidebar_position: 5
44
---
55

66

@@ -16,7 +16,7 @@ sidebar_position: 6
1616
- **Kafka 集群地址**: `kafkaAddr1`, `kafkaAddr2`, `kafkaAddr3`
1717
- **Etcd 集群地址**: `etcdAddr1`, `etcdAddr2`, `etcdAddr3`
1818

19-
实际情况下您可根据需求选择是否部署组件集群
19+
本文假设以上组件都部署在三台机器上,实际上不限于三台,您可根据需求自行选择多台或者一台
2020

2121
此外,MinIO 的内部服务访问地址配置为 `your_minio_internal_address`,外部访问地址配置为 `your_minio_external_address`
2222
A 和 B 两台机器以及组件集群内网互通,且A、B两台机器都有外网IP。

docs/guides/gettingStarted/dockerCompose.mdx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: 'docker部署'
3-
sidebar_position: 3
3+
sidebar_position: 2
44

55
---
66
## 环境准备 🌍
77

8-
- 在服务器上安装带有 Compose 插件的 Docker 或 docker-compose。安装详情请访问 [Docker Compose 安装指南](https://docs.docker.com/compose/install/linux/)
8+
- 在服务器上安装带有 Compose 插件的 Docker 或 docker-compose,并确保docker已正常启动
99

1010
## 仓库克隆 🗂️
1111

@@ -18,15 +18,11 @@ git clone https://github.com/openimsdk/openim-docker
1818
- 修改 `.env` 文件,配置外网 IP。如果使用域名,需配置 [Nginx](./nginxDomainConfig.mdx)
1919

2020
```plaintext
21-
# 设置 MinIO 服务的外网访问地址(外网IP或域名
21+
# 设置 MinIO 服务的外网访问地址(external_ip:10005或域名
2222
MINIO_EXTERNAL_ADDRESS="http://external_ip:10005"
2323
```
2424

25-
>注意:docker部署不采用配置挂载的模式,在config目录下面修改配置文件无效!请采用环境变量的方式修改配置。
26-
>
27-
>配置格式说明:docker方式部署如果需要修改配置,则需要通过修改docker-compose.yaml中的环境变量来实现。例如修改`openim-server`的配置文件`openim-api.yml`中的`prometheus.grafanaURL`字段,则应在`docker-compose.yaml`文件中的`openim-server``environment`下添加:`- IMENV_OPENIM_API_PROMETHEUS_GRAFANAURL=${GRAFANA_URL}``IMENV``openim-server`配置的固定前缀,文件名和字段之间的分隔符全部为`_`,并且全部改为大写。
28-
29-
- 其他配置请参考 .env 中的注释
25+
>注意:进入容器修改config目录下的修改配置文件无效!请采用环境变量的方式修改配置,参考[设置环境变量指南](https://github.com/openimsdk/openim-docker/issues/136)
3026
3127
## 服务启动 🚀
3228

@@ -36,7 +32,7 @@ git clone https://github.com/openimsdk/openim-docker
3632
docker compose up -d
3733
```
3834

39-
- 启动服务+监控组件(可选):
35+
- 启动运维组件(可选):
4036

4137
```bash
4238
docker compose --profile m up -d
@@ -59,9 +55,12 @@ docker logs -f openim-chat
5955

6056
## 快速体验 ⚡
6157

62-
快速体验 OpenIM 服务,请参考[快速验证](./quickTestServer)
58+
快速体验 OpenIM 服务,检测部署是否正常,请参考[快速验证](./quickTestServer)
6359

64-
## 关于 Docker 版本 🐋
6560

66-
强烈要求使用 docker compose 命令而不是 docker-compose,老版本 Docker 可能不支持 gateway 功能❌。我们建议您升级到较新的版本,例如 `23.0.1`🔝
61+
## 常见问题
6762

63+
### unhealthy定位
64+
1. 执行 `docker exec -it openim-server mage check` 确认是否超过一分钟;
65+
2. 执行 `docker exec -it openim-chat mage check` 确认是否超过一分钟;
66+
3. 查看日志;

docs/guides/gettingStarted/imSourceCodeDeployment.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: '源码部署'
3-
sidebar_position: 1
3+
sidebar_position: 3
44
---
55

66
# 🛠 源码部署
@@ -23,7 +23,7 @@ git clone https://github.com/openimsdk/open-im-server && cd open-im-server
2323
docker compose up -d
2424
```
2525

26-
如需启动监控组件(prometheus/alertmanager/grafana)
26+
如需启动运维组件(prometheus/alertmanager/grafana)
2727

2828
```sh
2929
docker compose --profile m up -d
@@ -145,10 +145,7 @@ mage check
145145

146146
启动顺序如下:
147147

148-
- IM 依赖的组件:mongo/redis/kafka/minio
148+
- IM 依赖的组件:mongo/redis/kafka/minio
149149
- **IM**
150150
- **Chat**
151151

152-
### 7.3 🐳 Docker 版本
153-
154-
新版 Docker 已经整合了 docker-compose. 老版本的 Docker 可能不支持 gateway 功能 ❌。我们建议您升级到较新的版本,例如 `23.0.1`🔝
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: '内网部署'
3+
sidebar_position: 4
4+
---
5+
## 📌 一、部署服务端
6+
7+
请参考 [docker部署](./dockerCompose)[源码部署](./imSourceCodeDeployment) 来进行部署。
8+
9+
---
10+
## 二、 开放端口
11+
12+
### 📡 IM 端口
13+
14+
| TCP 端口 | 说明 | 操作 ⚙️ |
15+
| --- | --- | --- |
16+
| TCP:10001 | ws 协议,消息端口,用于客户端 SDK | 端口放行 |
17+
| TCP:10002 | api 端口,如用户、好友、群组、消息等接口 | 端口放行 |
18+
| TCP:10005 | 选择 MinIO 存储时需要(OpenIM 默认使用 MinIO 存储) | 端口放行 |
19+
20+
### 💬 Chat 端口
21+
22+
| TCP 端口 | 说明 | 操作 ⚙️ |
23+
| --- | --- | --- |
24+
| TCP:10008 | 业务系统,如注册、登录等 | 端口放行 |
25+
| TCP:10009 | 管理后台,如统计、封号等 | 端口放行 |
26+
27+
### 💻 PC Web 及管理后台前端资源端口
28+
29+
| TCP 端口 | 说明 | 操作 ⚙️ |
30+
| --- | --- | --- |
31+
| TCP:11001 | PC Web 前端资源 | 端口放行 |
32+
| TCP:11002 | 管理后台前端资源 | 端口放行 |
33+
34+
### 💻 grafana端口
35+
| TCP 端口 | 说明 | 操作 ⚙️ |
36+
| --- | --- | --- |
37+
| TCP:13000 | grafana端口 | 端口放行 |
38+
39+
40+
41+
## 三、验证
42+
43+
### PC Web 验证
44+
45+
:::tip
46+
在浏览器中输入 `http://your_server_ip:11001` 来访问 PC Web。`your_server_ip` 为服务端部署机器`ip`地址,确保浏览器能访问。注册时验证码默认为 `666666`
47+
:::
48+
49+
50+
51+
52+
import Image3 from './assets/pc-web.png';
53+
54+
<img src={Image3} width="700" alt="PC Web Interface" />
55+
56+
57+
58+
### 管理后台验证
59+
60+
在浏览器中输入 `http://your_server_ip:11002` 来访问管理后台。`your_server_ip` 为服务端部署机器`ip`地址,确保您的浏览器能访问。默认账号和密码均为 chatAdmin
61+
62+
63+
import Image4 from './assets/admin.jpg';
64+
65+
<img src={Image4} width="700" alt="admin " />

docs/guides/gettingStarted/k8s-deployment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'k8s部署-待完善'
3-
sidebar_position: 8
2+
title: '集群部署-kubernetes'
3+
sidebar_position: 6
44
---
55

66

docs/guides/gettingStarted/nginxDomainConfig.mdx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: 'Nginx域名配置'
3-
sidebar_position: 7
2+
title: '域名及SSL证书配置'
3+
sidebar_position: 8
44
---
55

66

77

8-
# Nginx域名配置
8+
# 域名及SSL证书配置
99

1010
## 1. 前置条件 🛠️
1111

1212
- **open-im-server****chat** 成功启动。
1313
- **Nginx** 已成功安装,包括 SSL 模块。
14-
- 成功申请两个域名及其 SSL 证书,例如:`web.xx.xx` (用于 IM 服务端及 Web 端), `admin.xx.xx`(用于管理后台)。
14+
- 成功申请两个域名及其 SSL 证书,例如:`web.your_domain.com` (用于 IM 服务端及 Web 端), `admin.your_domain.com`(用于管理后台)。
1515
- 开放 443 和 80 端口。
1616

1717
## 2. 域名配置模板 📝
@@ -57,9 +57,9 @@ server {
5757
server_name web.xx.xx; #Your domain name
5858
ssl on;
5959
#Path of pem file for ssl certificate
60-
ssl_certificate /usr/local/nginx/conf/ssh/web.xx.xx_bundle.pem;
60+
ssl_certificate /usr/local/nginx/conf/ssh/web.your_domain.com_bundle.pem;
6161
#Key file path of ssl certificate
62-
ssl_certificate_key /usr/local/nginx/conf/ssh/web.xx.xx.key;
62+
ssl_certificate_key /usr/local/nginx/conf/ssh/web.your_domain.com.key;
6363
6464
gzip on;
6565
gzip_min_length 1k;
@@ -125,12 +125,12 @@ server {
125125
#Take the domain name "admin.xx.xx" for example
126126
server {
127127
listen 443; #listening port
128-
server_name admin.xx.xx; #Your domain server_name
128+
server_name admin.your_domain.com; #Your domain server_name
129129
ssl on;
130130
#Path of pem file for ssl certificate
131-
ssl_certificate /usr/local/nginx/conf/ssh/admin.xx.xx_bundle.pem;
131+
ssl_certificate /usr/local/nginx/conf/ssh/admin.your_domain.com_bundle.pem;
132132
#Key file path of ssl certificate
133-
ssl_certificate_key /usr/local/nginx/conf/ssh/admin.xx.xx.key;
133+
ssl_certificate_key /usr/local/nginx/conf/ssh/admin.your_domain.com.key;
134134
135135
136136
gzip on;
@@ -194,22 +194,29 @@ server {
194194
#Redirection from HTTP to HTTPS redirection
195195
server {
196196
listen 80;
197-
server_name web.xx.xx;
197+
server_name web.your_domain.com;
198198
rewrite ^(.*)$ https://$host$1 permanent;
199199
}
200200
```
201201

202202
## 3. Minio 配置 🗄️
203-
204-
- **源码部署**: 修改 `config/minio.yml` 文件中的 `externalAddress``"https://web.xx.xx/im-minio-api"`.
205-
- **Docker 部署**: 修改 `.env` 文件中的 `MINIO_EXTERNAL_ADDRESS``"https://web.xx.xx/im-minio-api"`.
203+
- **源码部署**: 修改 `config/minio.yml` 文件中的 `externalAddress``"https://web.your_domain.com/im-minio-api"`.
204+
- **Docker 部署**: 修改 `.env` 文件中的 `MINIO_EXTERNAL_ADDRESS``"https://web.your_domain.com/im-minio-api"`.
206205

207206
## 4. 启动 Nginx 🚀
208207

209208
执行命令 `nginx -s reload` 以重载 Nginx 配置,启用新的域名设置。
210209

211210
## 5. 登录验证 🔍
212211

213-
- 访问IM web端:`web.xx.xx`
214-
- 访问管理后台:`admin.xx.xx`
212+
- 访问IM web端:`web.your_domain.com`
213+
- 访问管理后台:`admin.your_domain.com`
214+
215+
## 6. 修改客户端 SDK 初始化参数
216+
在客户端 SDK 中,配置初始化参数如下:
217+
218+
- `apiAddr`: `https://your_domain.com/api`
219+
- `wsAddr`: `wss://your_domain.com/msg_gateway`
220+
221+
215222

docs/guides/gettingStarted/quickTestServer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: '快速验证'
3-
sidebar_position: 5
3+
sidebar_position: 7
44
---
55
## 📌 一、部署服务端
66

docs/guides/pressure_test.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: '压测报告'
33
hide_title: true
4-
sidebar_position: 3
4+
sidebar_position: 5
55
---
66

77
## 测试目的

0 commit comments

Comments
 (0)