Skip to content

Commit

Permalink
docs: update gettingStarted module in EN docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Aug 23, 2024
1 parent 424f065 commit 5989a1d
Show file tree
Hide file tree
Showing 13 changed files with 618 additions and 501 deletions.
24 changes: 12 additions & 12 deletions docs/guides/gettingStarted/jssdk.mdx
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# oimws部署 -计划废弃


# oimws 部署 - 计划废弃

## OpenIM 的两个版本 JSSDK

OpenIM 提供了两个版本的 JSSDK,每个版本都有其独特的特点和应用场景:

### 1. WASM 版本

[仓库地址](https://github.com/openimsdk/open-im-sdk-web-wasm)

**优点**

- **性能优越**:使用 WebAssembly (WASM) 技术,带来了更高的效率。
- **本地消息存储**:消息本地存储提高了数据处理速度。

**缺点**

- **文件体积较大**:包体积相对较大,压缩前大约 20MB。
- **小程序不兼容**:在小程序中无法使用。

### 2. 纯 JS 版本

[仓库地址](https://github.com/openimsdk/open-im-sdk-web)

**优点**

- **通用性强**:不依赖于特定的技术栈,可以在更多的环境和平台中使用。

**缺点**
- **性能相对较差**:由于历史消息需要从服务端拉取,在性能上有所不足。


- **性能相对较差**:由于历史消息需要从服务端拉取,在性能上有所不足。

OIMWS(OpenIM Websocket)是专为 OpenIM 的纯 JSSDK 设计的服务端解决方案。它负责处理来自 JSSDK 的所有Websocket请求
OIMWS(OpenIM Websocket)是专为 OpenIM 的纯 JSSDK 设计的服务端解决方案。它负责处理来自 JSSDK 的所有 Websocket 请求
本指南将详细介绍如何安装和运行 OIMWS,并提供对其关键功能和配置参数的全面解释。


## 安装

您可以通过两种方式安装 OIMWS SDK Server:
Expand All @@ -51,10 +52,10 @@ OIMWS(OpenIM Websocket)是专为 OpenIM 的纯 JSSDK 设计的服务端解
运行程序需要配置一些参数,您可以通过命令行标志来设置这些参数。以下是程序的主要函数及其参数:

```yaml
openimApi: "http://127.0.0.1:10002"
openimWs: "ws://127.0.0.1:10001"
sdkWsPort: [ 10003 ]
dbDir: "../../../../db/"
openimApi: 'http://127.0.0.1:10002'
openimWs: 'ws://127.0.0.1:10001'
sdkWsPort: [10003]
dbDir: '../../../../db/'
```

### 参数说明
Expand All @@ -76,4 +77,3 @@ mage start
```

这将启动服务器,并根据提供的参数配置服务。

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
---
title: 'Docker Deployment for OpenIM'
sidebar_position: 3
---

# Environment Setup 🌍

# Docker Deployment for OpenIM


## 🌍 Environment Preparation

- Install Docker with the Compose plugin or docker-compose on your server. For installation details, visit the [Docker Compose Installation Guide](https://docs.docker.com/compose/install/linux/).
- Install Docker with the Compose plugin or docker-compose on your server. For installation details, please visit the [Docker Compose Installation Guide](https://docs.docker.com/compose/install/linux/).

## 🗂️ Repository Cloning
## Clone the Repository 🗂️

```bash
git clone https://github.com/openimsdk/openim-docker
```

## 🔧 Configuration Modification
## Configuration Modifications 🔧

- Modify the `.env` file to set up the external IP. If using a domain name, [Nginx](./nginxDomainConfig.mdx) configuration is required.
- Modify the `.env` file to configure the external IP. If using a domain name, configure [Nginx](./nginxDomainConfig.mdx).

```plaintext
# Set the external access address for MinIO service (external IP or domain)
# Set the external access address for the MinIO service (external IP or domain name)
MINIO_EXTERNAL_ADDRESS="http://external_ip:10005"
# Set the external access address for Grafana service (external IP or domain)
GRAFANA_URL="http://external_ip:13000/"
# Set the external access address for the Grafana service (external IP or domain name)
GRAFANA_URL="http://external_ip:13000/"
```

- Please refer to the comments in the .env file for other configurations.
- Other configurations can be found in the comments within the `.env` file.

## 🚀 Service Launch
## Service Startup 🚀

- To start the service:
- To start the services:

```bash
docker compose up -d
```

- To stop the service:
- To stop the services:

```bash
docker compose down
Expand All @@ -47,51 +47,55 @@ docker logs -f openim-server
docker logs -f openim-chat
```

## Quick Experience
## Quick Experience

For a quick experience with OpenIM services, please visit the [Quick Test Server Guide](https://docs.openim.io/guides/gettingStarted/quickTestServer).
For a quick experience with the OpenIM service, refer to the [Quick Test](./quickTestServer).

---

## Below are the deployment processes for versions release-v3.6 and earlier:
## Previous Versions (Release v3.6 and Before)

---

# 🛠 Docker Deployment

## 1. Environment and Component Requirements
For server environment, system, and storage components, refer to [this document](./env-comp).

Refer to this document for the server environment, system, and storage component requirements: [Environment and Component Requirements](./env-comp).

---

## 2. Docker Deployment

## 2.1 Clone Repository and Initialize
### 2.1 Clone the Repository and Initialize

```jsx
```bash
git clone https://github.com/openimsdk/openim-docker openim-docker && cd openim-docker && make init
```

💡 **Tips**
> If you obtained **openim-docker** not by cloning but by downloading a zip file, run the command **find ./ -name "*.sh" | xargs chmod +x** to grant script execution permissions.

> If you didn't clone the repository but downloaded a zip file for `openim-docker`, run **`find ./ -name "*.sh" | xargs chmod +x`** to grant execute permissions to the scripts.
---

## 2.2 Set OPENIM_IP
### 2.2 Set the OPENIM_IP

🔔 **You must set OPENIM_IP, and it cannot be 127.0.0.1**
🔔 **You must set the `OPENIM_IP`, and it cannot be `127.0.0.1`**

```jsx
```bash
# If the server has an external IP
export OPENIM_IP="external IP"

# If only providing internal network service
# If only internal services are provided
export OPENIM_IP="internal IP"
```

## 2.3 Start Service and View Logs
---

### 2.3 Start Services and View Logs

```jsx
```bash
docker compose up -d
docker ps
docker compose logs -f openim-chat
Expand All @@ -100,106 +104,104 @@ docker compose logs -f openim-server

---

## 3. Quick Verification
## 3. Quick Test

Please refer to the [Quick Verification](./quickTestServer) document.
Refer to the [Quick Test](./quickTestServer) documentation for further details.

---

## 4. Admin Panel and Monitoring System

Please refer to the [Admin Panel and Monitoring System](./admin) document.
Refer to the [Admin Panel and Monitoring System](./admin) documentation for more details.

---

## 5. About Configuration Modification
## 5. Configuration Changes

This project has complex configuration items, primarily because some settings involve **`.env`**, **`openim-chat/config/config.yaml`**, and **`openim-server/config/config.yaml`** multiple files. The explanation for modifying configuration items is divided into two parts: shared configuration items and other configuration items.
This project has relatively complex configuration settings. Some settings involve multiple files such as **`.env`**, **`openim-chat/config/config.yaml`**, and **`openim-server/config/config.yaml`**. Configuration changes are explained in two parts: shared configuration changes and other configuration changes.

### 5.1 Shared Configuration Items

Shared configuration items across **`.env`**, **`openim-chat/config/config.yaml`**, and **`openim-server/config/config.yaml`**:
These configuration items are shared between **`.env`**, **`openim-chat/config/config.yaml`**, and **`openim-server/config/config.yaml`**:

1. MySQL/Mongo/Redis/Kafka/Zookeeper/MinIO ports and passwords;
1. Ports and passwords for MySQL, Mongo, Redis, Kafka, Zookeeper, and MinIO;
2. SECRET;
3. API_OPENIM_PORT;
4. OPENIM_IP;
5. MINIO_PORT;
6. GRAFANA_PORT
6. GRAFANA_PORT.

### 5.2 Modification Methods

For modifying shared configuration items, choose one of the following methods:
For modifying the shared configuration items in 5.1, you can choose between two methods:

#### Method 1: Regenerate All Configuration Files

Method One: Regenerate all configurations
If you need to update the configuration comprehensively, follow these steps:

If a comprehensive update of configurations is needed, follow these steps:
1. Delete the existing configuration files: delete the **`openim-server/config/config.yaml`** and **`openim-chat/config/config.yaml`** files.
2. Modify the `.env` file: update the relevant settings in the **`.env`** file.
3. Regenerate the configuration and restart the services: run **`docker compose down ; docker compose up -d`** to regenerate the configuration files based on the new settings in the **`.env`** file and restart the services.

1. Delete existing configuration files: Remove **`openim-server/config/config.yaml`** and **`openim-chat/config/config.yaml`** files.
2. Modify the `.env` file: Update relevant settings in the **`.env`** file.
3. Regenerate configurations and restart service: Execute **`docker compose down ; docker compose up -d`**, which will regenerate configuration files based on the new settings in the **`.env`** file and restart the service.
#### Method 2: Modify Individual Configuration Files

Method Two: Modify multiple configuration files separately
If you only need to update part of the configuration, follow these steps:

If only a partial update is needed, follow these steps:
1. Modify the `.env` file: update the relevant settings in the **`.env`** file.
2. Manually update the configuration files: update the corresponding settings in **`openim-server/config/config.yaml`** and **`openim-chat/config/config.yaml`** according to the changes made in the `.env` file.
3. Special variable handling: if you modify **`OPENIM_IP`**, **`API_OPENIM_PORT`**, **`MINIO_PORT`**, or **`GRAFANA_PORT`**, update the following settings in **`openim-server/config/config.yaml`**:

1. Modify the `.env` file: Update relevant settings in the **`.env`** file.
2. Manually update configuration files: According to modifications in the **`.env`** file, update corresponding settings in **`openim-server/config/config.yaml`** and **`openim-chat/config/config.yaml`** files
```yaml
object:
apiURL: 'http://$OPENIM_IP:$API_OPENIM_PORT'
minio:
endpoint: 'http://$DOCKER_BRIDGE_GATEWAY:$MINIO_PORT'
signEndpoint: 'http://$OPENIM_IP:$MINIO_PORT'

.
3. Special variable additional handling: If you modified **`OPENIM_IP`**, **`API_OPENIM_PORT`**, **`MINIO_PORT`**, **`GRAFANA_PORT`**, then you need to update the following configuration items in **`openim-server/config/config.yaml`**:
grafanaUrl: http://$OPENIM_IP:$GRAFANA_PORT
```
```yaml
object:
apiURL: "http://$OPENIM_IP:$API_OPENIM_PORT"
minio:
endpoint: "http://$DOCKER_BRIDGE_GATEWAY:$MINIO_PORT"
signEndpoint: "http://$OPENIM_IP:$MINIO_PORT"

grafanaUrl: http://$OPENIM_IP:$GRAFANA_PORT
```
4. Restart the service: Execute **`docker compose down ; docker compose up -d`** to apply changes and restart the service.
4. Restart the services: run **`docker compose down ; docker compose up -d`** to apply the changes and restart the services.

### 5.3 Other Configuration Item Modification
### 5.3 Modifying Other Configuration Items

For non-shared variables in **`.env`**, **`openim-chat/config/config.yaml`**, and **`openim-server/config/config.yaml`**, you can individually modify these configuration items in the respective files. Execute **`docker compose down ; docker compose up -d`** to apply changes and restart the service.
For non-shared variables in the **`.env`**, **`openim-chat/config/config.yaml`**, and **`openim-server/config/config.yaml`** files, you can modify these settings individually in the respective files. Run **`docker compose down ; docker compose up -d`** to apply the changes and restart the services.

---

## ❓ 6. Common Issues

### 6.1 Text messages are sent normally, but sending pictures fails 😕
### 6.1 Able to Send Text Messages, But Unable to Send Images 😕

This may be because the `OPENIM_IP` environment variable was not set before executing the `docker compose up -d` command. You can confirm this by checking the startup logs or by using the following command to search for "127.0.0.1" in the logs:
This might be because the `OPENIM_IP` environment variable was not set before running `docker compose up -d`. Check the startup logs or use the following command to search the logs for "127.0.0.1" to confirm:

```bash
grep "127.0.0.1" openim-server/_output/logs/openim-docker.log
```

#### Solution:

1. Set the `OPENIM_IP` environment variable to your public IP address, or to your internal IP address if only providing internal network service:
1. Set the `OPENIM_IP` environment variable to your public IP address (or internal IP if only providing internal services):

```bash
export OPENIM_IP="<Public-IP>"
```

2. Use the `sed` command to update the `apiURL` and `signEndpoint` configuration items in the `config.yaml` file, changing the address to use the `OPENIM_IP` environment variable specified IP address:
2. Use the `sed` command to update the `apiURL` and `signEndpoint` settings in the `config.yaml` file to the IP address specified by the `OPENIM_IP` environment variable:

```bash
sed -i -e "s/apiURL: \"http:\/\/127\.0\.0\.1/apiURL: \"http:\/\/${OPENIM_IP}/" \
-e "s/signEndpoint: \"http:\/\/127\.0\.0\.1/signEndpoint: \"http:\/\/${OPENIM_IP}/" \
openim-server/config/config.yaml
```

After making these configuration changes and restarting the service, you should be able to send picture messages normally.
After modifying the configuration and restarting the services, you should be able to send images successfully.

### 6.2 About Docker Versions 🐋
### 6.2 About Docker Version 🐋

It is strongly recommended to use the `docker compose` command instead of `docker-compose`, as older versions of Docker may not support the gateway feature❌. We advise upgrading to a newer version, such as `23.0.1`🔝.
It is strongly recommended to use the `docker compose` command instead of `docker-compose`. Older versions of Docker may not support the gateway feature❌. We recommend upgrading to a newer version, such as `23.0.1`🔝.

### 6.3 Viewing Logs 📜
### 6.3 Log Viewing 📜

Log locations:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ sidebar_position: 7

### 🌐 Environment Requirements

| Consideration | Detailed Description |
| --- | --- |
| Operating System | Linux system |
| Consideration | Detailed Description |
| ------------------ | ------------------------------- |
| Operating System | Linux windows mac OS |
| Hardware Resources | At least 4G of available memory |
| Golang | v1.19 or higher |
| Docker | v24.0.5 or higher |
| Git | v2.17.1 or higher |
| Golang | v1.21 or higher |
| Docker | v24.0.5 or higher |
| Git | v2.17.1 or higher |

### 💾 Storage Component Requirements

| Storage Component | Recommended Version |
| --- | --- |
| MongoDB | v6.0.2 or higher |
| Redis | v7.0.0 or higher |
| Zookeeper | v3.8 |
| Kafka | v3.5.1 |
| MinIO | Latest version |

| Storage Component | Recommended Version |
| ----------------- | ---------------------------- |
| MongoDB | v6.0.2 or higher |
| Redis | v7.0.0 or higher |
| Etcd | v3.5.13 |
| Kafka | v3.5.1 |
| MinIO | RELEASE.2024-01-11T07-46-16Z |
Loading

0 comments on commit 5989a1d

Please sign in to comment.