From 9e66cb42d107295a2f280cc309f394c843705878 Mon Sep 17 00:00:00 2001 From: Anonymitaet Date: Wed, 24 Feb 2021 14:53:09 +0800 Subject: [PATCH 1/3] [Doc] Add Pulsar isolation --- site2/docs/administration-isolation.md | 84 ++++++++++++++++++++++++++ site2/website/sidebars.json | 3 +- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 site2/docs/administration-isolation.md diff --git a/site2/docs/administration-isolation.md b/site2/docs/administration-isolation.md new file mode 100644 index 0000000000000..0ee7a057accd5 --- /dev/null +++ b/site2/docs/administration-isolation.md @@ -0,0 +1,84 @@ +--- +id: administration-isolation +title: Pulsar isolation +sidebar_label: Pulsar isolation +--- + +In an organization, a Pulsar instance provides services to multiple teams. When organizing the resources across multiple teams, you want to make a suitable isolation plan to avoid the resource competition between different teams and applications and provide high-quality messaging service. In this case, you need to take resource isolation into consideration and weigh your intended actions against expected and unexpected consequences. + +To enforce resource isolation, you can use the Pulsar isolation policy, which allows you to allocate resources (**broker** and **bookie**) for the namespace. + +## Broker isolation + +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. + + + + + +``` +pulsar-admin ns-isolation-policy set options +``` + +For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.8.0-SNAPSHOT/#-em-set-em-). + +**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 +``` + + + +[PUT /admin/v2/namespaces/{tenant}/{namespace}](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/createNamespace) + + + +For how to set namespace isolation policy using Java admin API, see [here](https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java#L251). + + + +## Bookie isolation + +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. + + + + + +``` +pulsar-admin namespaces set-bookie-affinity-group options +``` + +For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.8.0-SNAPSHOT/#-em-set-bookie-affinity-group-em-). + +**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 +``` + + + +[POST /admin/v2/namespaces/{tenant}/{namespace}/persistence/bookieAffinity](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/setBookieAffinityGroup) + + + +For how to set bookie affinity group for a namespace using Java admin API, see [here](https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java#L1164). + + diff --git a/site2/website/sidebars.json b/site2/website/sidebars.json index e21f9b656a22e..ca72877f45995 100644 --- a/site2/website/sidebars.json +++ b/site2/website/sidebars.json @@ -86,7 +86,8 @@ "administration-stats", "administration-load-balance", "administration-proxy", - "administration-upgrade" + "administration-upgrade", + "administration-isolation" ], "Security": [ "security-overview", From e68bfb5baa8836db2f86068089691425716c53be Mon Sep 17 00:00:00 2001 From: Anonymitaet Date: Thu, 25 Feb 2021 09:35:03 +0800 Subject: [PATCH 2/3] update --- .../version-2.7.1/administration-isolation.md | 79 +++++++++++++++++++ .../version-2.7.1-sidebars.json | 3 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 site2/website/versioned_docs/version-2.7.1/administration-isolation.md diff --git a/site2/website/versioned_docs/version-2.7.1/administration-isolation.md b/site2/website/versioned_docs/version-2.7.1/administration-isolation.md new file mode 100644 index 0000000000000..aa77e8b0de96d --- /dev/null +++ b/site2/website/versioned_docs/version-2.7.1/administration-isolation.md @@ -0,0 +1,79 @@ +--- +id: version-2.7.1-administration-isolation +title: Pulsar isolation +sidebar_label: Pulsar isolation +original_id: administration-isolation +--- + +In an organization, a Pulsar instance provides services to multiple teams. When organizing the resources across multiple teams, you want to make a suitable isolation plan to avoid the resource competition between different teams and applications and provide high-quality messaging service. In this case, you need to take resource isolation into consideration and weigh your intended actions against expected and unexpected consequences. + +To enforce resource isolation, you can use the Pulsar isolation policy, which allows you to allocate resources (**broker** and **bookie**) for the namespace. + +## Broker isolation + +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. + + + + + +``` +pulsar-admin ns-isolation-policy set options +``` + +For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.7.0-SNAPSHOT/#-em-set-em-). + +**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 +``` + + + +[PUT /admin/v2/namespaces/{tenant}/{namespace}](https://pulsar.apache.org/admin-rest-api/?version=2.7.0&apiversion=v2#operation/createNamespace) + + + +For how to set namespace isolation policy using Java admin API, see [here](https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java#L251). + + + +## Bookie isolation + +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. + + + + + +``` +pulsar-admin namespaces set-bookie-affinity-group options +``` + +For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.7.0-SNAPSHOT/#-em-set-bookie-affinity-group-em-). + +**Example** + +```shell +bin/pulsar-admin namespaces set-bookie-affinity-group public/default \ +--primary-group group-bookie1 +``` + + + +[POST /admin/v2/namespaces/{tenant}/{namespace}/persistence/bookieAffinity](https://pulsar.apache.org/admin-rest-api/?version=2.7.0&apiversion=v2#operation/setBookieAffinityGroup) + + + +For how to set bookie affinity group for a namespace using Java admin API, see [here](https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java#L1164). + + diff --git a/site2/website/versioned_sidebars/version-2.7.1-sidebars.json b/site2/website/versioned_sidebars/version-2.7.1-sidebars.json index c07d5a9d82827..7325df215709c 100644 --- a/site2/website/versioned_sidebars/version-2.7.1-sidebars.json +++ b/site2/website/versioned_sidebars/version-2.7.1-sidebars.json @@ -86,7 +86,8 @@ "version-2.7.1-administration-stats", "version-2.7.1-administration-load-balance", "version-2.7.1-administration-proxy", - "version-2.7.1-administration-upgrade" + "version-2.7.1-administration-upgrade", + "version-2.7.1-administration-isolation" ], "Security": [ "version-2.7.1-security-overview", From a961ab6066b267d9aaa7012c68446ef21bae9b16 Mon Sep 17 00:00:00 2001 From: Anonymitaet Date: Thu, 25 Feb 2021 10:36:45 +0800 Subject: [PATCH 3/3] update --- site2/docs/administration-isolation.md | 4 ++-- .../versioned_docs/version-2.7.1/administration-isolation.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/site2/docs/administration-isolation.md b/site2/docs/administration-isolation.md index 0ee7a057accd5..8ba5077729cad 100644 --- a/site2/docs/administration-isolation.md +++ b/site2/docs/administration-isolation.md @@ -22,7 +22,7 @@ You can set a namespace isolation policy for a cluster using one of the followin pulsar-admin ns-isolation-policy set options ``` -For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.8.0-SNAPSHOT/#-em-set-em-). +For more information about the command `pulsar-admin ns-isolation-policy set options`, see [here](http://pulsar.apache.org/tools/pulsar-admin/). **Example** @@ -58,7 +58,7 @@ You can set a bookie affinity group using one of the following methods. pulsar-admin namespaces set-bookie-affinity-group options ``` -For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.8.0-SNAPSHOT/#-em-set-bookie-affinity-group-em-). +For more information about the command `pulsar-admin namespaces set-bookie-affinity-group options`, see [here](http://pulsar.apache.org/tools/pulsar-admin/). **Example** diff --git a/site2/website/versioned_docs/version-2.7.1/administration-isolation.md b/site2/website/versioned_docs/version-2.7.1/administration-isolation.md index aa77e8b0de96d..4ee5c031364de 100644 --- a/site2/website/versioned_docs/version-2.7.1/administration-isolation.md +++ b/site2/website/versioned_docs/version-2.7.1/administration-isolation.md @@ -23,7 +23,7 @@ You can set a namespace isolation policy for a cluster using one of the followin pulsar-admin ns-isolation-policy set options ``` -For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.7.0-SNAPSHOT/#-em-set-em-). +For more information about the command `pulsar-admin ns-isolation-policy set options`, see [here](http://pulsar.apache.org/tools/pulsar-admin/). **Example** @@ -59,7 +59,7 @@ You can set a bookie affinity group using one of the following methods. pulsar-admin namespaces set-bookie-affinity-group options ``` -For more information about the command and descriptions, see [here](http://pulsar.apache.org/tools/pulsar-admin/2.7.0-SNAPSHOT/#-em-set-bookie-affinity-group-em-). +For more information about the command `pulsar-admin namespaces set-bookie-affinity-group options`, see [here](http://pulsar.apache.org/tools/pulsar-admin/). **Example**