Skip to content

Commit f2bd82a

Browse files
authored
Merge branch 'release-aio-ga' into ga-1112sync
2 parents 2c7adc8 + c3bb4a3 commit f2bd82a

15 files changed

+213
-147
lines changed

articles/iot-operations/create-edge-apps/concept-about-state-store-protocol.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ ms.topic: concept-article
88
ms.date: 10/30/2024
99

1010
# CustomerIntent: As a developer, I want understand what the MQTT broker state store protocol is, so
11-
# that I can implement a client app to interact with the MQ state store.
11+
# that I can implement a client app to interact with the state store.
1212
ms.service: azure-iot-operations
1313
---
1414

15-
# MQTT broker state store protocol
15+
# State store protocol
1616

17-
The MQ state store is a distributed storage system within the Azure IoT Operations cluster. The state store offers the same high availability guarantees as MQTT messages in MQTT broker. According to the MQTT5/RPC protocol guidelines, clients should use MQTT5 to interact with the MQ state store. This article provides protocol guidance for developers who need to implement their own MQTT broker state store clients.
17+
The state store is a distributed storage system within the Azure IoT Operations cluster. The state store offers the same high availability guarantees as MQTT messages in MQTT broker. According to the MQTT5/RPC protocol guidelines, clients should use MQTT5 to interact with the state store. This article provides protocol guidance for developers who need to implement their own state store clients.
1818

19-
## State store protocol overview
20-
The MQ state store supports the following commands:
19+
## Overview
20+
21+
The state store supports the following commands:
2122

2223
- `SET` \<keyName\> \<keyValue\> \<setOptions\>
2324
- `GET` \<keyName\>
@@ -71,7 +72,7 @@ sequenceDiagram
7172

7273
The commands `SET`, `GET`, and `DEL` behave as expected.
7374

74-
The values that the `SET` command sets, and the `GET` command retrieves, are arbitrary binary data. The size of the values is only limited by the maximum MQTT payload size, and resource limitations of MQ and the client.
75+
The values that the `SET` command sets, and the `GET` command retrieves, are arbitrary binary data. The size of the values is only limited by the maximum MQTT payload size, and resource limitations of MQTT broker and the client.
7576

7677
### `SET` options
7778

@@ -120,7 +121,7 @@ The following example output shows state store RESP3 payloads:
120121
```
121122

122123
> [!NOTE]
123-
> Note that `SET` requires additional MQTT5 properties, as explained in the section [Versioning and hybrid logical clocks](#versioning-and-hybrid-logical-clocks).
124+
> `SET` requires additional MQTT5 properties, as explained in the section [Versioning and hybrid logical clocks](#versioning-and-hybrid-logical-clocks).
124125
125126
### Response format
126127

@@ -421,7 +422,7 @@ The topic is defined in the following example. The `clientId` is an upper-case h
421422
clients/statestore/v1/FA9AE35F-2F64-47CD-9BFF-08E2B32A0FE8/{clientId}/command/notify/{keyName}
422423
```
423424

424-
As an example, MQ publishes a `NOTIFY` message sent to `client-id1` with the modified key name `SOMEKEY` to the topic:
425+
As an example, MQTT broker publishes a `NOTIFY` message sent to `client-id1` with the modified key name `SOMEKEY` to the topic:
425426

426427
```console
427428
clients/statestore/v1/FA9AE35F-2F64-47CD-9BFF-08E2B32A0FE8/636C69656E742D696431/command/notify/534F4D454B4559`

articles/iot-operations/create-edge-apps/edge-apps-overview.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The following sections explain the settings and features that contribute to a ro
2121

2222
## Quality of service (QoS)
2323

24-
Both publishers and subscribers should use [QoS-1](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901236) to guarantee message delivery at least once. The broker stores and retransmits messages until it receives an acknowledgment (ACK) from the recipient, ensuring no messages are lost during transmission.
24+
Both publishers and subscribers should use [QoS-1](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901236) to guarantee message delivery at least once. The MQTT broker stores and retransmits messages until it receives an acknowledgment (ACK) from the recipient, ensuring no messages are lost during transmission.
2525

