OpenIM (Open-Source Instant Messaging) Mac Deployment Guide

举报
OpenIM 发表于 2024/01/28 17:04:38 2024/01/28
【摘要】 This guide provides step-by-step instructions for deploying OpenIM on a Mac, including both source code and Docker deployment methods.## Preliminary Environment SetupEnsure a clean working environm...


This guide provides step-by-step instructions for deploying OpenIM on a Mac, including both source code and Docker deployment methods.

## Preliminary Environment Setup

Ensure a clean working environment:

1. **Create a New Directory**: Start in a new directory to prevent conflicts.
2. **Check for Conflicting Processes**: Run these commands:
   - `ps -ef | grep openim`
   - `ps -ef | grep chat`
3. **Check Docker Containers**: Use `docker ps` to confirm no related containers are running.

## Source Code Deployment

### Deploying openim-server

Deploying from source requires adjusting Docker's network configurations for Mac.

1. **Clone and Prepare the Repository**:
   ```jsx
   git clone https://github.com/openimsdk/open-im-server
   cd open-im-server
   export OPENIM_IP="[Your External/Internal IP]"
   make init
   ```

2. **Configure Kafka in `docker-compose.yml`**:
   - Replace:
     ```jsx
     - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://${DOCKER_BRIDGE_GATEWAY:-172.28.0.1}:${KAFKA_PORT:-19094}
     ```
   - With:
     ```jsx
     - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://127.0.0.1:${KAFKA_PORT:-19094}
     ```

3. **Start the Service**:
   ```jsx
   docker compose up -d
   ```

4. **Final Configurations**:
   ```jsx
   vim config/config.yaml -c "%s/172\.28\.0\.1/127.0.0.1/g" -c "wq"
   ```

5. **Launch openim-server**:
   ```jsx
   make start
   ```

6. **Verification**:
   ```jsx
   make check
   ```
   Wait five minutes before checking to ensure accuracy.

### Deploying openim-chat

Deploy openim-chat using source code or Docker.

1. **Return to Parent Directory**:
   ```jsx
   cd ..
   ```

2. **Deploy from Source**:
   ```jsx
   git clone https://github.com/openimsdk/chat
   cd chat
   make init
   ```

3. **Set Up MySQL** (if not already deployed):
   ```jsx
   docker run -d \
     --name mysql \
     -p 13306:3306 \
     -p 23306:33060 \
     -v "$(pwd)/components/mysql/data:/var/lib/mysql" \
     -v "/etc/localtime:/etc/localtime" \
     -e MYSQL_ROOT_PASSWORD="openIM123" \
     --restart always \
     mariadb:10.6
   ```

4. **Configure openim-chat**:
   Modify `config/config.yaml`, replacing `172.28.0.1` with `127.0.0.1`.

5. **Start openim-chat**:
   ```jsx
   make start
   ```

6. **Verification**:
   ```jsx
   make check
   ```

7. **Web Interface Access**:
   Visit [http://127.0.0.1:11001](http://127.0.0.1:11001). For validation, see [this guide](https://docs.openim.io/guides/gettingStarted/quickTestServer).

## Docker Deployment

For Docker deployment on Mac, refer to [OpenIM Docker Documentation](https://docs.openim.io/zh-Hans/guides/gettingStarted/dockerCompose).

## About OpenIM

OpenIM is an open-source instant messaging component and solution that specializes in in-app communication. It is one of the most popular open-source IM projects currently. Developers can integrate the OpenIM component and deploy the server privately, quickly incorporating instant and real-time communication capabilities into their applications, ensuring the security and confidentiality of business data.

Repository address: https://github.com/openimsdk

Developer Documentation: https://docs.openim.io/guides/introduction

IMG_1065.png

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。