This topic describes how to set up the Docker runtime environment for Link IoT Edge Pro Edition in Windows 7 and Windows 10 operating systems. After the runtime environment is set up, you can connect gateways to the cloud.

For more information about the Link IoT Edge Pro Edition, see Specifications.

Prerequisites

  • The Docker runtime environment is installed. For information about how to install the Docker runtime environment on Windows 7, see Install Docker Toolbox on Windows. For information about how to install the Docker runtime environment on Windows 10, see Install Docker for Windows. The Docker version must be later than V17.03.
  • The latest version of the Git Bash application is installed on your Windows 7 or Windows 10 machines. To obtain the installation package and install the Git Bash application, visit the official website of the application.

Limits

  • Link IoT Edge Pro Edition can be installed only on Windows 7 and Windows 10.
  • The Git Bash application must be installed to run scripts for Link IoT Edge Pro Edition.

Create an edge instance and a gateway

  1. In the left-side navigation pane of the IoT Platform console, choose Link IoT Edge > Edge Instances.
  2. Create an edge instance.
    1. Click Create Instance. In the dialog box that appears, set Instance Name.
      Note Instance Name cannot exceed 20 characters in length and can contain letters, digits, underscores (_), and hyphens (-).
    2. On the Gateway Products page, click Create Gateway Product to create a gateway for the instance.
      Gateways in Link IoT Edge provide edge computing capabilities. Each instance must be associated with a gateway device. A gateway device can be associated with only one edge instance at a time.Create Gateway Product
    3. In the Create Product dialog box that appears, set the parameters and click OK.
      Create Gateway Product in Link IoT Edge inherits the features of Devices > Products in the IoT Platform console. The product creation procedure is simplified, which allows you to quickly create gateway products that are suitable for Link IoT Edge.Create Product
      Table 1. Parameters for creating a gateway product
      Parameter Description
      Product Name The name of the gateway product, which is used to query and identify a gateway product. The name must be 4 to 30 characters in length and can contain letters, digits, and underscores (_).
      Product Description The description of the product. You can enter a maximum of 100 characters. It can be left blank.

      After the product is created, the Create Instance dialog box appears and the created gateway product is automatically displayed under Gateway Products.

    4. In the Create Instance dialog box, click Create Gateway Device under Gateway Devices.
      Create Gateway Device in Link IoT Edge inherits the features of Devices > Devices in the IoT Platform console.Create Gateway Device
    5. Set the parameters as prompted and click OK.
      Table 2. Parameters for creating a gateway device
      Parameter Description
      Product The gateway product to which the device that you want to create belongs. The system automatically associates with the newly created gateway product.
      Device Name The name of the gateway device. The device name must be unique. If you do not specify this parameter, the system automatically generates a device name.
      Note The device name must be 4 to 32 characters in length and can contain letters, digits, and the following special characters: hyphens (-), underscores (_), at signs (@), periods (.), and colons (:).
    6. Set Instance Type of Link IoT Edge based on the environment that you built. For more information, see Specifications.
    7. Optional. In the Create Instance dialog box, click Add Tag and set instance tags. With tags, you can more effectively classify and identify instances. You can also choose not to set tags.
      To set an instance tag, you must specify Tag Key and Tag Value.
      Table 3. Parameters for adding a tag
      Parameter Description
      Tag Key The tag key cannot exceed 20 characters in length and can only contain letters. The parameter cannot be left blank and must be unique in an instance.
      Tag Value The tag value cannot exceed 20 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The parameter cannot be left blank.
  3. After the parameters of an instance are set, click OK.

Install and launch Link IoT Edge

