github: http://github.com/brewlin/im-...
im-cloud 分佈式中間件的安裝部署
安裝方式主要提供 docker單節點部署
docker-compose自動化編排部署
手動部署
三種方式部署環境php
基礎鏡像足夠小 不用擔憂
base image+php7.2+swoole 4 才75M
docker-compose networknamespace 爲host模式,因此須要注意本地端口衝突的問題,也能夠根據本身的環境更改compose.yml配置node
鏡像linux
docker run --network host consul
docker run --network host redis
docker run --network host brewlin/cloud
docker run --network host brewlin/job
docker run --network host brewlin/logic
git clone http://github.com/brewlin/im-cloud cd im-cloud docker-compose up
make腳本使用composer自動install相關組件git
cd path/im-cloud make install
cd path/im-cloud/app/cloud php bin/app
cd path/im-cloud/app/logic; php bin/app
cd path/im-cloud/app/job; php bin/app
一、登陸官網進行下載,下載地址github
wget https://releases.hashicorp.com/consul/1.2.1/consul_1.2.1_linux_amd64.zip unzip consul_1.2.1_linux_amd64.zip
二、設置環境變量,若是不設置能夠直接把consul執行文件移動到/usr/bin目錄下web
mv consul /usr/bin
三、 單機配置、這種方式適合用於搭建服務調試使用redis
consul agent -bootstrap-expect 1 -server -data-dir /data/consul -node=cloud -bind=127.0.0.1 -config-dir /etc/consul.d -enable-script-checks=true -datacenter=dc1 -client=0.0.0.0 -ui
能夠經過 http://192.168.1.100:8500 查看服務信息docker
echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo apt-get update sudo apt-get install rabbitmq-server
cd /etc/rabbitmq/ 新建文件 touch rabbitmq.config 在配置文件中加入 [{rabbit, [{loopback_users, []}]}].
rabbitmqctl status 可查看rabbitmq的狀態
# 開啓rabbitmq web界面 Host]# rabbitmq-plugins enable rabbitmq_management The following plugins have been enabled: rabbitmq_web_dispatch rabbitmq_management_agent rabbitmq_management
Host]# rabbitmqctl add_user xiaodo xiaodo Creating user "admin" Host]# rabbitmqctl set_user_tags xiaodo administrator Setting tags for user "admin" to [administrator]
http://host:9600/im/push/mids?mids=123&operation=9&msg=pushtest
進行單點推送