Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving docs #203

Merged
merged 22 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca9f092
added a template for docs (internal)
rustyrazorblade Sep 19, 2017
bd6bb14
split up the docs to multiple files, added the content from the index…
rustyrazorblade Sep 19, 2017
fda0598
broke the docs into sections
rustyrazorblade Sep 19, 2017
d01ddf6
expanding backends
rustyrazorblade Sep 19, 2017
9a7243c
showing subdirectories correctly now
rustyrazorblade Sep 19, 2017
1858801
removed unused html
rustyrazorblade Sep 19, 2017
78363e2
downloads and installation now under docs
rustyrazorblade Sep 19, 2017
aa5cd94
updated index
rustyrazorblade Sep 19, 2017
d2f772d
can control which pages we show the menu on
rustyrazorblade Sep 20, 2017
deba598
config reference
rustyrazorblade Sep 20, 2017
ce1eea5
fixed bullets on backend page
rustyrazorblade Sep 20, 2017
0b5a921
fixed reference to packaging directory
rustyrazorblade Sep 20, 2017
ee9a650
breaking out the install and download pages to dedicated sections
rustyrazorblade Sep 20, 2017
6cc3683
moving docker under download and install
rustyrazorblade Sep 20, 2017
7c8b82d
added a partial template for side nav. added to both list and single…
rustyrazorblade Sep 20, 2017
5c279ad
got side nav working, looking good
rustyrazorblade Sep 21, 2017
9362cfc
formatting fix on install instructions
rustyrazorblade Sep 21, 2017
b5c54c9
fixed install instructions
rustyrazorblade Sep 21, 2017
05fa769
fixed formatting
rustyrazorblade Sep 21, 2017
f04d18b
fixed link
rustyrazorblade Sep 21, 2017
4c63b76
did a bunch of anthony's suggestions
rustyrazorblade Sep 21, 2017
573d0b0
Documentation updates
ossarga Sep 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publishDir = "../../docs"

[[menu.main]]
name = "Downloads"
url = "/download/"
url = "/docs/install/"

[[menu.main]]
name = "FAQ"
Expand Down
503 changes: 0 additions & 503 deletions src/docs/content/docs.md

This file was deleted.

8 changes: 8 additions & 0 deletions src/docs/content/docs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
show_menu = true
+++

## Welcome to the Cassandra Reaper documentation!



129 changes: 129 additions & 0 deletions src/docs/content/docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
+++
[menu.docs]
name = "Rest API"
weight = 75
+++

# Rest API


Source code for all the REST resources can be found from package com.spotify.reaper.resources.

## Ping Resource

* GET /ping
* Expected query parameters: *None*
* Simple ping resource that can be used to check whether the reaper is running.

## Cluster Resource

* GET /cluster
* Expected query parameters:
* *seedHost*: Limit the returned cluster list based on the given seed host. (Optional)
* Returns a list of registered cluster names in the service.

* GET /cluster/{cluster_name}
* Expected query parameters:
* *limit*: Limit the number of repair runs returned. Recent runs are prioritized. (Optional)
* Returns a cluster object identified by the given "cluster_name" path parameter.

* POST /cluster
* Expected query parameters:
* *seedHost*: Host name or IP address of the added Cassandra
clusters seed host.
* Adds a new cluster to the service, and returns the newly added cluster object,
if the operation was successful.

* PUT /cluster/{cluster_name}
* Expected query parameters:
* *seedHost*: New host name or IP address used as Cassandra cluster seed.
* Modifies a cluster's seed host. Comes in handy when the previous seed has left the cluster.

* DELETE /cluster/{cluster_name}
* Expected query parameters: *None*
* Delete a cluster object identified by the given "cluster_name" path parameter.
Cluster will get deleted only if there are no schedules or repair runs for the cluster,
or the request will fail. Delete repair runs and schedules first before calling this.

## Repair Run Resource

* GET /repair_run
* Optional query parameters:
* *state*: Comma separated list of repair run state names. Only names found in
com.spotify.reaper.core.RunState are accepted.
* Returns a list of repair runs, optionally fetching only the ones with *state* state.

* GET /repair_run/{id}
* Expected query parameters: *None*
* Returns a repair run object identified by the given "id" path parameter.

* GET /repair_run/cluster/{cluster_name} (com.spotify.reaper.resources.RepairRunResource)
* Expected query parameters: *None*
* Returns a list of all repair run statuses found for the given "cluster_name" path parameter.

