- StreamNative Platform
- Administer
Work with namespaces
A namespace is a logical grouping of topics. After creating a tenant, you can create one or more namespaces for the tenant.
Work with namespaces using the pulsarctl CLI tool
You can create and manage namespaces using the pulsarctl CLI tool. For a full list of supported operations on namespaces, see the pulsarctl command reference.
This section uses a tenant named example-tenant
as an example. For details about how to create a tenant, see work with tenants.
Create a namespace
After creating and authorizing a tenant, you can create and manage namespaces and topics.
This example shows how to create a namespace named example-ns
for example-tenant
.
Input
pulsarctl namespaces create example-tenant/example-ns
Output
Created example-tenant/example-ns successfully
Manage a namespace
This section describes how to manage namespaces using the pulsarctl CLI tool.
Clear namespace backlog
Pulsar stores all unacknowledged messages in backlogs until they are processed and acknowledged. You can clear backlogs of messages for a specific namespace to release more backlog quota for the namespace.
This example shows how to clear the backlog for all topics of example-tenant/example-ns
.
Input
pulsarctl namespaces clear-backlog example-tenant/example-ns
Output
Are you sure you want to clear the backlog? (Y or N)
y
Successfully clear backlog for all topics of the example-tenant/example-ns
Unload a namespace
This example shows how to unload example-tenant/example-ns
from the current serving broker.
Input
pulsarctl namespaces unload example-tenant/example-ns
Output
Unload namespace example-tenant/example-ns successfully
Delete a namespace
You cannot delete a namespace if there are resources associated with the namespace.
This example shows how to delete example-tenant/example-ns
.
Input
pulsarctl namespaces delete example-tenant/example-ns
Output
Deleted example-tenant/example-ns successfully
Work with namespaces using StreamNative Console
This section describes how to create and manage namespaces using the StreamNative Console.
Create a namespace
To create a namespace, follow these steps.
On the left navigation pane, under ADMIN, click Tenants/Namespaces.
Select the name of the tenant you want to associate with the new namespace, and click New Namespace. A dialog box displays.
Enter a name for the namespace and then click Confirm. A namespace name can contain any combination of lowercase letters (a-z), numbers (0-9), and hyphens (-).
Manage a namespace
This section describes how to work with namespaces through the StreamNative Console.
Unload bundles for a namespace
For assignment, a namespace is sharded into a list of bundles, with each bundle comprising a portion of the overall hash range of the namespace. By default, four bundles are supported for each namespace.
To unload bundles for a namespace, follow these steps.
On the left navigation pane, under ADMIN, click Tenants/Namespaces.
Select the name of the tenant that is associated with the target namespace.
Click the name of the namespace that you want to manage.
Select the OVERVIEW tab.
In the Bundle section, do one of the followings:
Click Unload All to unload all bundles for the namespaces in the cluster.
Click Unload All in the Operation column to unload a specific bundle for the namespace.
Clear namespace backlog
To clear backlog for bundles of a namespace, follow these steps.
On the left navigation pane, under ADMIN, click Tenants/Namespaces.
Select the name of the tenant that is associated with the target namespace.
Click the name of the namespace that you want to clear backlog for.
Select the OVERVIEW tab.
In the Bundle section, do one of the followings:
Click Clean All Backlog to clear the backlog for all the topics of the namespace.
Click Clear All Backlog in the Operation column to clear the backlog for all the topics of the namespace bundle.
Configure policies for a namespace
To configure policies for a namespace, follow these steps.
On the left navigation pane, under ADMIN, click Tenants/Namespaces.
Select the name of the tenant that is associated with the target namespace.
Click the name of the namespace that you want to configure the policies for.
Select the POLICY tab.
Configure policies for the namespace, as outlined in the following table.
Field | Description |
---|---|
Authorization | Grant/Revoke permissions to the Admin roles in this namespace. Click ADD ROLE to set one or more service accounts as the Admin role of the namespace. Then, you can grant the following permissions to the Admin role.
Click Delete to remove a specific Admin role. |
Subscription Authentication | Configure the subscription authentication mode to limit the naming convention for subscriptions when authentication is enabled.
By default, it is set to None. |
Backlog | Configure the backlog policy for the namespace. Backlog Quota Size: configure the maximum backlog quota (in bytes) allowed for the namespace. The backlog quota size must be smaller than 1000000000 bytes. By default, it is set to -1073741824 bytes. Backlog Retention Policy: configure the backlog retention policy.
|
Schema | Configure the schema policy for the namespace.
|
Cleanup Policy | Configure the cleanup policy for the namespace.
|
Dispatch Rate | Dispatch Rate Per Topic: configure the dispatch rate based on the topic.
|
Dispatch Rate Per Subscription: configure the dispatch rate based on the subscription mode.
| |
Subscribe Rate Per Consumer: configure the rate at which a consumer subscribes to a topic.
|
Delete a namespace
You cannot delete a namespace if there are resources associated with the namespace.
To delete a namespace, follow these steps.
On the left navigation pane, under ADMIN, click Tenants/Namespaces.
Select the name of the tenant that is associated with the target namespace.
Click the name of the namespace that you want to delete.
Select the POLICY tab.
In the Warning section at the bottom of the POLICY page, click Delete Namespace. A dialog box displays asking, Are you sure you want to delete this?
Enter the namespace name and then click Confirm.