GithubHelp home page GithubHelp logo

bittang / im_service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gobelieveio/im_service

0.0 1.0 0.0 634 KB

golang im server

License: GNU General Public License v2.0

Makefile 0.95% Go 84.77% Python 13.68% Protocol Buffer 0.59%

im_service's Introduction

im service

  1. 支持点对点消息, 群组消息, 聊天室消息
  2. 支持集群部署
  3. 单机支持50w用户在线
  4. 单机处理消息5000条/s
  5. 支持超大群组(3000人)

编译运行

  1. 安装go编译环境

    参考链接:https://golang.org/doc/install

  2. 下载im_service代码

    cd $GOPATH/src/github.com/GoBelieveIO

    git clone https://github.com/GoBelieveIO/im_service.git

  3. 编译proto文件

    cd im_service

    //注意需要翻墙

    go get google.golang.org/grpc

    go get -u github.com/golang/protobuf/{proto,protoc-gen-go}

    export PATH=$PATH:$GOPATH/bin

    protoc -Irpc/ rpc/rpc.proto --go_out=plugins=grpc:rpc

    python -m grpc.tools.protoc -Irpc --python_out=rpc/ --grpc_python_out=rpc/ rpc/rpc.proto

  4. 编译

cd im_service

mkdir bin

go get github.com/bitly/go-simplejson

go get github.com/golang/glog

go get github.com/go-sql-driver/mysql

go get github.com/garyburd/redigo/redis

go get github.com/googollee/go-engine.io

go get github.com/richmonkey/cfg

go get github.com/syndtr/goleveldb/leveldb/opt

go get github.com/syndtr/goleveldb/leveldb

go get github.com/valyala/gorpc

//注意需要翻墙

go get google.golang.org/grpc

make install

可执行程序在bin目录下

  1. 安装mysql数据库, redis, 并导入db.sql

  2. 配置程序 配置项的说明参考ims.cfg.sample, imr.cfg.sample, im.cfg.sample

  3. 启动程序

    创建ims消息存放路径

    创建日志文件路径 mkdir /data/logs/ims mkdir /data/logs/imr mkdir /data/logs/im

    pushd dirname $0 > /dev/null BASEDIR=pwd

    nohup $BASEDIR/ims -log_dir=/data/logs/ims ims.cfg >/data/logs/ims/ims.log 2>&1 &

    nohup $BASEDIR/imr -log_dir=/data/logs/imr imr.cfg >/data/logs/imr/imr.log 2>&1 &

    nohup $BASEDIR/im -log_dir=/data/logs/im im.cfg >/data/logs/im/im.log 2>&1 &

官方QQ群

  1. 450359487

官方网站

https://developer.gobelieve.io/

im_service's People

Contributors

richmonkey avatar lostdragon avatar daibou007 avatar bryant1410 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.