cronsun/README.md

111 lines
3.3 KiB
Markdown
Raw Normal View History

2017-05-18 03:59:43 +00:00
# cronsun [![Build Status](https://travis-ci.org/shunfei/cronsun.svg?branch=master)](https://travis-ci.org/shunfei/cronsun)
2017-05-15 09:19:44 +00:00
2017-05-24 03:45:01 +00:00
`cronsun` is a distributed cron-style job system. It's similar with `crontab` on stand-alone `*nix`.
2017-05-15 10:02:05 +00:00
2017-05-24 03:45:01 +00:00
[简体中文](README_ZH.md)
## Purpose
2017-05-24 10:07:53 +00:00
The goal of this project is to make it much easier to manage jobs on lots of machines and provides high availability.
`cronsun` is different from [Azkaban](https://azkaban.github.io/), [Chronos](https://mesos.github.io/chronos/), [Airflow](https://airflow.incubator.apache.org/).
2017-05-24 03:45:01 +00:00
## Features
- Easy manage jobs on multiple machines
- Managemant panel
- Mail service
2017-05-27 02:33:17 +00:00
- Multi-language support
- Simple authentication and accounts manager(default administrator email and password: admin@admin.com/admin)
2017-05-24 03:45:01 +00:00
2017-10-13 08:41:07 +00:00
## Status
`cronsun` has been tested in production for years on hundreds of servers.
Although the current version is not release as an stable version, but we think it is completely available for the production environment.
We encourage you to try it, it's easy to use, see how it works for you. We believe you will like this tool.
2017-05-24 03:45:01 +00:00
## Architecture
2017-05-15 09:19:44 +00:00
```
[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)
```
2017-05-15 10:02:05 +00:00
2017-05-24 03:45:01 +00:00
## Security
2017-05-15 10:02:05 +00:00
2017-06-13 08:00:42 +00:00
`cronsun` support security with `security.json` config. When `open=true` job command is only allow local files with special extension on the node.
2017-05-15 10:02:05 +00:00
```json
{
"open": true,
2017-05-24 03:45:01 +00:00
"#users": "allowed execution users",
2017-05-15 10:02:05 +00:00
"users": [
"www", "db"
],
2018-02-28 09:36:38 +00:00
"#ext": "allowed execution file extensions",
2017-05-15 10:02:05 +00:00
"ext": [
".cron.sh", ".cron.py"
]
}
```
2017-05-15 09:19:44 +00:00
## Getting started
2017-05-16 08:04:28 +00:00
### Setup / installation
2017-10-24 08:03:55 +00:00
Install from binary [latest release](https://github.com/shunfei/cronsun/releases/latest)
2017-05-24 10:07:53 +00:00
2018-02-28 09:36:38 +00:00
Or build from source ([feature/glide](https://github.com/shunfei/cronsun/tree/feature/glide)), require `go >= 1.9+`, [glide](https://glide.sh/)
2017-05-15 09:19:44 +00:00
```
2017-05-16 08:04:28 +00:00
go get -u github.com/shunfei/cronsun
cd $GOPATH/src/github.com/shunfei/cronsun
2018-02-28 09:36:38 +00:00
git checkout feature/glide
glide update
2017-05-18 06:07:55 +00:00
sh build.sh
2017-05-15 09:19:44 +00:00
```
### Run
2017-05-24 03:45:01 +00:00
1. Install [MongoDB](http://docs.mongodb.org/manual/installation/)
2. Install [etcd3](https://github.com/coreos/etcd)
2018-02-28 09:36:38 +00:00
3. Open and update Etcd(`conf/etcd.json`) and MongoDB(`conf/db.json`) configurations
4. Start cronnode: `./cronnode -conf conf/base.json`, start cronweb: `./cronweb -conf conf/base.json`
5. Open `http://127.0.0.1:7079` in browser
2017-05-15 09:19:44 +00:00
## Screenshot
**Brief**:
2017-05-27 08:51:36 +00:00
![](doc/img/Cronsun_dashboard_en.png)
2017-05-15 09:19:44 +00:00
**Exec result**:
2017-05-27 08:51:36 +00:00
![](doc/img/Cronsun_log_list_en.png)
![](doc/img/Cronsun_log_item_en.png)
2017-05-15 09:19:44 +00:00
**Job**:
2017-05-27 08:51:36 +00:00
![](doc/img/Cronsun_job_list_en.png)
2017-05-15 09:19:44 +00:00
2017-05-27 08:51:36 +00:00
![](doc/img/Cronsun_job_new_en.png)
2017-05-15 09:19:44 +00:00
**Node**:
2017-05-27 08:51:36 +00:00
![](doc/img/Cronsun_node_en.png)
2017-05-16 08:04:28 +00:00
## Credits
cron is base on [robfig/cron](https://github.com/robfig/cron)