写点什么

# OpenIM (Open-Source Instant Messaging) Mac Deployment Guide

作者:Geek_1ef48b
  • 2024-01-28
  • 本文字数:1307 字

    阅读完需:约 4 分钟

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:

  3. ps -ef | grep openim

  4. ps -ef | grep chat

  5. 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:


   git clone https://github.com/openimsdk/open-im-server   cd open-im-server   export OPENIM_IP="[Your External/Internal IP]"   make init
复制代码


  1. Configure Kafka in docker-compose.yml:

  2. Replace:


     - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://${DOCKER_BRIDGE_GATEWAY:-172.28.0.1}:${KAFKA_PORT:-19094}
复制代码


  • With:


     - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://127.0.0.1:${KAFKA_PORT:-19094}
复制代码


  1. Start the Service:


   docker compose up -d
复制代码


  1. Final Configurations:


   vim config/config.yaml -c "%s/172\.28\.0\.1/127.0.0.1/g" -c "wq"
复制代码


  1. Launch openim-server:


   make start
复制代码


  1. Verification:


   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:


   cd ..
复制代码


  1. Deploy from Source:


   git clone https://github.com/openimsdk/chat   cd chat   make init
复制代码


  1. Set Up MySQL (if not already deployed):


   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
复制代码


  1. Configure openim-chat:Modify config/config.yaml, replacing 172.28.0.1 with 127.0.0.1.

  2. Start openim-chat:


   make start
复制代码


  1. Verification:


   make check
复制代码


  1. Web Interface Access:Visit http://127.0.0.1:11001. For validation, see this guide.

Docker Deployment

For Docker deployment on Mac, refer to OpenIM Docker Documentation.

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


用户头像

Geek_1ef48b

关注

还未添加个人签名 2021-08-25 加入

还未添加个人简介

评论

发布
暂无评论
# OpenIM (Open-Source  Instant Messaging) Mac Deployment Guide_Geek_1ef48b_InfoQ写作社区