我正在从事一个Azure IoT边缘项目。目前,我正在通过生产准备清单。我按照文档介绍了使用主机文件系统上的存储中的edgeAgent和edgeHub模块。
当我运行sudo iotedge check时,edgeHub是可以的,但是edgeAgent会发出警告:
‼ production readiness: Edge Agent's storage directory is persisted on the host filesystem - Warning
The edgeAgent module is not configured to persist its /tmp/edgeAgent directory on the host filesystem.
Data might be lost if the module is deleted or updated.
Please see https://aka.ms/iotedge-storage-host for best practices.
√ production readiness: Edge Hub's storage directory is persisted on the host filesystem - OK下面是来自部署模板的片段:
"systemModules": {
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"createOptions": {
"HostConfig": {
"Binds": [
"/home/pi/iotedge/edgeAgent/storage/:/iotedge/storage/"
]
}
}
},
"env": {
"storageFolder": {
"value": "/iotedge/storage/"
}
}
},
"edgeHub": {
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"createOptions": {
"HostConfig": {
"Binds": [
"/home/pi/iotedge/edgeHub/storage:/iotedge/storage/"
],
"PortBindings": {
"5671/tcp": [
{
"HostPort": "5671"
}
],
"8883/tcp": [
{
"HostPort": "8883"
}
],
"443/tcp": [
{
"HostPort": "443"
}
]
}
}
}
},
"env": {
"storageFolder": {
"value": "/iotedge/storage/"
}
}
}
},发布于 2020-04-25 03:11:40
在1.0.9版中,edgeAgent的配置不更新,除非它的图像标记被更新,这是一个问题。来自当前状态的两个选项:
mcr.microsoft.com/azureiotedge-agent:1.0.9docker rm -f edgeAgent。它将在30秒内重新启动,并将获取新的storageFolder env。在更新容器后再次运行“iotedge检查”,此警告将消失。
发布于 2020-04-24 21:16:41
我遵循了相同的文档,并能够避免在我的Raspberry Pi 3的生产准备清单警告。
1)我按照文档链接模块存储到设备存储配置了“绑定”
"Binds":["/etc/iotedge/storage/:/iotedge/storage/"]2)从SSH终端为用户提供了HostStoragePath上的用户访问。
sudo chown 1000 /etc/iotedge/storage/
sudo chmod 700 /etc/iotedge/storage/3)重新启动Raspberry Pi 3,以确保授权访问生效。
https://stackoverflow.com/questions/61416917
复制相似问题