Skip to content

Commit

Permalink
Update REAMDE with additional explanatory text and links to examples (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
hhahn-tw authored Nov 8, 2022
1 parent 1ff4081 commit f49ebd4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ expected file formats.
topicctl [flags] bootstrap
```

The `bootstrap` subcommand creates apply topic configs from the existing topics
in a cluster. The output can be sent to either a directory (if the `--output` flag
is set) or `stdout`.
The `bootstrap` subcommand creates apply topic configs from the existing topics in a
cluster. This can be used to "import" topics not created or previously managed by topicctl.
The output can be sent to either a directory (if the `--output` flag is set) or `stdout`.

#### check

Expand Down Expand Up @@ -349,8 +349,8 @@ The tool supports the following per-partition, replica placement strategies:
| `balanced-leaders` | Ensure that the leaders of each partition are evenly distributed across the broker racks |
| `in-rack` | Ensure that the followers for each partition are in the same rack as the leader; generally this is done when the leaders are already balanced, but this isn't required |
| `cross-rack` | Ensure that the replicas for each partition are all in different racks; generally this is done when the leaders are already balanced, but this isn't required |
| `static` | Specify the placement manually, via an extra `staticAssignments` field |
| `static-in-rack` | Specify the rack placement per partition manually, via an extra `staticRackAssignments` field |
| `static` | Specify the placement manually, via an extra `staticAssignments` field. ([example](examples/local-cluster/topics/topic-static.yaml)) |
| `static-in-rack` | Specify the rack placement per partition manually, via an extra `staticRackAssignments` field ([example](examples/local-cluster/topics/topic-static-in-rack.yaml))|

#### Picker methods

Expand Down Expand Up @@ -414,8 +414,9 @@ The `reset-offsets` command can also make changes in the cluster and should be u

Apply runs are designed to be idemponent- the effects should be the same no matter how many
times they are run, assuming everything else in the cluster remains constant (e.g., the number of
brokers, each broker's rack, etc.). Changes in other topics should generally not effect idempotency,
unless, possibly, if the topic is configured to use the `cluster-use` picker.
brokers, each broker's rack, etc.). An exception is replica rebalance operations, which can be
non-deterministic. Changes in other topics should generally not effect idempotency, unless,
possibly, if the topic is configured to use the `cluster-use` picker.

### Interruptibility

Expand Down Expand Up @@ -530,4 +531,8 @@ details on the available versions.
To run the `get`, `repl`, and `tail` subcommands against the local cluster,
set `--zk-addr=localhost:2181` and leave the `--zk-prefix` flag unset.

To test out `apply`, you can use the configs in `examples/local-cluster/`.
To test out `apply`, you can use the configs in `examples/local-cluster/`. For example,
to create all topics defined for that cluster:
```
topicctl apply examples/local-cluster/topics/*.yaml
```
25 changes: 25 additions & 0 deletions examples/local-cluster/topics/topic-static-in-rack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
meta:
name: topic-static-in-rack
cluster: local-cluster
environment: local-env
region: local-region
description: |
Topic that uses static-in-rack strategy for assigning brokers.
spec:
partitions: 9
replicationFactor: 2
retentionMinutes: 100
placement:
strategy: static-in-rack
staticRackAssignments:
- zone1
- zone1
- zone1
- zone2
- zone2
- zone2
- zone3
- zone3
- zone3

0 comments on commit f49ebd4

Please sign in to comment.