Skip to content

Commit

Permalink
Issue 32: Updating documentation (#33)
Browse files Browse the repository at this point in the history
Signed-off-by: SrishT <[email protected]>

Co-authored-by: SrishT <[email protected]>
  • Loading branch information
SrishT and SrishT authored Apr 27, 2020
1 parent a323bbf commit 6a9b836
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
42 changes: 20 additions & 22 deletions doc/bookkeeper-options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Bookkeeper options
## BookKeeper options

Bookkeeper has many configuration options. The available options can be found [here](https://bookkeeper.apache.org/docs/4.7.0/reference/config/) and are expressed through the `bookkeeper/options` part of the resource specification.
BookKeeper has many configuration options. The available options can be found [here](https://bookkeeper.apache.org/docs/4.7.0/reference/config/) and are expressed through the `options` part of the resource specification.

All values must be expressed as Strings.

Expand All @@ -9,35 +9,33 @@ Take metrics for example, here we choose codahale as our metrics provider. The d
```
...
spec:
bookeeper:
options:
enableStatistics: "true"
statsProviderClass: "org.apache.bookkeeper.stats.codahale.CodahaleMetricsProvider"
codahaleStatsGraphiteEndpoint: "graphite.example.com:2003"
codahaleStatsOutputFrequencySeconds: "30"
options:
enableStatistics: "true"
statsProviderClass: "org.apache.bookkeeper.stats.codahale.CodahaleMetricsProvider"
codahaleStatsGraphiteEndpoint: "graphite.example.com:2003"
codahaleStatsOutputFrequencySeconds: "30"
...
```
### Bookkeeper JVM Options
### BookKeeper JVM Options

It is also possible to tune the Bookkeeper JVM by passing customized JVM options. Bookkeeper JVM Options
are obvisouly for Bookkeeper JVM whereas aforementioned BookKeeper options are for BookKeeper server configuration.
It is also possible to tune the BookKeeper JVM by passing customized JVM options. BookKeeper JVM Options
are for Bookkeeper JVM whereas the aforementioned BookKeeper options are for BookKeeper server configuration.

The format is as follows:
```
...
spec:
bookkeeper:
bookkeeperJVMOptions:
memoryOpts: ["-Xms2g", "-XX:MaxDirectMemorySize=2g"]
gcOpts: ["-XX:MaxGCPauseMillis=20"]
gcLoggingOpts: ["-XX:NumberOfGCLogFiles=10"]
extraOpts: []
jvmOptions:
memoryOpts: ["-Xms2g", "-XX:MaxDirectMemorySize=2g"]
gcOpts: ["-XX:MaxGCPauseMillis=20"]
gcLoggingOpts: ["-XX:NumberOfGCLogFiles=10"]
extraOpts: []
...
```
The reason that we are using such detailed names like `memoryOpts` is because the Bookkeeper official [scripts](https://github.com/apache/bookkeeper/blob/master/bin/common.sh#L118) are using those and we need to override it using the same name. JVM options that don't belong to the earlier 3 categories can be mentioned under `extraOpts`.
The reason that we are using such detailed names like `memoryOpts` is because the BookKeeper official [scripts](https://github.com/apache/bookkeeper/blob/master/bin/common.sh#L118) are using those and we need to override it using the same name. JVM options that don't belong to the earlier 3 categories can be mentioned under `extraOpts`.

There are a bunch of default options in the Pravega operator code that is good for general deployment. It is possible to override those default values by just passing the customized options. For example, the default option `"-XX:MaxDirectMemorySize=1g"` can be override by passing `"-XX:MaxDirectMemorySize=2g"` to
the Pravega operator. The operator will detect `MaxDirectMemorySize` and override its default value if it exists. Check [here](https://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html) for more JVM options.
There are a bunch of default options in the BookKeeper operator code that is good for general deployment. It is possible to override those default values by just passing the customized options. For example, the default option `"-XX:MaxDirectMemorySize=1g"` can be overridden by passing `"-XX:MaxDirectMemorySize=2g"` to
the BookKeeper operator. The operator will detect `MaxDirectMemorySize` and override its default value if it exists. Check [here](https://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html) for more JVM options.

Default memoryOpts:
```
Expand All @@ -48,7 +46,7 @@ Default memoryOpts:
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:HeapDumpPath=" + heapDumpDir,
```
if Pravega version is greater or equal to 0.4, then the followings are also added to the default memoryOpts
if BookKeeper version is greater or equal to 0.4, then the followings are also added to the default memoryOpts
```
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseCGroupMemoryLimitForHeap",
Expand Down Expand Up @@ -81,7 +79,7 @@ Default gcLoggingOpts:

### BookKeeper Custom Configuration

It is possible to add additional parameters into the BookKeeper container by allowing users to create a custom ConfigMap and specify its name within the field `envVars` of the Bookkeeper Spec. The following values need to be provided within this ConfigMap if we expect the BookKeeper cluster to work with Pravega.
It is possible to add additional parameters into the BookKeeper container by allowing users to create a custom ConfigMap and specify its name within the field `envVars` of the BookKeeper Spec. The following values need to be provided within this ConfigMap if we expect the BookKeeper cluster to work with Pravega.

| KEY | VALUE |
|---|---|
Expand Down
2 changes: 1 addition & 1 deletion example/cr-detailed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
codahaleStatsOutputFrequencySeconds: "30"

# Pass the JVM options to Bookkeeper
bookkeeperJVMOptions:
jvmOptions:
memoryOpts: ["-Xms2g", "-XX:MaxDirectMemorySize=2g"]
gcOpts: ["-XX:MaxGCPauseMillis=20"]
gcLoggingOpts: ["-XX:NumberOfGCLogFiles=10"]
Expand Down

0 comments on commit 6a9b836

Please sign in to comment.