You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en_US/dashboard/cluster_settings.md
+5
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
EMQX provides hot configuration capabilities, which can dynamically modify the configuration at runtime without restarting the EMQX node. The EMQX Dashboard provides a visual configuration page for the hot configuration function, allowing you to easily modify the configuration of EMQX. The following configuration items are currently provided:
4
4
5
5
- MQTT Settings
6
+
- Namespace
6
7
- Listeners
7
8
- Logging
8
9
- Monitoring
@@ -44,6 +45,10 @@ You can configure settings for the following fields in the **Force Shutdown** ta
44
45
-**Max Heap Size**: Specifies the maximum allowed heap size for the system. If the heap size surpasses this limit, the system will initiate a forced shutdown to maintain stability. The default value is `32 MB`.
45
46
-**Max Mailbox Size**: Defines the maximum allowed length for the mailbox message queue. If the queue exceeds this length, a forced shutdown will be triggered to prevent system overload. The default value is `1000`.
46
47
48
+
## Namespace
49
+
50
+
The Namespace feature in EMQX provides logical isolation for different client groups within a single cluster. You can manage namespaces on the **Namespace **page. For more detailed guidance on how to manage and configure namespaces, refer to the [Namespace](../multi-tenancy/namespace.md).
51
+
47
52
## Listeners
48
53
49
54
Click on **Management** -> **Listeners** in the left menu to enter the listeners page. This page displays a list of listeners by default. EMQX provides four common listeners:
Most of the namespace features are only configurable via the [REST API](../admin/api.md).
39
-
40
-
::: tip
41
-
42
-
Always check the corresponding Swagger API documentation for detailed and up-to-date request and response endpoint schemas. These are served by the Dashboard listeners at `/api-docs`.
43
-
44
-
:::
45
-
46
-
### Create a Namespace
36
+
### Methods for Creating a Namespace
47
37
48
-
Before applying namespace-specific configuration, the namespace must be explicitly created using the `POST /mt/ns/<namespace>` API. Replace `<namespace>` with the desired namespace ID. No request body is required.
38
+
There are two methods for creating namespaces: explicit creation and automatic creation.
49
39
50
-
### Configure Namespace
40
+
1.**Explicit Namespace Creation**
41
+
You can manually create a namespace through the Dashboard or REST API. Explicitly created namespaces can be directly managed, edited, and deleted.
51
42
52
-
After the namespace is created, it can be configured using the `PUT /mt/ns/<namespace>/config` API.
43
+
**Use Case**: This method is ideal when you need full control over which namespaces exist and wish to manage them individually.
53
44
54
-
Use this endpoint to set rate limits, session limits, and other namespace-specific settings. For example configurations, see the [Quick Start](#configure-rate-limiter-per-namespace) section below.
45
+
2.**Automatic Namespace Creation via EMQX Extracting `client_attrs.tns`**
46
+
When clients connect, EMQX can automatically create namespaces based on the client’s `client_attrs.tns` attribute. This method is usually used in scenarios where manual namespace creation is not necessary and is suitable for large-scale automated deployments.
55
47
56
-
### Delete a Namespace
48
+
**Use Case**: This approach works best for environments where clients connect dynamically, and each tenant or client requires an automatically generated, independent namespace.
57
49
58
-
To remove a namespace and its associated configuration, you can use the `DELETE /mt/ns/<namespace>` API.
50
+
::: tip Note
59
51
60
-
::: tip Note
52
+
Automatically created namespaces cannot be edited in the Dashboard. They are generated either through configuration files or automatically based on client metadata.
61
53
62
-
Before deleting a namespace, ensure that all active clients associated with the namespace are properly disconnected. EMQX provides an API to bulk kick all sessions under a namespace, and this process should be triggered automatically when deleting a managed namespace.
54
+
:::
63
55
64
-
:::
56
+
With these two methods, you can choose the most appropriate way to create namespaces based on your needs. Explicit creation is ideal for environments requiring strict control, while automatic creation is suitable for dynamic environments with reduced manual intervention.
65
57
66
58
## Quick Start: Configure Rate Limiter per Namespace
67
59
@@ -87,13 +79,13 @@ For more details, refer to the [Rate Limit](../rate-limit/rate-limit.md) documen
87
79
88
80
:::
89
81
90
-
##Configuration Example
82
+
### Example of Configuring a Namespace via REST API
91
83
92
-
Suppose you want to configure some specific rate limits for clients in the `ns1` namespace. You also want to limit the maximum number of concurrent sessions allowed in this namespace.
84
+
This example configures a namespace using the [REST API](../admin/api.md). Suppose you want to configure some specific rate limits for clients in the `ns1` namespace. You also want to limit the maximum number of concurrent sessions allowed in this namespace.
93
85
94
-
### Create the Namespace
86
+
####Create the Namespace
95
87
96
-
Before applying any configuration, ensure the namespace is explicitly managed:
88
+
Before applying any configuration, ensure the namespace is explicitly created:
97
89
98
90
```bash
99
91
# No request body is needed
@@ -102,11 +94,11 @@ POST /mt/ns/ns1
102
94
103
95
::: tip Important Notice
104
96
105
-
If clients connect to a namespace before it is explicitly managed, they will not inherit configurations such as rate limiters applied later. To enforce new settings, those clients must be manually disconnected and reconnected.
97
+
If clients connect to a namespace before it is explicitly created, they will not inherit configurations such as rate limiters applied later. To enforce new settings, those clients must be manually disconnected and reconnected.
106
98
107
99
:::
108
100
109
-
### Configure Rate Limits and Session Limits
101
+
####Configure Rate Limits and Session Limits
110
102
111
103
Once the namespace is created, apply the configuration using:
112
104
@@ -148,7 +140,7 @@ PUT /mt/ns/ns1/config
148
140
149
141
This configuration applies both client-specific and shared tenant-wide rate limits and sets a maximum of 100 sessions for the namespace.
150
142
151
-
### Disable Namespace Rate Limiters
143
+
####Disable Namespace Rate Limiters
152
144
153
145
If you want to remove rate limiting entirely, you can update the configuration again and set the limiter types to `"disabled"`:
154
146
@@ -166,3 +158,99 @@ PUT /mt/ns/ns1/config
166
158
}
167
159
}
168
160
```
161
+
162
+
## Manage Namespace
163
+
164
+
You can configure and manage namespaces through the Dashboard and REST API.
165
+
166
+
### Manage Namespaces via Dashboard
167
+
168
+
In the Dashboard, click **Manage** -> **Namespace** in the left menu. On the **Namespaces** page, you can view, create, edit, and delete namespaces, as well as manage clients connected to namespaces.
169
+
170
+
By default, the namespace list only shows explicitly created namespaces. You can toggle the switch at the top left of the page to show both explicitly created namespaces and those automatically created by EMQX from the `client_attrs.tns` attribute.
171
+
172
+
::: tip
173
+
174
+
Automatically created namespaces cannot be edited in the Dashboard.
175
+
176
+
:::
177
+
178
+
#### Create a Namespace
179
+
180
+
1. Click **Create** in the top right corner of the **Namespaces** page.
181
+
182
+
2. In the **Create Namespace** dialog, complete the following configuration:
183
+
184
+
-**Namespace**: Enter the namespace name.
185
+
186
+
-**Max Sessions**: By default, this is set to `infinity` (unlimited). If enabled, you can set a specific number to limit the maximum number of sessions, preventing too many clients from occupying resources in a single namespace. When setting the max sessions, ensure it aligns with your cluster capacity to avoid rejected connections due to a low limit.
187
+
188
+
-**Tenant Limiter**: This configuration controls the traffic for all clients within the namespace. For instance, when multiple clients share the same infrastructure, tenant rate limits ensure fair bandwidth distribution. By default, this is disabled. If enabled, you can configure the following rate limits:
189
+
190
+
::: tip
191
+
192
+
For more details on this configuration, refer to the tooltips in the Dashboard.
193
+
194
+
:::
195
+
196
+
-**Data Publish Rate**: Limits the bytes the current tenant can send to EMQX per second.
197
+
-**Data Publish Burst**: Allows additional bytes to be sent during bursts.
198
+
-**Messages Publish Rate**: Limits the maximum number of messages a tenant can send per second.
199
+
-**Messages Publish Burst**: Allows additional messages to be sent during bursts.
200
+
201
+
-**Client Limiter**: This configuration controls traffic for individual clients. Client rate limiters are exclusive to each client, meaning the rate limit for one client won’t affect others. By default, this is disabled. If enabled, you can configure the following rate limits:
202
+
203
+
::: tip
204
+
205
+
For more details on this configuration, refer to the tooltips in the Dashboard.
206
+
207
+
:::
208
+
209
+
-**Data Publish Rate**: Limits the bytes a client can send to EMQX per second.
210
+
-**Data Publish Burst**: Allows additional bytes to be sent during bursts.
211
+
-**Messages Publish Rate**: Limits the maximum number of messages a client can send per second.
212
+
-**Messages Publish Burst**: Allows additional messages to be sent during bursts.
213
+
214
+
3. After completing the configuration, click **Create**. The new namespace will appear in the list.
215
+
216
+
#### Manage Namespaces
217
+
218
+
To edit the settings for a specific namespace, click **Edit** in the **Actions** column for that namespace.
219
+
220
+
To delete a namespace, click **Delete** in the **Actions** column. After confirming, the namespace will be permanently deleted.
221
+
222
+
::: tip Note
223
+
224
+
Before deleting a namespace, ensure that all active clients associated with the namespace are properly disconnected.
225
+
226
+
:::
227
+
228
+
To view clients connected to a specific namespace, click **Clients** in the **Actions** column. You can also choose to bulk disconnect clients.
229
+
230
+
### Manage Namespaces via REST API
231
+
232
+
::: tip
233
+
234
+
Always check the corresponding Swagger API documentation for detailed and up-to-date request and response endpoint schemas. These are served by the Dashboard listeners at `/api-docs`.
235
+
236
+
:::
237
+
238
+
### Create a Namespace
239
+
240
+
Before applying namespace-specific configuration, the namespace must be explicitly created using the `POST /mt/ns/<namespace>` API. Replace `<namespace>` with the desired namespace ID. No request body is required.
241
+
242
+
### Configure Namespace
243
+
244
+
After the namespace is created, it can be configured using the `PUT /mt/ns/<namespace>/config` API.
245
+
246
+
Use this endpoint to set rate limits, session limits, and other namespace-specific settings. For example configurations, see the [Quick Start](#quick-start-configure-rate-limiter-per-namespace) section below.
247
+
248
+
### Delete a Namespace
249
+
250
+
To remove a namespace and its associated configuration, you can use the `DELETE /mt/ns/<namespace>` API.
251
+
252
+
::: tip Note
253
+
254
+
Before deleting a namespace, ensure that all active clients associated with the namespace are properly disconnected. EMQX provides an API to bulk kick all sessions under a namespace, and this process should be triggered automatically when deleting a managed namespace.
0 commit comments