最新文章
分享最新的技术趋势、编程技巧和开发心得
mac上安装homebrew
简介 homebrew macOS(或 Linux)缺失的软件包的管理器 命令行安装 Git 前提条件 安装 Git 打开终端 输入 Git 如果说已经安装可以进行下一步 没有会提示 安装软件 homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
openim源码搭建教程
简介 OpenIM 开源、通用的即时通讯组件 OpenIM包括服务端和客户端SDK,实现了高性能、轻量级、易扩展等重要特性。开发者通过集成OpenIM SDK,并私有化部署服务端,可以将即时通讯、实时网络能力快速集成到自身应用中,确保业务数据的安全性和私密性。 环境要求 注意事项 详细说明 补充说明 操作系统 Linux 官方使用 ubuntu 22.04,实测 Debian 13 也可运行 硬件资源 8核16G,10M带宽,1T磁盘 按 10 万注册用户、10% 日常在线、5 万大群、每秒 600 条消息估算;需有外网 IP CPU 架构 x86_64、arm64 其他架构需自行测试 Golang v1.22.7或更高版本 其他版本需自行测试 Docker v24.0.5或更高版本 自带compose功能 Git v2.17.1或更高版本 其他版本需自行测试 宝塔安装 # ubuntu wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh && sudo bash install_panel.sh ed8484bec # Debian wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh && bash install_panel.sh ed8484bec server端 git clone https://github.com/openimsdk/open-im-server && cd open-im-server 打开 config/minio.yml 修改 external_ip 改成 你的公网IP # Name of the bucket in MinIO bucket: openim # Access key ID for MinIO authentication accessKeyID: root # Secret access key for MinIO authentication secretAccessKey: openIM123 # Session token for MinIO authentication (optional) sessionToken: # Internal address of the MinIO server internalAddress: localhost:10005 # 修改 external_ip 改成 你的公网IP # External address of the MinIO server, accessible from outside. Supports both HTTP and HTTPS using a domain name externalAddress: http://external_ip:10005 # Flag to enable or disable public read access to the bucket publicRead: false 修改 docker-compose.yml 文件 这是后台管理系统 默认是注释 解开注释 部署后台 # openim-admin-front: # image: ${OPENIM_ADMIN_FRONT_IMAGE} # container_name: openim-admin-front # restart: always # ports: # - "11002:80" # networks: # - openim 部署外部组件(Docker Compose) docker compose up -d 中国境内建议设置 Go 代理 go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,direct 初始化(仅执行一次) bash bootstrap.sh 编译 mage ChatServer git clone https://github.com/openimsdk/chat && cd chat 编译 mage 启动/停止/检测 任务 命令 说明 后台启动 nohup mage start >> _output/logs/chat.log 2>&1 & 生产环境建议使用 停止 mage stop - 检测 mage stop - ChatServer 启动时依赖 OpenIMServer 先可用,建议在 OpenIMServer mage check正常后,再启动 ChatServer, 并等待 20-30s 再验证 10008/10009 接口。



