openimsdk / open-im-server

IM Chat ChatGPT
https://openim.io
Apache License 2.0
14.11k stars 2.49k forks source link

Efficient Offline Deployment of OpenIM 3.0 : Solving Docker Image Pulling Issues with COS #474

Closed cubxxw closed 3 months ago

cubxxw commented 1 year ago

Checklist

Is this feature request related to a problem?

✅ Yes

Problem Description

OpenIM is an open-source instant messaging solution for enterprise-level communication. It is widely used in various industries due to its high performance, scalability, and security. However, when deploying OpenIM through Docker, users may encounter issues with pulling the necessary images due to DNS contamination. In this article, we will introduce an offline deployment solution for OpenIM that solves this problem.

Solution Description

Images list

Service Name Image Supported Architectures Ports Download Link
mysql mysql:5.7 amd64, arm64v8, arm32v7 13306:3306, 23306:33060 https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/mysql.tar
mongodb mongo:4.0 amd64, arm64v8, arm32v7 37017:27017 https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/mongo.tar
redis redis amd64, arm64v8, arm32v7 16379:6379 https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/redis.tar
zookeeper wurstmeister/zookeeper amd64 2181:2181 https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/zookeeper.tar
kafka wurstmeister/kafka arm,amd64 9092:9092 https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/kafka.ta
openim-chat-1.1.0 openim-chat-1.1.0 amd64 N/A https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/openim/image/amd/off-line/off-line/openim-chat-1.1.0.tar
minio minio/minio amd64, arm64v8, arm32v7 10005:9000, 9090:9090 https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/minio.tar
open_im_server openim/open_im_server:v3.0.1 amd64 N/A https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/openim/image/amd/off-line/off-line/openim-server-3.0.1.tar

Note We use mongodb as an example to demonstrate the steps ⏬⏬⏬

Benefits

The offline deployment solution for OpenIM with COS brings several benefits to the user, including:

  1. Reliable and efficient deployment: With the offline deployment solution, users can deploy OpenIM without being affected by DNS contamination, which can cause slow image pulling speeds or complete failure to pull the images. This provides a reliable and efficient deployment process for OpenIM.
  2. High-speed download channel: By saving the necessary images to a COS, users can download them from a high-speed download channel, which provides faster download speeds compared to the Docker Hub.
  3. Cost-effective storage solution: COS provides a cost-effective storage solution for saving the necessary images, which can help users save on storage costs compared to other cloud storage solutions.

Potential Drawbacks

no

Additional Information

The Solution

To solve this problem, we recommend using an offline deployment solution for OpenIM. This solution involves saving the necessary images to a cloud object storage (COS) service, such as Tencent Cloud's COS, and then downloading them from the COS to the local machine for deployment. This approach provides a high-speed download channel and avoids the DNS pollution issue.

Step 1: Save Images to COS

The first step is to save the necessary image into COS. We recommend using Tencent Cloud's COS, as it provides a reliable and cost-effective storage solution. The following is an example of how to save the mongodb image to Tencent Cloud's COS:

https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/mongo.tar

Step 2: Download Images from COS

After saving the images to the COS, users can download them to the local machine for deployment. The following is an example of how to download the mongodb image from Tencent Cloud's COS:

wget https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/image/amd/off-line/off-line/mongo.tar

Step 3: Deploy OpenIM

Once the images have been downloaded, users can proceed with the deployment of OpenIM. The following is an example of how to deploy OpenIM using the mongodb image:

docker load -i mongo.tar

Then import the other images ~

Step 4: Deploy OpenIM - docker - compose

Note: Note that compose was integrated with docker around version 20, otherwise you need to download docker-compose yourself

docker compose up
kubbot commented 1 year ago

This issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles: Join slack 🤖 to connect and communicate with our developers. If you wish to accept this assignment, please leave a comment in the comments section: /accept.🎯

kubbot commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

kubbot commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.