Skip to content

Commit

Permalink
Big docs refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Nov 23, 2018
1 parent c7da170 commit 4da0b3b
Show file tree
Hide file tree
Showing 27 changed files with 308 additions and 183 deletions.
2 changes: 2 additions & 0 deletions website/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ languageCode = "en-us"
title = "Dkron - Distributed job scheduling system"
theme = "docdock"
MetaDataFormat = "yaml"
pygmentsCodeFences = true
pygmentsStyle = "monokailight"

[params]
editURL = "https://github.com/victorcoder/dkron/edit/master/website/content/"
Expand Down
2 changes: 1 addition & 1 deletion website/content/api/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "API"
date: 2017-06-30T14:58:54+02:00
weight: 100
---

<link rel="stylesheet" type="text/css" href="/css/swagger-ui.css">
Expand Down
37 changes: 2 additions & 35 deletions website/content/basics/_index.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
---
title: "Basics"
date: 2017-06-30T14:58:54+02:00
draft: false
weight: 20
icon: "<b>1. </b>"
---

## Dkron - Distributed, fault tolerant job scheduling system

Welcome to the Dkron documentation! This is the reference guide on how to use Dkron. If you want a getting started guide refer to the [getting started guide](getting-started).

## What is Dkron

Dkron is a distributed system to run scheduled jobs against a server or a group of servers of any size. One of the machines is the leader and the others will be followers. If the leader fails or becomes unreachable, any other one will take over and reschedule all jobs to keep the system healthy.

In case the old leader becomes alive again, it'll become a follower.

Dkron is a distributed cron drop-in replacement, easy to setup and fault tolerant with focus in:

- Easy: Easy to use with a great UI
- Reliable: Completely fault tolerant
- High scalable: Able to handle high volumes of scheduled jobs and thousands of nodes

