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
description: Understand how IoT Edge devices and modules can operate without internet connection for extended periods of time, and how IoT Edge can enable regular IoT devices to operate offline too.
4
4
author: kgremban
5
-
manager: philmea
6
5
ms.author: kgremban
7
-
ms.date: 06/04/2019
6
+
ms.date: 08/04/2019
8
7
ms.topic: conceptual
9
8
ms.service: iot-edge
10
9
services: iot-edge
@@ -132,43 +131,71 @@ This setting is a desired property of the IoT Edge hub, which is stored in the m
132
131
}
133
132
```
134
133
135
-
### Additional offline storage
134
+
### Store system module states in the host filesystem
136
135
137
-
Messages are stored by default in the IoT Edge hub's container filesystem. If that amount of storage isn't sufficient for your offline needs, you can dedicate local storage on the IoT Edge device. Create an environment variable for the IoT Edge hub that points to a storage folder in the container. Then, use the create options to bind that storage folder to a folder on the host machine.
136
+
Messages are stored by default in the IoT Edge hub's container filesystem. You can also dedicate local storage on the IoT Edge device. Using the host filesystem for storage is recommended for improved reliability, especially for devices that operate offline.
138
137
139
-
You can configure environment variables and the create options for the IoT Edge hub module in the Azure portal in the **Configure advanced Edge Runtime settings** section. Or, you can configure it directly in the deployment manifest.
138
+
To set up local storage, create environment variables for the IoT Edge hub and IoT Edge agent that point to a storage folder in the container. Then, use the create options to bind that storage folder to a folder on the host machine.
139
+
140
+
You can configure environment variables and the create options for the IoT Edge hub module in the Azure portal in the **Configure advanced Edge Runtime settings** section.
141
+
142
+
1. For both IoT Edge hub and IoT Edge agent, add an environment variable called **storageFolder** that points to a directory in the module.
143
+
1. For both IoT Edge hub and IoT Edge agent, add binds to connect a local directory on the host machine to a directory in the module. For example:
144
+
145
+

146
+
147
+
Or, you can configure the local storage directly in the deployment manifest. For example:
Replace `<HostStoragePath>` and `<ModuleStoragePath>` with your host and module storage path; both host and module storage path must be an absolute path. In the create options, bind the host and module storage paths together. Then, create an environment variable that points to the module storage path.
187
+
Replace `<HostStoragePath>` and `<ModuleStoragePath>` with your host and module storage path; both values must be an absolute path.
168
188
169
189
For example, `"Binds":["/etc/iotedge/storage/:/iotedge/storage/"]` means the directory **/etc/iotedge/storage** on your host system is mapped to the directory **/iotedge/storage/** on the container. Or another example for Windows systems, `"Binds":["C:\\temp:C:\\contemp"]` means the directory **C:\\temp** on your host system is mapped to the directory **C:\\contemp** on the container.
170
190
171
-
You can also find more details about create options from [docker docs](https://docs.docker.com/engine/api/v1.32/#operation/ContainerCreate).
191
+
On Linux devices, make sure that the IoT Edge hub's user profile, UID 1000, has read, write, and execute permissions to the host system directory. These permissions are necessary so that the IoT Edge hub can store messages in the directory and retrieve them later. (The IoT Edge agent operates as root, so doesn't need additional permissions.) There are several ways to manage directory permissions on Linux systems, including using `chown` to change the directory owner and then `chmod` to change the permissions. For example:
192
+
193
+
```bash
194
+
sudo chown 1000 <HostStoragePath>
195
+
sudo chmod 700 <HostStoragePath>
196
+
```
197
+
198
+
You can find more details about create options from [docker docs](https://docs.docker.com/engine/api/v1.32/#operation/ContainerCreate).
Copy file name to clipboardExpand all lines: articles/iot-edge/production-checklist.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
2
title: Prepare devices and deployments for production - Azure IoT Edge | Microsoft Docs
3
-
description: Learn how to take your Azure IoT Edge solution from development to production, including setting your devices up with the appropriate certificates and making a deployment plan for future code updates.
3
+
description: Learn how to take your Azure IoT Edge solution from development to production, including setting up your devices with the appropriate certificates and making a deployment plan for future code updates.
4
4
author: kgremban
5
5
manager: philmea
6
6
ms.author: kgremban
7
-
ms.date: 11/28/2018
7
+
ms.date: 08/09/2019
8
8
ms.topic: conceptual
9
9
ms.service: iot-edge
10
10
services: iot-edge
@@ -15,11 +15,11 @@ ms.custom: seodec18
15
15
16
16
When you're ready to take your IoT Edge solution from development into production, make sure that it's configured for ongoing performance.
17
17
18
-
The information provided in this article is not all equal. To help you prioritize, each section starts with lists that divide the work into two sections: **important** to complete before going to production, or **helpful** for you to know.
18
+
The information provided in this article isn't all equal. To help you prioritize, each section starts with lists that divide the work into two sections: **important** to complete before going to production, or **helpful** for you to know.
19
19
20
20
## Device configuration
21
21
22
-
IoT Edge devices can be anything from a Raspberry Pi to a laptop to a virtual machine running on a server. You may have access to the device either physically or through a virtual connection, or it may be isolated for extended periods of time. Either way, you want to make sure that it's configured to perform appropriately.
22
+
IoT Edge devices can be anything from a Raspberry Pi to a laptop to a virtual machine running on a server. You may have access to the device either physically or through a virtual connection, or it may be isolated for extended periods of time. Either way, you want to make sure that it's configured to work appropriately.
23
23
24
24
***Important**
25
25
* Install production certificates
@@ -47,15 +47,15 @@ Before you put any device in production you should know how you're going to mana
47
47
* IoT Edge daemon
48
48
* CA certificates
49
49
50
-
For steps to update the IoT Edge daemon, see [Update the IoT Edge runtime](how-to-update-iot-edge.md). The current methods for updating the IoT Edge daemon require physical or SSH access to the IoT Edge device. If you have many devices to update, consider adding the update steps to a script or use an automation tool like Ansible to perform updates at scale.
50
+
For more information, see [Update the IoT Edge runtime](how-to-update-iot-edge.md). The current methods for updating the IoT Edge daemon require physical or SSH access to the IoT Edge device. If you have many devices to update, consider adding the update steps to a script or use an automation tool like Ansible.
51
51
52
52
### Use Moby as the container engine
53
53
54
-
Having a container engine on a device is a prerequisite for any IoT Edge device. Only moby-engine is supported in production. Other container engines, like Docker, do work with IoT Edge and it's ok to use these engines for development. The moby-engine can be redistributed when used with Azure IoT Edge, and Microsoft provides servicing for this engine. Using other container engines on an IoT Edge device is not supported.
54
+
A container engine is a prerequisite for any IoT Edge device. Only moby-engine is supported in production. Other container engines, like Docker, do work with IoT Edge and it's ok to use these engines for development. The moby-engine can be redistributed when used with Azure IoT Edge, and Microsoft provides servicing for this engine.
55
55
56
56
### Choose upstream protocol
57
57
58
-
The protocol (and therefore the port used) for upstream communication to IoT Hub can be configured for both the Edge agent and the Edge hub. The default protocol is AMQP, but you may want to change that depending on your network setup.
58
+
The protocol (and therefore the port used) for upstream communication to IoT Hub can be configured for both the IoT Edge agent and the IoT Edge hub. The default protocol is AMQP, but you may want to change that depending on your network setup.
59
59
60
60
The two runtime modules both have an **UpstreamProtocol** environment variable. The valid values for the variable are:
61
61
@@ -64,40 +64,47 @@ The two runtime modules both have an **UpstreamProtocol** environment variable.
64
64
* MQTTWS
65
65
* AMQPWS
66
66
67
-
Configure the UpstreamProtocol variable for the Edge agent in the config.yaml file on the device itself. For example, if your IoT Edge device is behind a proxy server that blocks AMQP ports, you may need to configure the Edge agent to use AMQP over WebSocket (AMQPWS) to establish the initial connection to IoT Hub.
67
+
Configure the UpstreamProtocol variable for the IoT Edge agent in the config.yaml file on the device itself. For example, if your IoT Edge device is behind a proxy server that blocks AMQP ports, you may need to configure the IoT Edge agent to use AMQP over WebSocket (AMQPWS) to establish the initial connection to IoT Hub.
68
68
69
69
Once your IoT Edge device connects, be sure to continue configuring the UpstreamProtocol variable for both runtime modules in future deployments. An example of this process is provided in [Configure an IoT Edge device to communicate through a proxy server](how-to-configure-proxy-support.md).
70
70
71
71
## Deployment
72
72
73
73
***Helpful**
74
74
* Be consistent with upstream protocol
75
-
* Reduce memory space used by Edge hub
75
+
* Store system module statues in the host filesystem
76
+
* Reduce memory space used by the IoT Edge hub
76
77
* Do not use debug versions of module images
77
78
78
79
### Be consistent with upstream protocol
79
80
80
-
If you configured the Edge agent on your IoT Edge device to use a different protocol than the default AMQP, then you should declare the same protocol in all subsequent deployments. For example, if your IoT Edge device is behind a proxy server that blocks AMQP ports, you probably configured the device to connect over AMQP over WebSocket (AMQPWS). When you deploy modules to the device, if you don't configure the same APQPWS protocol for the Edge agent and Edge hub, the default AMQP will override the settings and prevent you from connecting again.
81
+
If you configured the IoT Edge agent on your IoT Edge device to use a different protocol than the default AMQP, then you should declare the same protocol in all future deployments. For example, if your IoT Edge device is behind a proxy server that blocks AMQP ports, you probably configured the device to connect over AMQP over WebSocket (AMQPWS). When you deploy modules to the device, configure the same APQPWS protocol for the IoT Edge agent and IoT Edge hub, or else the default AMQP will override the settings and prevent you from connecting again.
81
82
82
-
You only have to configure the UpstreamProtocol environment variable for the Edge agent and Edge hub modules. Any additional modules adopt whatever protocol is set in the runtime modules.
83
+
You only have to configure the UpstreamProtocol environment variable for the IoT Edge agent and IoT Edge hub modules. Any additional modules adopt whatever protocol is set in the runtime modules.
83
84
84
85
An example of this process is provided in [Configure an IoT Edge device to communicate through a proxy server](how-to-configure-proxy-support.md).
85
86
86
-
### Reduce memory space used by Edge hub
87
+
### Store system module states in the host filesystem
87
88
88
-
If you're deploying constrained devices with limited memory available, you can configure Edge hub to run in a more streamlined capacity and use less disk space. These configurations do limit the performance of the Edge hub, however, so find the right balance that works for your solution.
89
+
The IoT Edge hub and agent modules use local storage to maintain state and enable messaging between modules, devices, and the cloud. For better reliability and performance, configure the system modules to use storage on the host filesystem.
90
+
91
+
For more information, see [Store system module states in the host filesystem](offline-capabilities.md#store-system-module-states-in-the-host-filesystem).
92
+
93
+
### Reduce memory space used by IoT Edge hub
94
+
95
+
If you're deploying constrained devices with limited memory available, you can configure IoT Edge hub to run in a more streamlined capacity and use less disk space. These configurations do limit the performance of the IoT Edge hub, however, so find the right balance that works for your solution.
89
96
90
97
#### Don't optimize for performance on constrained devices
91
98
92
-
The Edge hub is optimized for performance by default, so it attempts to allocate large chunks of memory. This configuration can cause stability problems on smaller devices like the Raspberry Pi. If you're deploying devices with constrained resources, you may want to set the **OptimizeForPerformance** environment variable to **false** on the Edge hub.
99
+
The IoT Edge hub is optimized for performance by default, so it attempts to allocate large chunks of memory. This configuration can cause stability problems on smaller devices like the Raspberry Pi. If you're deploying devices with constrained resources, you may want to set the **OptimizeForPerformance** environment variable to **false** on the IoT Edge hub.
93
100
94
101
For more information, see [Stability issues on resource constrained devices](troubleshoot.md#stability-issues-on-resource-constrained-devices).
95
102
96
103
#### Disable unused protocols
97
104
98
-
Another way to optimize the performance of the Edge hub and reduce its memory usage is to turn off the protocol heads for any protocols that you're not using in your solution.
105
+
Another way to optimize the performance of the IoT Edge hub and reduce its memory usage is to turn off the protocol heads for any protocols that you're not using in your solution.
99
106
100
-
Protocol heads are configured by setting boolean environment variables for the Edge hub module in your deployment manifests. The three variables are:
107
+
Protocol heads are configured by setting boolean environment variables for the IoT Edge hub module in your deployment manifests. The three variables are:
101
108
102
109
***amqpSettings__enabled**
103
110
***mqttSettings__enabled**
@@ -107,7 +114,7 @@ All three variables have *two underscores* and can be set to either true or fals
107
114
108
115
#### Reduce storage time for messages
109
116
110
-
The Edge hub module stores messages temporarily if they cannot be delivered to IoT Hub for any reason. You can configure how long the Edge hub holds on to undelivered messages before letting them expire. If you have memory concerns on your device, you can lower the **timeToLiveSecs** value in the Edge hub module twin.
117
+
The IoT Edge hub module stores messages temporarily if they cannot be delivered to IoT Hub for any reason. You can configure how long the IoT Edge hub holds on to undelivered messages before letting them expire. If you have memory concerns on your device, you can lower the **timeToLiveSecs** value in the IoT Edge hub module twin.
111
118
112
119
The default value of the timeToLiveSecs parameter is 7200 seconds, which is two hours.
113
120
@@ -139,16 +146,16 @@ For an example of a tag convention, see [Update the IoT Edge runtime](how-to-upd
139
146
140
147
***Helpful**
141
148
* Review outbound/inbound configuration
142
-
*Whitelist connections
149
+
*Allow connections from IoT Edge devices
143
150
* Configure communication through a proxy
144
151
145
152
### Review outbound/inbound configuration
146
153
147
154
Communication channels between Azure IoT Hub and IoT Edge are always configured to be outbound. For most IoT Edge scenarios, only three connections are necessary. The container engine needs to connect with the container registry (or registries) that holds the module images. The IoT Edge runtime needs to connect with IoT Hub to retrieve device configuration information, and to send messages and telemetry. And if you use automatic provisioning, the IoT Edge daemon needs to connect to the Device Provisioning Service. For more information, see [Firewall and port configuration rules](troubleshoot.md#firewall-and-port-configuration-rules-for-iot-edge-deployment).
148
155
149
-
### Whitelist connections
156
+
### Allow connections from IoT Edge devices
150
157
151
-
If your networking setup requires that you explicitly whitelist connections made from IoT Edge devices, review the following list of IoT Edge components:
158
+
If your networking setup requires that you explicitly permit connections made from IoT Edge devices, review the following list of IoT Edge components:
152
159
153
160
***IoT Edge agent** opens a persistent AMQP/MQTT connection to IoT Hub, possibly over WebSockets.
154
161
***IoT Edge hub** opens a single persistent AMQP connection or multiple MQTT connections to IoT Hub, possibly over WebSockets.
@@ -164,7 +171,7 @@ This checklist is a starting point for firewall rules:
164
171
| ----- | ----- | ----- |
165
172
| mcr.microsoft.com | 443 | Microsoft container registry |
0 commit comments