2626
## Session type and Clean-Session flag
2727

@@ -55,13 +55,13 @@ MQTT subscriptions with QoS-1 ensure eventual consistency across identical appli
5555

5656
[Shared subscriptions](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901250) enable load balancing across multiple instances of a highly available application. Instead of each subscriber receiving a copy of every message, the messages are distributed evenly among the subscribers. MQTT broker currently only supports a round robin algorithm to distribute messages allowing an application to scale out. A typical use case is to deploy multiple pods using Kubernetes ReplicaSet that all subscribe to MQTT broker using the same topic filter in shared subscription.
5757

58-
## Use MQTT broker's built-in key-value store (distributed HashMap)
58+
## State store
5959

60-
MQTT broker's built-in key-value store is a simple, replicated in-memory *HashMap* for managing application processing state. Unlike *etcd*, for example, MQTT broker prioritizes high-velocity throughput, horizontal scaling, and low latency through in-memory data structures, partitioning, and chain-replication. It allows applications to use the broker's distributed nature and fault tolerance while accessing a consistent state quickly across instances. To use the built-in key-value store provided by the distributed broker:
60+
State store is a replicated in-memory *HashMap* for managing application processing state. Unlike *etcd*, for example, state store prioritizes high-velocity throughput, horizontal scaling, and low latency through in-memory data structures, partitioning, and chain-replication. It allows applications to use the state stores distributed nature and fault tolerance while accessing a consistent state quickly across instances. To use the built-in key-value store provided by the distributed broker:
6161

6262
* Implement ephemeral storage and retrieval operations using the broker's key-value store API, ensuring proper error handling and data consistency. Ephemeral state is a short-lived data storage used in stateful processing for fast access to intermediate results or metadata during real-time computations. In the context of HA application, an ephemeral state helps recover application states between crashes. It can be written to disk but remains temporary, as opposed to cold storage that's designed for long-term storage of infrequently accessed data.
6363

64-
* Use the key-value store for sharing state, caching, configuration, or other essential data among multiple instances of the application, allowing them to keep a consistent view of the data.
64+
* Use the state store for sharing state, caching, configuration, or other essential data among multiple instances of the application, allowing them to keep a consistent view of the data.
6565

6666
## Use MQTT broker's built-in Dapr integration
6767