Dkron is written in Go and leverage the power of distributed key value stores and [Serf](https://www.serfdom.io/) for providing fault tolerance, reliability and scalability while keeping simple and easily installable.

Dkron is inspired by the google whitepaper [Reliable Cron across the Planet](https://queue.acm.org/detail.cfm?id=2745840)

Dkron runs on Linux, OSX and Windows. It can be used to run scheduled commands on a server cluster using any combination of servers for each job. It has no single points of failure due to the use of the fault tolerant distributed databases and can work at large scale thanks to the efficient and lightweight gossip protocol.

Dkron uses the efficient and lightweight [gossip protocol](https://www.serfdom.io/docs/internals/gossip.html) underneath to communicate with nodes. Failure notification and task handling are run efficiently across an entire cluster of any size.

## Web UI
<center class="hidden-xs">
![](/img/screenshot1.png)
</center>

## Dkron design

Dkron is designed to solve one problem well, executing commands in given intervals. Following the unix philosophy of doing one thing and doing it well (like the battle-tested cron) but with the given addition of being designed for the cloud era, removing single points of failure in environments where scheduled jobs are needed to be run in multiple servers.

{{% children style="h2" depth="3" description="true" %}}
3 changes: 1 addition & 2 deletions website/content/basics/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Configuration
wight: 2
toc: false
wight: 20
---

Settings for dkron can be specified in three ways: Using a `config/dkron.json` config file, using env variables starting with `DKRON_` or using command line arguments.
Expand Down
39 changes: 19 additions & 20 deletions website/content/basics/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
title: Getting started
weight: 1
weight: 30
---

Welcome to the intro guide to dkron! This will explain how to setup dkron, how easy is to use it, what problems could it help you to solve, etc.

## Introduction

Dkron nodes can work in two modes, agents or servers.
Expand All @@ -23,33 +21,28 @@ You can choose whether a job is run on a node or nodes by specifying tags and a

All the execution responses will be gathered by the scheduler and stored in the database.

## Requirements
## Backend stores

Dkron relies on the key-value store for data storage, an instance of the distributed store can be run in the same machines as Dkron or connect it to an already existing cluster.

It is compatible with etcd, Consul, Zookeeper and Redis data stores. For instructions on how to install and configure any one of these systems refer to their official sites:
{{% notice note %}}
By default dkron will start with a file based, embedded KV store called BoltDB, it is functional for a single node demo but does not offers clustering or HA.
{{% /notice %}}

It is compatible with etcd, Consul, Zookeeper, BoltDB and partially with Redis. For instructions on how to install and configure any one of these systems refer to their official sites:

- [etcd](https://coreos.com/etcd/docs/latest/)
- [Consul](https://consul.io/intro/getting-started/install.html)
- [ZooKeeper](https://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html)
- [Redis](https://redis.io/topics/quickstart)

## Installation

### Recommended method

APT repository: `deb [trusted=yes] https://apt.fury.io/victorcoder/ /`

Unstable release: `sudo apt-get install dkron-unstable`
Stable release: `sudo apt-get install dkron`

### Other methods
## Configuration

Simply download the packaged archive for your platform from the [downloads page](https://github.com/victorcoder/dkron/releases), extract the package to a shared location in your drive, like `/opt/local` and run it from there.
See the [installation](/basics/installation).

## Configuration

See the [configuration section](/basics/configuration).
See the [configuration](/basics/configuration).

## Usage

Expand All @@ -59,9 +52,11 @@ By default Dkron uses the following ports:
- `8080` for HTTP for the API and Dashboard
- `6868` for RPC comunication between agents.

**Be sure you have opened this ports (or the ones that you configured) in your firewall or AWS security groups.**
{{% notice note %}}
Be sure you have opened this ports (or the ones that you configured) in your firewall or AWS security groups.
{{% /notice %}}

By default dkron will try to use a local etcd server running in the same machine and in the default port. A different store can be specified setting `backend` and `backend-machines` flag in the config file, env variables or as a command line flag.
By default dkron will use the embedded BoltDB KV store. A different store can be specified setting `backend` and `backend-machines` flag in the config file, env variables or as a command line flag.

To start a Dkron server instance:

Expand All @@ -72,7 +67,7 @@ dkron agent --server
Time to add the first job:

{{% notice note %}}
This job will only run in just one dkron_server node due to the node count in the tag. Refer to the [target node spec](/usage/target-nodes-spec) for details.
This job will only run in just one `dkron_server` node due to the node count in the tag. Refer to the [target node spec](/usage/target-nodes-spec) for details.
{{% /notice %}}

```bash
Expand All @@ -93,3 +88,7 @@ curl localhost:8080/v1/jobs -XPOST -d '{
}
}`
```
That's it!

#### To start configuring an HA installation of Dkron follow the [clustering guide](/usage/clustering)
77 changes: 77 additions & 0 deletions website/content/basics/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

---
title: Installation
weight: 10
---

## Running the binary

Download the packaged archive for your platform from the [downloads page](https://github.com/victorcoder/dkron/releases) and extract the package to a shared location in your drive, like /opt/local/bin.

Run Dkron with default setting: `dkron agent --server`

Navigate to http://localhost:8080


{{% notice note %}}
By default dkron will start with a file based, embedded KV store called BoltDB, it is functional for a single node demo but does not offers clustering or HA.
{{% /notice %}}

## Installing the package

### Debian repo

APT repository:
```
deb [trusted=yes] https://apt.fury.io/victorcoder/ /
```

Then install: `sudo apt-get install dkron`

### YUM repo

YUM repository:

```
[dkron]
name=Dkron Pro Private Repo
baseurl=https://yum.fury.io/victorcoder/
enabled=1
gpgcheck=0
```

Then install: `sudo apt-get install dkron`

This will start Dkron as a system service and the place example configuration file under `/etc/dkron/dkron.yml`

## Running in Docker

Dkron provides an official Docker image vi Dockerhub that can be used for deployment on any system running Docker.

### Launching Dkron on a new container

Here’s a quick one-liner to get you off the ground (please note, we recommend further configuration for production deployments below):

```
docker run -d -p 8080:8080 --name dkron dkron/dkron agent --server
```

This will launch a Dkron server on port 8080 by default. You can use docker logs -f dkron to follow the rest of the initialization progress. Once the Dkron startup completes you can access the app at localhost:8080

Since Docker containers have their own ports and we just map them to the system ports as needed it’s easy to move Dkron onto a different system port if you wish. For example running Dkron on port 12345:

```
docker run -d -p 12345:8080 --name dkron dkron/dkron
```

### Mounting a mapped file storage volume

In its default configuration Dkron uses the local filesystem to run a BoltDB embedded database to store its own application data. The end result is that your Dkron application data will be on disk inside your container and lost if you ever remove the container.

To persist your data outside of the container and make it available for use between container launches we can mount a local file path inside our container.

```
docker run -d -p 8080:8080 -v ~/dkron.db:/dkron.db --name dkron dkron/dkron agent --server
```

Now when you launch your container we are mounting that file from our local filesystem into the container.
38 changes: 38 additions & 0 deletions website/content/intro/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Intro"
weight: 80
icon: "<b>1. </b>"
---

## Dkron - Distributed, fault tolerant job scheduling system

Welcome to the Dkron documentation! This is the reference guide on how to use Dkron. If you want a getting started guide refer to the [getting started guide](getting-started).

## What is Dkron

Dkron is a distributed system to run scheduled jobs against a server or a group of servers of any size. One of the machines is the leader and the others will be followers. If the leader fails or becomes unreachable, any other one will take over and reschedule all jobs to keep the system healthy.

In case the old leader becomes alive again, it'll become a follower.

Dkron is a distributed cron drop-in replacement, easy to setup and fault tolerant with focus in:

- Easy: Easy to use with a great UI
- Reliable: Completely fault tolerant
- High scalable: Able to handle high volumes of scheduled jobs and thousands of nodes

Dkron is written in Go and leverage the power of distributed key value stores and [Serf](https://www.serfdom.io/) for providing fault tolerance, reliability and scalability while keeping simple and easily installable.

Dkron is inspired by the google whitepaper [Reliable Cron across the Planet](https://queue.acm.org/detail.cfm?id=2745840)

Dkron runs on Linux, OSX and Windows. It can be used to run scheduled commands on a server cluster using any combination of servers for each job. It has no single points of failure due to the use of the fault tolerant distributed databases and can work at large scale thanks to the efficient and lightweight gossip protocol.

Dkron uses the efficient and lightweight [gossip protocol](https://www.serfdom.io/docs/internals/gossip.html) underneath to communicate with nodes. Failure notification and task handling are run efficiently across an entire cluster of any size.

## Web UI
<center class="hidden-xs">
![](/img/screenshot1.png)
</center>

## Dkron design

Dkron is designed to solve one problem well, executing commands in given intervals. Following the unix philosophy of doing one thing and doing it well (like the battle-tested cron) but with the given addition of being designed for the cloud era, removing single points of failure in environments where scheduled jobs are needed to be run in multiple servers.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions website/content/operations/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Operations Guide
weight: 60
---
57 changes: 2 additions & 55 deletions website/content/pro/_index.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,6 @@
---
title: Dkron Pro
weight: 40
---

## Getting started

Dkron Pro provides a backend store out of the box, based on etcd.

To configure the storage a sample `etcd.conf.yaml` file is provided in `/etc/dkron` path. Editing the file, allows to configure several options for the embedded store.

The location of the store configuration can be set in the command line or in the dkron config file `/etc/dkron/dkron.yml` using `etcd-config-file-path` parameter.

### Starting a single node

Works out of the box, good for non HA installations.

- System service: If no changes are done to the default config files, dkron will start as a service in single mode.
- Command line: Running a single node with default config can be done by running: `dkron agent --server`

Check your server is working: `curl localhost:8080/v1`

Simple as that, now it is time to add some jobs:

```bash
curl localhost:8080/v1/jobs -XPOST -d '{
"name": "job1",
"schedule": "@every 10s",
"timezone": "Europe/Berlin",
"owner": "Platform Team",
"owner_email": "platform@example.com",
"disabled": false,
"tags": {
"dkron_server": "true"
},
"concurrency": "allow",
"executor": "shell",
"executor_config": {
"command": "date"
}
}`
```
## Configuration
Dkron Pro uses the [same parameters](/basics/configuration) as Dkron OSS and add some extra parameters.
### Command line options
* `--etcd-config-file-path` - Etcd node config
* `--username` - Authentication username
* `--password` - Authentication password
* `--cert-file` - Path to the client server TLS cert file
* `--key-file` - Path to the client server TLS key file
* `--client-crl-file` - Path to the client certificate revocation list file
* `--trusted-ca-file` - Path to the client server TLS trusted CA cert file
* `--client-cert-auth` - Enable client cert authentication
* `--auto-tls` - Client TLS using generated certificates
{{% children style="card" depth="2" description="true" %}}
{{% children style="h3" description="true" %}}
16 changes: 4 additions & 12 deletions website/content/pro/clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,9 @@ title: Clustering

## Configure a cluster

Dkron can run in HA mode, avoiding SPOFs, this mode provides better scalability and better reliability for users that wants a high level of confidence in the cron jobs they need to run.
First follow the Dkron [clustering guide](/usage/clustering) then you can continue with this guide.

To form a cluster, server nodes need to know the address of its peers as in the following example:

```yaml
# dkron.yml
join:
- 10.19.3.9
- 10.19.4.64
- 10.19.7.215
```
On the other side, the embedded store also needs to know its peers, it needs its own configuration as in the following example:
The embedded store also needs to know its peers, it needs its own configuration as in the following example:

```yaml
# etcd.conf.yaml
Expand All @@ -25,3 +15,5 @@ initial-cluster: dkron1=https://10.19.3.9:2380,dkron2=https://10.19.4.64:2380,dk
```
With this configuration Dkron Pro should start in cluster mode with embedded storage.
For a more in detail guide of clustering with etcd follow this guide: https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/clustering.md
File renamed without changes.
20 changes: 20 additions & 0 deletions website/content/pro/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

---
title: Configuration
---

## Configuration

Dkron Pro uses the [same parameters](/basics/configuration) as Dkron OSS and add some extra parameters.

### Command line options

* `--etcd-config-file-path` - Etcd node config
* `--username` - Authentication username
* `--password` - Authentication password
* `--cert-file` - Path to the client server TLS cert file
* `--key-file` - Path to the client server TLS key file
* `--client-crl-file` - Path to the client certificate revocation list file
* `--trusted-ca-file` - Path to the client server TLS trusted CA cert file
* `--client-cert-auth` - Enable client cert authentication
* `--auto-tls` - Client TLS using generated certificates
Loading

0 comments on commit 4da0b3b

Please sign in to comment.