码迷,mamicode.com
首页 > 其他好文 > 详细

cronicle 任务调度一主多从安装试用

时间:2019-09-18 11:35:55      阅读:358      评论:0      收藏:0      [点我收藏+]

标签:creat   ping   setup   create   for   containe   dem   web   ber   

cronicle 对于一主多从的安装还是很简单的,对于slave 就是少了setup一步,同时在master 界面,添加下slave 就可以了
就会加入集群中了

项目使用docker-compose 运行

环境准备

  • docker-compose 文件
 
version: "3"
services:
  cronicle:
      image: dalongrong/cronicle
      ports:
      - "3012:3012"
  cronicle2:
      hostname: cronicle2
      image: dalongrong/cronicle
      ports:
      - "3013:3012"
  cronicle3:
      hostname: cronicle3
      image: dalongrong/cronicle
      ports:
      - "3014:3012"

启动&&配置

  • 启动docker服务
docker-compose up  -d
  • 启动master
docker-compose exec cronicle /opt/cronicle/bin/control.sh setup
docker-compose exec cronicle /opt/cronicle/bin/control.sh start

效果

Setup completed successfully!
This server (066d3ba29173) has been added as the single primary master server.
An administrator account has been created with username ‘admin‘ and password ‘admin‘.
You should now be able to start the service by typing: ‘/opt/cronicle/bin/control.sh start‘
Then, the web interface should be available at: http://066d3ba29173:3012/
Please allow for up to 60 seconds for the server to become master.
/opt/cronicle/bin/control.sh start: Starting up Cronicle Daemon...
/opt/cronicle/bin/control.sh start: Cronicle Daemon started
  • 启动slave1
docker-compose exec cronicle2 /opt/cronicle/bin/control.sh start

效果

/opt/cronicle/bin/control.sh start: Starting up Cronicle Daemon...
/opt/cronicle/bin/control.sh start: Cronicle Daemon started
  • 启动slave2
docker-compose exec cronicle3 /opt/cronicle/bin/control.sh start

效果

/opt/cronicle/bin/control.sh start: Starting up Cronicle Daemon...
/opt/cronicle/bin/control.sh start: Cronicle Daemon started
  • 添加slave

技术图片

 

 

  • 添加之后的效果

技术图片

 

 

  • 一个简单的调度任务

技术图片

 

 

  • 执行效果

技术图片

 

 

说明

cronicle 的单master 多slave 还是很方便的,使用上也很简单,配置方便

参考资料

https://github.com/jhuckaby/Cronicle#single-master-with-slaves
https://github.com/rongfengliang/cronicle-docker

cronicle 任务调度一主多从安装试用

标签:creat   ping   setup   create   for   containe   dem   web   ber   

原文地址:https://www.cnblogs.com/rongfengliang/p/11539933.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!