You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
miraclesu 3c2aad71b1 Update README 8 years ago
bin pkg: use uber zap as default log 8 years ago
conf fix build script 8 years ago
db pkg: mv models to cronsun 8 years ago
doc/img Update README 8 years ago
event pkg: 替换 event 包 8 years ago
log pkg: remove sunteng log 8 years ago
node pkg: remove sunteng log 8 years ago
utils pkg: 替换 util 包 8 years ago
web pkg: remove sunteng log 8 years ago
.editorconfig 检查用作key的id和名称,添加获取活动节点的接口 8 years ago
.gitignore Update README 8 years ago
LICENSE Initial commit 8 years ago
README.md Update README 8 years ago
build.sh fix build script 8 years ago
client.go pkg: mv models to cronsun 8 years ago
common.go pkg: mv models to cronsun 8 years ago
errors.go pkg: mv models to cronsun 8 years ago
group.go pkg: remove sunteng log 8 years ago
id.go pkg: mv models to cronsun 8 years ago
job.go pkg: remove sunteng log 8 years ago
job_log.go pkg: remove sunteng log 8 years ago
mdb.go pkg: mv models to cronsun 8 years ago
node.go pkg: remove sunteng log 8 years ago
noticer.go pkg: remove sunteng log 8 years ago
once.go pkg: mv models to cronsun 8 years ago
proc.go pkg: remove sunteng log 8 years ago
version.go pkg: mv models to cronsun 8 years ago

README.md

cronsun

cronsun 是一个分布式任务系统,单个结点和 *nix 机器上的 crontab 近似。支持界面管理机器上的任务,支持任务失败邮件提醒,安装简单,使用方便,是替换 crontab 一个不错的选择。

cronsun 是为了解决多台 *nix 机器上crontab 任务管理不方便的问题,同时提供任务高可用的支持(当某个节点死机的时候可以自动调度到正常的节点执行)。cronsunAzkabanChronosAirflow 这些不是同一类型的。

架构

                                                [web]
                                                  |
                                     --------------------------
           (add/del/update/exec jobs)|                        |(query job exec result)
                                   [etcd]                 [mongodb]
                                     |                        ^
                            --------------------              |
                            |        |         |              |
                         [node.1]  [node.2]  [node.n]         |
             (job exec fail)|        |         |              |
          [send mail]<-----------------------------------------(job exec result)

安全性

cronsun是在管理后台添加任务的,所以一旦管理后台泄露出去了,则存在一定的危险性,所以cronsun支持security.json的安全设置:

{
    "open": true,
    "#users": "允许选择运行脚本的用户",
    "users": [
        "www", "db"
    ],
    "#ext": "允许添加以下扩展名结束的脚本",
    "ext": [
        ".cron.sh", ".cron.py"
    ]
}

如上设置开启安全限制,则添加和执行任务的时候只允许选择配置里面指定的用户来执行脚本,并且脚本的扩展名要在配置的脚本扩展名限制列表里面。

Getting started

Setup / installation

Building with the source

go get -u github.com/shunfei/cronsun
cd $GOPATH/src/github.com/shunfei/cronsun
sh ./build.sh

Or install with the binary releases

执行文件和配置文件在 dist 文件夹

Run

  1. 安装 MongoDB
  2. 安装 etcd3
  3. 修改 conf 相关的配置
  4. 在任务结点启动 ./cronnode -conf conf/base.json,在管理结点启动 ./cronweb -conf conf/base.json
  5. 访问管理界面 http://127.0.0.1:7079/ui/

Screenshot

Brief:

Exec result:

Job:

Node:

Credits

cron is base on robfig/cron