forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs about isolation deployments and separate task topics (apache…
- Loading branch information
Showing
8 changed files
with
172 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
id: administration-isolation-bookie | ||
title: Isolate bookies | ||
sidebar_label: "Isolate bookies" | ||
--- | ||
|
||
````mdx-code-block | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
```` | ||
|
||
|
||
A namespace can be isolated into user-defined groups of bookies, which guarantees all the data that belongs to the namespace is stored in desired bookies. The bookie affinity group uses the BookKeeper [rack-aware placement policy](https://bookkeeper.apache.org/docs/latest/api/javadoc/org/apache/bookkeeper/client/EnsemblePlacementPolicy.html) and it is a way to feed rack information which is stored as JSON format in znode. | ||
|
||
You can set a bookie affinity group using one of the following methods. | ||
|
||
````mdx-code-block | ||
<Tabs | ||
defaultValue="Admin CLI" | ||
values={[{"label":"Admin CLI","value":"Admin CLI"},{"label":"REST API","value":"REST API"},{"label":"Java admin API","value":"Java admin API"}]}> | ||
<TabItem value="Admin CLI"> | ||
``` | ||
pulsar-admin namespaces set-bookie-affinity-group options | ||
``` | ||
For more information about the command `pulsar-admin namespaces set-bookie-affinity-group options`, see [Pulsar admin docs](https://pulsar.apache.org/tools/pulsar-admin/). | ||
**Example** | ||
```shell | ||
bin/pulsar-admin bookies set-bookie-rack \ | ||
--bookie 127.0.0.1:3181 \ | ||
--hostname 127.0.0.1:3181 \ | ||
--group group-bookie1 \ | ||
--rack rack1 | ||
bin/pulsar-admin namespaces set-bookie-affinity-group public/default \ | ||
--primary-group group-bookie1 | ||
``` | ||
:::note | ||
- Do not set a bookie rack name to slash (`/`) or an empty string (`""`) if you use Pulsar earlier than 2.7.5, 2.8.3, and 2.9.2. If you use Pulsar 2.7.5, 2.8.3, 2.9.2 or later versions, it falls back to `/default-rack` or `/default-region/default-rack`. | ||
- When `RackawareEnsemblePlacementPolicy` is enabled, the rack name is not allowed to contain slash (`/`) except for the beginning and end of the rack name string. For example, rack name like `/rack0` is okay, but `/rack/0` is not allowed. | ||
- When `RegionawareEnsemblePlacementPolicy` is enabled, the rack name can only contain one slash (`/`) except for the beginning and end of the rack name string. For example, rack name like `/region0/rack0` is okay, but `/region0rack0` and `/region0/rack/0` are not allowed. | ||
For the bookie rack name restrictions, see [pulsar-admin bookies set-bookie-rack](https://pulsar.apache.org/tools/pulsar-admin/). | ||
::: | ||
</TabItem> | ||
<TabItem value="REST API"> | ||
[POST /admin/v2/namespaces/{tenant}/{namespace}/persistence/bookieAffinity](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/setBookieAffinityGroup) | ||
</TabItem> | ||
<TabItem value="Java admin API"> | ||
For how to set bookie affinity group for a namespace using Java admin API, see [code](https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java#L1164). | ||
</TabItem> | ||
</Tabs> | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
id: administration-isolation-broker | ||
title: Isolate brokers | ||
sidebar_label: "Isolate brokers" | ||
--- | ||
|
||
````mdx-code-block | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
```` | ||
|
||
|
||
In Pulsar, when namespaces (more specifically, namespace bundles) are assigned dynamically to brokers, the namespace isolation policy limits the set of brokers that can be used for assignment. Before topics are assigned to brokers, you can set the namespace isolation policy with a primary or a secondary regex to select desired brokers. | ||
|
||
You can set a namespace isolation policy for a cluster using one of the following methods. | ||
|
||
````mdx-code-block | ||
<Tabs | ||
defaultValue="Admin CLI" | ||
values={[{"label":"Admin CLI","value":"Admin CLI"},{"label":"REST API","value":"REST API"},{"label":"Java admin API","value":"Java admin API"}]}> | ||
<TabItem value="Admin CLI"> | ||
``` | ||
pulsar-admin ns-isolation-policy set options | ||
``` | ||
For more information about the command `pulsar-admin ns-isolation-policy set options`, see [Pulsar admin docs](https://pulsar.apache.org/tools/pulsar-admin/). | ||
**Example** | ||
```shell | ||
bin/pulsar-admin ns-isolation-policy set \ | ||
--auto-failover-policy-type min_available \ | ||
--auto-failover-policy-params min_limit=1,usage_threshold=80 \ | ||
--namespaces my-tenant/my-namespace \ | ||
--primary 10.193.216.* my-cluster policy-name | ||
``` | ||
</TabItem> | ||
<TabItem value="REST API"> | ||
[PUT /admin/v2/namespaces/{tenant}/{namespace}](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/createNamespace) | ||
</TabItem> | ||
<TabItem value="Java admin API"> | ||
For how to set namespace isolation policy using Java admin API, see [code](https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java#L251). | ||
</TabItem> | ||
</Tabs> | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters