当前位置:首页 > 科技新闻 > Windows编程 > 正文

Windows主机上运行Azure IoT Edge的推荐方法
2021-12-13 17:50:50

Azure IoT Edge 版本 1.2 仅支持Linux 容器。

IoT Edge 1.1 LTS 是最后一个支持 Windows 容器的版本。IoT Edge 1.1 LTS 使用 .NET Core 3.1,且有效支持期至 2022 年 12 月 3 日。


Linux 容器可以部署到 Linux 或 Windows 操作系统上:


  1. 对于 Linux 设备,IoT Edge 运行时会直接安装在主机设备上。
  2. 对于 Windows 设备,使用 IoT Edge 运行时预生成的 Linux 虚拟机会在主机设备上运行。

对于Windows 设备运行IoT Edge的推荐方式为:Azure IoT Edge for Linux on Windows(预览版),可参阅:https://docs.microsoft.com/zh-cn/azure/iot-edge/iot-edge-for-linux-on-windows?view=iotedge-2018-06&WT.mc_id=AZ-MVP-5003757


Azure IoT Edge for Linux on Windows 的工作方式是在 Windows 设备上运行 Linux 虚拟机。Linux 虚拟机预先安装了 IoT Edge 运行时。部署到该设备的任何 IoT Edge 模块都在虚拟机中运行。同时,Windows 主机设备上运行的 Windows 应用程序可以与 Linux 虚拟机中运行的模块进行通信。


Windows主机上运行Azure IoT Edge的推荐方法_microsoft


通常使用Windows Admin Center 在Windows 虚拟机上部署Mariner 虚拟机,该虚拟机内置了IoT Edge 运行时。关于Mariner Linux虚拟机,请参考:GitHub - microsoft/CBL-Mariner: Linux OS for Azure 1P services and edge appliances





Azure IoT Edge for Linux on Windows 的部署案例

参照:https://docs.microsoft.com/zh-cn/azure/iot-edge/how-to-install-iot-edge-on-windows?view=iotedge-2018-06&WT.mc_id=AZ-MVP-5003757


下载 Windows Admin Center 安装程序并安装

在 Windows Admin Center 起始页的连接列表下,你会看到一个本地主机连接,该连接表示运行 Windows Admin Center 的电脑。你管理的任何其他服务器、电脑或群集也会显示在此处。



你可以使用 Windows Admin Center 在本地设备或远程的受管理设备上安装和管理 Azure IoT Edge for Linux on Windows。在本指南中,本地主机连接将充当用于部署 Azure IoT Edge for Linux on Windows 的目标设备。

Windows主机上运行Azure IoT Edge的推荐方法_选项卡_02

选择 添加 。

在“添加或创建资源”窗格中,找到“Azure IoT Edge”磁贴。选择“新建”,以在设备上安装 Azure IoT Edge for Linux on Windows 的新实例。


Windows主机上运行Azure IoT Edge的推荐方法_选项卡_03


Windows主机上运行Azure IoT Edge的推荐方法_microsoft_04

在“2.部署”选项卡上的“选择目标设备”下,单击你的已列出设备以验证它是否满足最低要求。在确认其状态为“受支持”后,选择“下一步”。

Windows主机上运行Azure IoT Edge的推荐方法_microsoft_05

在“2.2 设置”选项卡上,查看你的部署的配置设置。对设置满意后,选择“下一步”。

Windows主机上运行Azure IoT Edge的推荐方法_选项卡_06

 备注

如果你使用的是 Windows 虚拟机,建议使用默认交换机而不是外部交换机,以确保在部署中创建的 Linux 虚拟机能够获取 IP 地址。

使用默认交换机将为 Linux 虚拟机分配内部 IP 地址。无法从 Windows 虚拟机外部访问此内部 IP 地址,但在登录到 Windows 虚拟机时可以在本地连接到此地址。

如果你使用的是 Windows Server,请注意,Azure IoT Edge for Linux on Windows 不会自动支持默认交换机。对于本地 Windows Server 虚拟机,请确保 Linux 虚拟机可以通过外部交换机获得 IP 地址。对于 Azure 中的 Windows Server 虚拟机,在部署 IoT Edge for Linux on Windows 之前,请设置一台内部交换机。

在“2.3 部署”选项卡上,你可以观察部署进度。完整的过程包括下载 Azure IoT Edge for Linux on Windows 程序包,安装该程序包,配置主机设备以及设置 Linux 虚拟机。此过程可能需要几分钟才能完成。下面描绘了一个成功的部署。

Windows主机上运行Azure IoT Edge的推荐方法_linux_07

部署完成后,便可预配设备了。选择“下一步:连接”以到“3.连接”选项卡,可以在这里处理 Azure IoT Edge 设备预配。



使用设备连接字符串预配你的设备

选择一种用于预配你的设备的方法,并按照相应部分中的说明进行操作。你可以使用 Windows Admin Center 或已提升权限的 PowerShell 会话来预配你的设备。

在“Azure IoT Edge 设备预配”窗格上,从“预配方法”下拉列表中选择“连接字符串(手动)”。




Windows主机上运行Azure IoT Edge的推荐方法_选项卡_08










声明:


本站所有内容仅代表个人观点,如与官文档冲突,请以官方文档为准。


本文摘自 :https://blog.51cto.com/u