* POST /repair_run
* Expected query parameters:
* *clusterName*: Name of the Cassandra cluster.
* *keyspace*: The name of the table keyspace.
* *tables*: The name of the targeted tables (column families) as comma separated list.
If no tables given, then the whole keyspace is targeted. (Optional)
* *owner*: Owner name for the run. This could be any string identifying the owner.
* *cause*: Identifies the process, or cause the repair was started. (Optional)
* *segmentCount*: Defines the amount of segments to create for repair run. (Optional)
* *repairParallelism*: Defines the used repair parallelism for repair run. (Optional)
* *intensity*: Defines the repair intensity for repair run. (Optional)
* *incrementalRepair*: Defines if incremental repair should be done. [true/false] (Optional)

* PUT /repair_run/{id}
* Expected query parameters:
* *state*: New value for the state of the repair run.
Possible values for given state are: "PAUSED" or "RUNNING".
* Starts, pauses, or resumes a repair run identified by the "id" path parameter.
* Can also be used to reattempt a repair run in state "ERROR", picking up where it left off.

* DELETE /repair_run/{id}
* Expected query parameters:
* *owner*: Owner name for the run. If the given owner does not match the stored owner,
the delete request will fail.
* Delete a repair run object identified by the given "id" path parameter.
Repair run and all the related repair segments will be deleted from the database.

## Repair Schedule Resource

* GET /repair_schedule
* Expected query parameters:
* *clusterName*: Filter the returned schedule list based on the given
cluster name. (Optional)
* *keyspaceName*: Filter the returned schedule list based on the given
keyspace name. (Optional)
* Returns all repair schedules present in the Reaper

* GET /repair_schedule/{id}
* Expected query parameters: *None*
* Returns a repair schedule object identified by the given "id" path parameter.

* POST /repair_schedule
* Expected query parameters:
* *clusterName*: Name of the Cassandra cluster.
* *keyspace*: The name of the table keyspace.
* *tables*: The name of the targeted tables (column families) as comma separated list.
If no tables given, then the whole keyspace is targeted. (Optional)
* *owner*: Owner name for the schedule. This could be any string identifying the owner.
* *segmentCount*: Defines the amount of segments to create for scheduled repair runs. (Optional)
* *repairParallelism*: Defines the used repair parallelism for scheduled repair runs. (Optional)
* *intensity*: Defines the repair intensity for scheduled repair runs. (Optional)
* *incrementalRepair*: Defines if incremental repair should be done. [true/false] (Optional)
* *scheduleDaysBetween*: Defines the amount of days to wait between scheduling new repairs.
For example, use value 7 for weekly schedule, and 0 for continuous.
* *scheduleTriggerTime*: Defines the time for first scheduled trigger for the run.
If you don't give this value, it will be next mid-night (UTC).
Give date values in ISO format, e.g. "2015-02-11T01:00:00". (Optional)

* DELETE /repair_schedule/{id}
* Expected query parameters:
* *owner*: Owner name for the schedule. If the given owner does not match the stored owner,
the delete request will fail.
* Delete a repair schedule object identified by the given "id" path parameter.
Repair schedule will get deleted only if there are no associated repair runs for the schedule.
Delete all the related repair runs before calling this endpoint.

22 changes: 22 additions & 0 deletions src/docs/content/docs/backends/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
+++
[menu.docs]
name = "Backends"
identifier = "backends"
weight = 10
+++

# Backends

Cassandra Reaper can be used with either an ephemeral memory storage or persistent database.

For persistent relational database storage, you must either setup PostgreSQL or H2. You also need to set `storageType: database` in the config file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page should be a summary about the storage options available. With that in mind, lets remove this sentence and put that information in the PostgreSQL and H2 sections respectively.

Consider the following wording for listing the available storage options:

Reaper provides a number of backend storage options:
* In-memory
* Cassandra
* PostgreSQL
* H2

Copy link
Contributor Author

@rustyrazorblade rustyrazorblade Sep 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, the list links to the proper pages as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff!


Sample yaml files are available in the `src/packaging/resource` directory for each storage backend:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rewording

... directory for each storage backend:

to

... directory for each of the above storage backend:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the next revision of the docs I'd like to include the samples in the storage pages themselves, rendering this list obsolete. I can make it part of the build process that it copies them over so they'll always be in sync.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejig the list below so that the ordering is consistent i.e.

* cassandra-reaper-memory.yaml
* cassandra-reaper-cassandra.yaml
* cassandra-reaper-postgres.yaml
* cassandra-reaper-h2.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* cassandra-reaper-memory.yaml
* cassandra-reaper-postgres.yaml
* cassandra-reaper-h2.yaml
* cassandra-reaper-cassandra.yaml

For configuring other aspects of the service, see the available configuration options in later section
of this page.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace

... later section of this page.

with

... the Configuration Reference section of this documentation.

In the above wording make Configuration Reference a link to the actual page.

46 changes: 46 additions & 0 deletions src/docs/content/docs/backends/cassandra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
+++
[menu.docs]
name = "Cassandra"
parent = "backends"
weight = 4
+++

# Cassandra Backend