After you create an edge instance and a gateway, you must install and start Link IoT Edge on the gateway.

  1. In the left-side navigation pane of the IoT Platform console, choose Link IoT Edge > Edge Instances, find the created instance, and click Install Software in the Actions column.
    Download command
  2. Specify the parameters for the installation command based on the environment, and click Installation Command.
    Installation command
    Table 4. Parameters
    Parameter Description
    Edge Gateway CPU Architecture The CPU architecture of your device. In this example, select x86-64.
    Instance Type The Link IoT Edge edition that you specified when you created the edge instance. In this dialog box, you cannot change the Link IoT Edge edition.
    Edge Version

    The target Link IoT Edge version that has been released.

    Operating System The operating system of your device. In this example, select Windows.
  3. Copy the installation command for subsequent use.
    Copy Command
  4. Log on to your Windows 7 or Windows 10 machine.
  5. In a directory of the Git Bash runtime environment, run the command that you copied in Step 3.
    Run the command in Git Bash to install Link IoT Edge

    You can run the command to download, configure, and launch the Link IoT Edge service. After the command is executed, the link-iot-edge.sh script is downloaded and saved in the current directory.

    • If you are starting the gateway for the first time, you must check the following items. After you complete the check, click Enter to use default configurations.
      • Check the version of Link IoT Edge.
      • Check the runtime of Function Compute. By default, functions run in independent processes.
      • Check whether the stream processing feature has been enabled. By default, the stream processing feature is enabled.
      • Check whether the previous version has been uninstalled. By default, the previous version is uninstalled.

      You may require 5 to 10 minutes to pull and launch the Docker image. You can run the docker ps command to check whether the Docker container has been launched. If the following information is displayed in the command output, the Docker container is launched as expected.

      View the execution result.
    • If you are not launching Link IoT Edge for the first time, you can run the link-iot-edge.sh script that has been downloaded to manage the Link IoT Edge service. For example, you can relaunch or stop the Link IoT Edge service. You can also retrieve the status of the service, or change the configuration parameters of the service. The command details are described as follows:Link IoT Edge management
  6. Log on to the IoT Platform console. In the left-side navigation pane, choose Link IoT Edge > Edge Instances. On the page that appears, find the target edge instance, and click View in the Actions column. On the Gateways tab of the Instance Details page, check the gateway status.
    Online gateway

    You can perform remote gateway management by enabling the remote access feature. For more information about the procedure, see Remote service access.

  7. Optional. On the Instance Details page, check the CPU utilization, memory usage, and storage usage, and authorize instance processes to access CloudMonitor.
    1. Add a role or attach an existing role to a user and assign CloudMonitor management permissions to the role by referring to Access resources of other Alibaba Cloud services.
    2. Click the Monitoring tab and turn on CloudMonitor Status, as shown in the following figure.
      Turn on CloudMonitor Status

      After CloudMonitor Status is turned on, you can view monitoring information of the gateway on the Monitoring page.

  8. Optional. On the Instance Details page, click the Gateways tab and turn on Remote Access to remotely manage the gateway. For more information, see Remote service access.
  9. Optional. Authorize other Alibaba Cloud users to perform operations, administration, and management (OAM) on the instance.
    On the Edge Instances page, click Authorize in the upper-left corner. In the dialog box that appears, click Add Authorization. In the dialog box that appears, set parameters as prompted.User authorization
    Table 5. Parameters for user authorization
    Parameter Description
    Authorized User UID The Alibaba Cloud account ID of the user that you want to authorize.
    Authorized Instance The edge instance on which you want to authorize the Alibaba Cloud account to perform OAM.

Additional operations on Link IoT Edge

  • Reconfigure Link IoT Edge.

    Run the following command to modify the configurations of Link IoT Edge of a specific version:

    ./link-iot-edge.sh --reconfig {Version}

    Replace {Version} with the version of Link IoT Edge that you want to modify the configurations. For example, if the version is V1.8.2, run the ./link-iot-edge.sh --reconfig V1.8.2 command.

  • Stop Link IoT Edge.

    Run the following command to stop all containers running Link IoT Edge. However, the containers are not deleted.

    ./link-iot-edge.sh --stop
  • Restart Link IoT Edge.

    If a container is available but is not running, run the following command to restart Link IoT Edge:

    ./link-iot-edge.sh --restart {Version}

    Replace {Version} with the version of Link IoT Edge that you want to restart. For example, if the version is V1.8.2, run the ./link-iot-edge.sh --restart V1.8.2 command.

  • Clean Link IoT Edge.

    Run the following command to clean containers running Link IoT Edge and delete all installed images, volumes, and startup configuration files.

    ./link-iot-edge.sh --clean
  • Extract Link IoT Edge logs.

    Run the following command to package all Link IoT Edge logs and copy the package to the current directory:

    ./link-iot-edge.sh --packagelog

What to do next

After the environment is built, you can connect your devices to Link IoT Edge by referring to Device access. You can also allocate additional resources, such as Function Compute resources and message routers, to edge instances to manage your devices.

After you connect a device to Link IoT Edge or allocate additional resources to an edge instance, you must perform the following steps to deploy the edge instance:

  1. On the Instance Details page, click Deploy in the upper-right corner. In the message that appears, click OK.
  2. If the deployment status is Deployed, the instance is deployed. You can click View Logs to view deployment details. You can also click View Deployment Logs in the upper-right corner of the Instance Details page to view the deployment history.
    View Deployment Logs