分布式部署文档 - coco 部署

说明

  • 开头的行表示注释

  • $ 开头的行表示需要执行的命令

环境

  • 系统: CentOS 7
  • IP: 192.168.100.40
    ProtocolServerNameIPPortUsed By
    TCPCoco192.168.100.402222, 5000Nginx
    TCPCoco01192.168.100.402223, 5001Nginx

开始安装

  1. # 升级系统
  2. $ yum upgrade -y
  3.  
  4. # 设置防火墙, 开放 2222 5000 端口 给 nginx 访问
  5. $ firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.100" port protocol="tcp" port="2222" accept"
  6. $ firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.100" port protocol="tcp" port="5000" accept"
  7. $ firewall-cmd --reload
  8.  
  9. # 安装 docker
  10. $ yum install -y yum-utils device-mapper-persistent-data lvm2
  11. $ yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  12. $ yum makecache fast
  13. $ yum -y install docker-ce
  14. $ curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
  15. $ systemctl enable docker
  16. $ systemctl start docker
  17.  
  18. # 通过 docker 部署
  19. $ docker run --name jms_coco -d \
  20. -p 2222:2222 \
  21. -p 5000:5000 \
  22. -e CORE_HOST=http://192.168.100.30:8080 \
  23. -e BOOTSTRAP_TOKEN=你的token \
  24. jumpserver/jms_coco:1.4.8
  25.  
  26. # 访问 http://192.168.100.100/terminal/terminal/ 检查 coco 注册

多节点部署

  1. $ firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.100" port protocol="tcp" port="2223" accept"
  2. $ firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.100" port protocol="tcp" port="5001" accept"
  3. $ firewall-cmd --reload
  4.  
  5. $ docker run --name jms_coco1 -d \
  6. -p 2223:2222 \
  7. -p 5001:5000 \
  8. -e CORE_HOST=http://192.168.100.30:8080 \
  9. -e BOOTSTRAP_TOKEN=你的token \
  10. jumpserver/jms_coco:1.4.8
  11.  
  12. # 访问 http://192.168.100.100/terminal/terminal/ 检查 coco 注册