For persistent Apache Cassandra storage, you need to set `storageType: cassandra` in the config file.
You'll also need to fill in the connection details to your Apache Cassandra cluster used to store the Reaper schema (reaper_db by default), in the `cassandra: ` section of the yaml file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rewording the above paragraph to something like

To use Apache Cassandra as the persistent storage for Reaper, the storageType setting must be set to cassandra in the Reaper configuration YAML file. In addition, the connection details for the Apache Cassandra cluster being used to store Reaper data must be specified in the configuration YAML file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


```yaml
storageType: cassandra
cassandra:
clusterName: "test"
contactPoints: ["127.0.0.1"]
keyspace: reaper_db
queryOptions:
consistencyLevel: LOCAL_QUORUM
serialConsistencyLevel: SERIAL
```

When using SSL:

```yaml
cassandra:
storageType: cassandra
clusterName: "test"
contactPoints: ["127.0.0.1"]
keyspace: reaper_db
authProvider:
type: plainText
username: cassandra
password: cassandra
ssl:
type: jdk
```

The Apache Cassandra backend is the only one that allows running several Reaper instances at once. This provides high availability and allows to repair multi DC clusters (see the **Multi-DC** section below).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword this paragraph to something like

Of the available backends, the Cassandra deployment is the only one that allows multiple Reaper instances to run concurrently. This allows repairs to be distributed over clusters comprising multiple data centers, in fault tolerant mode or in local JMX mode (when JMX is restricted to localhost).


You will need to create a keyspace to store your data. This is installation specific, you will need to fill in your own datacenter names. For example:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rewording this paragraph to something like

To run Reaper using the Cassandra backend, create a reaper_db keyspace with an appropriate placement strategy. This is installation specific, and names of the data centers in the cluster that will host the Reaper data must be specified. For example:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.


```none
CREATE KEYSPACE reaper_db WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 3};
```
23 changes: 23 additions & 0 deletions src/docs/content/docs/backends/h2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
+++
[menu.docs]
name = "H2 (Local Storage)"
parent = "backends"
weight = 2
+++


# H2 Backend

When using H2 storage the database will automatically created for you under the path configured in `cassandra-reaper.yaml`. Please
comment/uncomment the H2 settings and modify the path as needed or use the `cassandra-reaper-h2.yaml` as a base.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rewording this paragraph to something like

To use H2 as the persistent storage for Reaper, the storageType setting must be set to database in the Reaper configuration YAML file. When using H2 storage, the database will be automatically created under the path configured in the configuration YAML file. An example of how to configure H2 as persistent storage for Reaper can be found in the cassandra-reaper-h2.yaml.


```yaml
storageType: database
database:
# H2 JDBC settings
driverClass: org.h2.Driver
url: jdbc:h2:~/reaper-db/db;MODE=PostgreSQL
user:
password:

```
16 changes: 16 additions & 0 deletions src/docs/content/docs/backends/memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
+++
[menu.docs]
name = "In Memory"
parent = "backends"
weight = 1
+++

# Memory Backend

Running Reaper with memory storage, which is not persistent, means that all
the registered clusters, column families, and repair runs will be lost upon service restart.
The memory based storage is meant to be used for testing purposes only. Enable this type of storage by using the `storageType: memory` setting in your config file (enabled by default).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rewording this paragraph to something like

To use in memory storage as the storage type for Reaper, the storageType setting must be set to memory in the Reaper configuration YAML file. Note, that the in memory storage is enabled by default. The memory storage used by Reaper is volatile and as such all registered cluster, column families and repair un information will be lost upon service restart. This storage setting is intended for testing purposes only.


```yaml
storageType: memory
```
22 changes: 22 additions & 0 deletions src/docs/content/docs/backends/postgres.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
+++
[menu.docs]
name = "Postgres"
parent = "backends"
weight = 3
+++

# Postgres Backend

The schema will be initialized/upgraded automatically upon startup in the configured database.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert the following sentence in before the one above.

To use PostgreSQL as the persistent storage for Reaper, the storageType setting must be set to database in the Reaper configuration YAML file.

Make sure to specify the correct credentials in your JDBC settings in `cassandra-reaper.yaml` to allow objects creation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword this sentence to be something like

Ensure that the correct JDBC credentials are specified in the cassandra-reaper.yaml to allow object creation.



```yaml
storageType: database
database:
# PostgreSQL JDBC settings
driverClass: org.postgresql.Driver
user: postgres
password:
url: jdbc:postgresql://127.0.0.1/reaper
```
8 changes: 8 additions & 0 deletions src/docs/content/docs/community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
[menu.docs]
name = "Community"
weight = 100
+++


We have a [Mailing List](https://groups.google.com/forum/#!forum/tlp-apache-cassandra-reaper-users) and [Gitter chat](https://gitter.im/thelastpickle/cassandra-reaper) available.
Loading