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

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

posted on 2019-09-18 10:07  荣锋亮  阅读(1103)  评论(0编辑  收藏  举报

导航