@@ -75,25 +75,15 @@ For simpler use cases an application might utilize [Dapr](https://dapr.io) (Dist
7575

7676
## Checklist to develop a highly available application
7777

78-
- Choose an appropriate MQTT client library for your programming language. The client should support MQTT v5. Use a C or Rust based library if your application is sensitive to latency.
79-
- Configure the client library to connect to MQTT broker with *clean-session* flag set to false and the desired QoS level (QoS-1).
80-
- Decide a suitable value for session expiry, message expiry, and keep-alive intervals.
81-
- Implement the message processing logic for the subscriber application, including sending an acknowledgment when the message has been successfully delivered or processed.
82-
- For multithreaded applications, configure the *max-receive* parameter to enable parallel message processing.
83-
- Utilize retained messages for keeping temporary application state.
84-
- Utilize MQTT broker's built-in key-value store to manage ephemeral application state.
85-
- Evaluate Dapr to develop your application if your use case is simple and doesn't require detailed control over the MQTT connection or message handling.
86-
- Implement shared subscriptions to distribute messages evenly among multiple instances of the application, allowing for efficient scaling.
87-
88-
## Example
89-
90-
The following example implements contextualization and normalization of data with a highly available northbound connector
91-
92-
A northbound application consists of input and output stages, and an optional processing stage. The input stage subscribes to a distributed MQTT broker to receive data, while the output stage ingests messages into a cloud data-lake. The processing stage executes contextualization and normalization logic on the received data.
93-
94-
![Diagram of a highly available app architecture.](./media/edge-apps-overview/highly-available-app.png)
95-
96-
To ensure high availability, the input stage connects to MQTT broker and sets the *clean-session* flag to false for persistent sessions, using QoS-1 for reliable message delivery, acknowledging messages post-processing by the output stage. Additionally, the application might use the built-in *HashMap* key-value store for temporary state management and the round robin algorithm to load-balance multiple instances using shared subscriptions.
78+
* Choose an appropriate MQTT client library for your programming language. The client should support MQTT v5. Use a C or Rust based library if your application is sensitive to latency.
79+
* Configure the client library to connect to MQTT broker with *clean-session* flag set to `false` and the desired QoS level (QoS-1).
80+
* Decide a suitable value for session expiry, message expiry, and keep-alive intervals.
81+
* Implement the message processing logic for the subscriber application, including sending an acknowledgment when the message has been successfully delivered or processed.
82+
* For multithreaded applications, configure the *max-receive* parameter to enable parallel message processing.
83+
* Utilize retained messages for keeping temporary application state.
84+
* Utilize the distributed state store to manage ephemeral application state.
85+
* Evaluate Dapr to develop your application if your use case is simple and doesn't require detailed control over the MQTT connection or message handling.
86+
* Implement shared subscriptions to distribute messages evenly among multiple instances of the application, allowing for efficient scaling.
9787

9888
## Related content
9989

articles/iot-operations/create-edge-apps/howto-deploy-dapr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To install the Dapr runtime, use the following Helm command:
3131
```bash
3232
helm repo add dapr https://dapr.github.io/helm-charts/
3333
helm repo update
34-
helm upgrade --install dapr dapr/dapr --version=1.13 --namespace dapr-system --create-namespace --wait
34+
helm upgrade --install dapr dapr/dapr --version=1.14 --namespace dapr-system --create-namespace --wait
3535
```
3636

3737
## Register MQTT broker pluggable components
@@ -112,7 +112,7 @@ To create the yaml file, use the following component definitions:
112112
value: /var/run/secrets/tokens/mqtt-client-token
113113
```
114114
115-
1. Apply the component yaml to your cluster by running the following command:
115+
1. Apply the Component to your cluster by running the following command:
116116
117117
```bash
118118
kubectl apply -f components.yaml
@@ -159,7 +159,7 @@ To configure authorization policies to MQTT broker, first you create a [BrokerAu
159159
- "clients/{principal.clientId}/services/statestore/#"
160160
```
161161

162-
1. Apply the BrokerAuthorizaion definition to the cluster:
162+
1. Apply the BrokerAuthorization definition to the cluster:
163163

164164
```bash
165165
kubectl apply -f aio-dapr-authz.yaml
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Persisting data in the MQTT broker state store
3+
description: Understand how to develop application that persist data between sessions using the state store.
4+
author: PatAltimore
5+
ms.subservice: azure-mqtt-broker
6+
ms.author: patricka
7+
ms.topic: concept-article
8+
ms.custom:
9+
- ignite-2023
10+
ms.date: 11/12/2024
11+
12+
#CustomerIntent: As an developer, I want understand how to develop application that persist data between sessions using the state store.
13+
ms.service: azure-iot-operations
14+
---
15+
16+
# Persisting data in the state store
17+
18+
The state store is a distributed storage system, deployed as part of Azure IoT Operations. Using the state store, applications can get, set, and delete key-value pairs, without needing to install more services, such as Redis. The state store also provides versioning of the data, and also the primitives for building distributed locks, ideal for highly available applications.
19+
20+
Like Redis, the state store uses in memory storage. Stopping or restarting the Kubernetes cluster causes the state store contents to be lost.
21+
22+
The state store is implemented via MQTTv5. Its service is integrated directly into MQTT broker and is automatically started when the broker starts. The state store provides the same high availability as the MQTT broker.
23+
24+
## Why use the state store?
25+
26+
The state store allows an edge application to persist data on the edge. Typical uses of the state store include:
27+
28+
* Creating stateless applications
29+
* Sharing state between applications
30+
* Developing highly available applications
31+
* Storing data to be used by dataflows
32+
33+
## State store authorization
34+
35+
The state store extends MQTT broker's authorization mechanism, allowing individual clients to have optional read and write access to specific keys. Read more on how to [configure MQTT broker authorization](../manage-mqtt-broker/howto-configure-authorization.md) for the state store.
36+
37+
## Interacting with the state store
38+
39+
A CLI tool is available which enables interaction with the state store from a shell running on any machine.
40+
41+
1. Generate an X.509 certificate chain for authenticating with MQTT broker
42+
1. Create a `BrokerAuthentication` using x.509 certificates
43+
1. Create a `BrokerListener` of type LoadBalancer which enables off-cluster access
44+
1. Open ports on your cluster to enable access to the MQTT broker.
45+
46+
For instructions on setting up your cluster and using the tool, refer to the [state store CLI GitHub](https://github.com/Azure-Samples/explore-iot-operations/tree/main/tools/state-store-cli) page.
47+
48+
> [!NOTE]
49+
> SDKs to interact with the state store are currently in active development, and will be available in the near future to enable edge applications to interact with the state store.
50+
51+
## Related content
52+
53+
* [Learn about the MQTT broker state store protocol](concept-about-state-store-protocol.md)
54+
* [Configure MQTT broker authorization](../manage-mqtt-broker/howto-configure-authorization.md)

articles/iot-operations/deploy-iot-ops/concept-production-guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Create an Arc-enabled K3s cluster that meets the system requirements.
3131
* [Configure the cluster](./howto-prepare-cluster.md) according to documentation.
3232
* If you expect intermittent connectivity for your cluster, ensure that you've allocated enough disk space to the cluster cache data and messages while the [cluster is offline](../overview-iot-operations.md#offline-support).
3333
* If possible, have a second cluster as a staging area for testing new changes before deploying to the primary production cluster.
34-
* [Turn off auto-upgrade for Azure Arc](/azure/azure-arc/kubernetes/agent-upgrade#toggle-automatic-upgrade-on-or-off-when-connecting-a-cluster-to-azure-arc) to have complete control over when new updates are applied to your cluster.
34+
* [Turn off auto-upgrade for Azure Arc](/azure/azure-arc/kubernetes/agent-upgrade#toggle-automatic-upgrade-on-or-off-when-connecting-a-cluster-to-azure-arc) to have complete control over when new updates are applied to your cluster. Instead, [manually upgrade agents](/azure/azure-arc/kubernetes/agent-upgrade#manually-upgrade-agents) as needed.
3535
* *For multi-node clusters*: [Configure clusters with Edge Volumes](./howto-prepare-cluster.md#configure-multi-node-clusters-for-azure-container-storage) to prepare for enabling fault tolerance during deployment.
3636

3737
### Security
@@ -64,7 +64,7 @@ In the Azure portal deployment wizard, the broker resource is set up in the **Co
6464

6565
| Setting | Single node | Multi node |
6666
| ------- | ----------- | ---------- |
67-
| **frontendReplicas** | 2 | 5 |
67+
| **frontendReplicas** | 1 | 5 |
6868
| **frontendWorkers** | 4 | 8 |
6969
| **backendRedundancyFactor** | 2 | 2 |
7070
| **backendWorkers** | 1 | 4 |

articles/iot-operations/deploy-iot-ops/howto-deploy-iot-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ A cluster host:
4848

4949
* Have an Azure Arc-enabled Kubernetes cluster with the custom location and workload identity features enabled. If you don't have one, follow the steps in [Prepare your Azure Arc-enabled Kubernetes cluster](./howto-prepare-cluster.md).
5050

51-
If you deployed Azure IoT Operations to your cluster previously, uninstall those resources before continuing. For more information, see [Update Azure IoT Operations](./howto-manage-update-uninstall.md#upgrade).
51+
If you deployed Azure IoT Operations to your cluster previously, uninstall those resources before continuing. For more information, see [Update Azure IoT Operations](./howto-manage-update-uninstall.md#uninstall).
5252

5353
* (Optional) Prepare your cluster for observability before deploying Azure IoT Operations: [Configure observability](../configure-observability-monitoring/howto-configure-observability.md).
5454

articles/iot-operations/deploy-iot-ops/howto-manage-update-uninstall.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -186,39 +186,3 @@ az iot ops delete --name <INSTANCE_NAME> --resource-group <RESOURCE_GROUP> --inc
186186
```
187187

188188
---
189-
190-
## Upgrade
191-
192-
Azure IoT Operations supports upgrading instances to new versions as they're released.
193-
194-
You can't upgrade from a preview installation to a GA version.
195-
196-
> [!NOTE]
197-
> There's a known issue with upgrading Azure IoT Operations if the MQTT broker only has one backend replica. Only upgrade Azure IoT Operations if the Broker has more than one backend replica.
198-
199-
### [Azure portal](#tab/portal)
200-
201-
1. In the [Azure portal](https://portal.azure.com), go to the resource group that contains your Azure IoT Operations instance, or search for and select **Azure IoT Operations**.
202-
203-
1. Select the name of your Azure IoT Operations instance.
204-
205-
1. On the **Overview** page of your instance, select **Upgrade**.
206-
207-
1. The **Upgrade Azure IoT Operations** wizard prompts you to make sure you have the latest version for the Azure IoT Operations CLI extension. Copy and run the provided `az extension add` command.
208-
209-
1. Update to the latest version of Azure IoT Operations instance. Copy and run the provided `az iot ops upgrade` command.
210-
211-
1. Once the upgrade command completes successfully, you can exit the wizard and refresh your instance page.
212-
213-
### [Azure CLI](#tab/cli)
214-
215-
Use the `az iot ops upgrade` command to upgrade an Azure IoT Operations deployment. This command:
216-
217-
* Upgrades Azure Arc extensions on your cluster.
218-
* Upgrades the Azure IoT Operations instance.
219-
220-
```azurecli
221-
az iot ops upgrade --resource-group <RESOURCE_GROUP> --name <INSTANCE_NAME>
222-
```
223-
224-
---

articles/iot-operations/deploy-iot-ops/howto-prepare-cluster.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ Connect your cluster to Azure Arc so that it can be managed remotely.
161161
1. Use the [az connectedk8s connect](/cli/azure/connectedk8s#az-connectedk8s-connect) command to Arc-enable your Kubernetes cluster and manage it as part of your Azure resource group.
162162

163163
```azurecli
164-
az connectedk8s connect --name <CLUSTER_NAME> -l <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID> --enable-oidc-issuer --enable-workload-identity
164+
az connectedk8s connect --name <CLUSTER_NAME> -l <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID> --enable-oidc-issuer --enable-workload-identity --disable-auto-upgrade
165165
```
166166

167+
To prevent unplanned updates to Azure Arc and the system Arc extensions that Azure IoT Operations uses as dependencies, this command disables auto-upgrade. Instead, [manually upgrade agents](/azure/azure-arc/kubernetes/agent-upgrade#manually-upgrade-agents) as needed.
168+
167169
1. Get the cluster's issuer URL.
168170

169171
```azurecli
@@ -216,7 +218,9 @@ For instructions on running the script, see [Configure an AKS Edge Essentials cl
216218

217219
### [AKS on Azure Local](#tab/azure-local)
218220

219-
For instructions on creating and Arc-enabling a cluster on Azure Local, see [Create Kubernetes clusters using Azure CLI](/azure/aks/hybrid/aks-create-clusters-cli).
221+
For instructions on creating and Arc-enabling an AKS cluster on Azure Local, see [Create Kubernetes clusters using Azure CLI](/azure/aks/hybrid/aks-create-clusters-cli).
222+
223+
Then, once you have an Azure Arc-enabled Kubernetes cluster, you can [deploy Azure IoT Operations](howto-deploy-iot-operations.md).
220224

221225
---
222226

0 commit comments

Comments
 (0)