Skip to content

Commit

Permalink
Add replication documentation to README
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan770 committed Jul 20, 2020
1 parent 8c67f2e commit a8de970
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ cargo build --release
* `persistence_timer` - Amount of seconds between each database write to disk (default: `900`).
* `gc_timer` - Amount of seconds between each GC job wake (GC cycle times vary, default: `300`).
* `access_keys` - Table of queue access keys. Anonymous access to queues will not be permitted if this key has any value.
* `replication` - Replication configuration for both primary and replica nodes.

#### `access_keys`
Spartan has authentication and authorization mechanism using access keys.
Expand Down Expand Up @@ -90,3 +91,31 @@ Example of valid HTTP Authorization header:
```
Authorization: Bearer IHaveAccessToAllQueues
```

#### `replication`
Spartan also has support for queue replication.

Replication process will be restarted in case of any minor error (protocol or queue config mismatch).

If there is any problem with TCP socket, then connection will be dropped and re-opened with each replica.

##### Primary

The following config will start primary node that communicates with one replica every 180 seconds (default value):
```toml
replication = { Primary = { destination = ["127.0.0.1:12345"] } }
```

You may also use `replication_timer` key to change amount of seconds between each replication:
```toml
replication = { Primary = { destination = ["127.0.0.1:12345"], replication_timer = 30 } }
```

##### Replica

Change your replication config to following example:
```toml
replication = { Replica = { host = "127.0.0.1:12345" } }
```

Then, start replica node with `startan replica` command.

0 comments on commit a8de970

Please sign in to comment.