mirror of https://github.com/shunfei/cronsun
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
f90d81afeb
|
8 years ago | |
---|---|---|
.github | 8 years ago | |
bin | 8 years ago | |
conf | 8 years ago | |
db | 8 years ago | |
doc/img | 8 years ago | |
event | 8 years ago | |
log | 8 years ago | |
node | 8 years ago | |
utils | 8 years ago | |
web | 8 years ago | |
.editorconfig | 8 years ago | |
.gitignore | 8 years ago | |
.travis.yml | 8 years ago | |
LICENSE | 8 years ago | |
README.md | 8 years ago | |
build.sh | 8 years ago | |
client.go | 8 years ago | |
common.go | 8 years ago | |
errors.go | 8 years ago | |
group.go | 8 years ago | |
id.go | 8 years ago | |
job.go | 8 years ago | |
job_log.go | 8 years ago | |
mdb.go | 8 years ago | |
node.go | 8 years ago | |
noticer.go | 8 years ago | |
once.go | 8 years ago | |
proc.go | 8 years ago | |
release.sh | 8 years ago | |
version.go | 8 years ago |
README.md
cronsun
cronsun
是一个分布式任务系统,单个结点和 *nix
机器上的 crontab
近似。支持界面管理机器上的任务,支持任务失败邮件提醒,安装简单,使用方便,是替换 crontab
一个不错的选择。
cronsun
是为了解决多台 *nix
机器上crontab
任务管理不方便的问题,同时提供任务高可用的支持(当某个节点死机的时候可以自动调度到正常的节点执行)。cronsun
和 Azkaban、Chronos、Airflow 这些不是同一类型的。
架构
[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, require go >= 1.7+
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
- 安装 MongoDB
- 安装 etcd3
- 修改
conf
相关的配置 - 在任务结点启动
./cronnode -conf conf/base.json
,在管理结点启动./cronweb -conf conf/base.json
- 访问管理界面
http://127.0.0.1:7079/ui/
Screenshot
Brief:
Exec result:
Job:
Node:
Credits
cron is base on robfig/cron