sijie commented on a change in pull request #9692: URL: https://github.com/apache/pulsar/pull/9692#discussion_r581787690
########## File path: 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 Review comment: ```suggestion --primary 10.193.216.* my-cluster policy-name ``` Explain what people should put in `--primary`. ########## File path: 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 +``` + +<!--REST API--> + +[PUT /admin/v2/namespaces/{tenant}/{namespace}](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/createNamespace) + +<!--Java admin API--> + +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). + +<!--END_DOCUSAURUS_CODE_TABS--> + +## 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 \ Review comment: ditto ########## File path: 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 +``` + +<!--REST API--> + +[PUT /admin/v2/namespaces/{tenant}/{namespace}](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/createNamespace) + +<!--Java admin API--> + +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). + +<!--END_DOCUSAURUS_CODE_TABS--> + +## 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 \ Review comment: ```suggestion --bookie 127.0.0.1:3181 \ ``` `127.0.0.1:3181` should be changed to bookie-id. The bookie id is in `<hostname>:<port>` format. ########## File path: 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 +``` + +<!--REST API--> + +[PUT /admin/v2/namespaces/{tenant}/{namespace}](https://pulsar.apache.org/admin-rest-api/?version=master&apiversion=v2#operation/createNamespace) + +<!--Java admin API--> + +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). + +<!--END_DOCUSAURUS_CODE_TABS--> + +## 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. + +<!--DOCUSAURUS_CODE_TABS--> + +<!--Admin CLI--> + +``` +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 \ Review comment: Let's decouple the documentation change into two different pull requests. The documentation here can simply be copied to other releases to improve the documentation there. `bin/pulsar-admin bookies list-bookies` is a separate command introduced in 2.8.0. Let's not couple them together. When people try to set bookie track, people already know which bookie to set the track information. The bookie can be found in many different ways. I don't think we should add `bookies list-bookies` to confuse people. One note that Yu can add is that the `set-bookie-rack` is to specify the track information for only one bookie. If people want to specify the track for all bookies, they have to run the command for individual bookie. But they can put a script when starting a bookie to set its rack. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
