All Products
Search
Document Center

Link IoT Edge:Install Link IoT Edge on Ubuntu 16.04

Last Updated:Sep 15, 2023

This topic describes how to set up the runtime environment for Link IoT Edge Standard Edition in Ubuntu 16.04.

You can install software packages for Link IoT Edge Standard Edition in Ubuntu 16.04 to Ubuntu 18.04 operating systems. You can test and verify Link IoT Edge Standard Edition based on the following platforms.

Architecture

Operating system

x86_64

Ubuntu 16.04 ~ Ubuntu 18.04

ARMv7

Ubuntu 16.04 ~ Ubuntu 18.04

ARMv8 (AArch64)

Ubuntu 16.04 ~ Ubuntu 18.04

Link IoT Edge Standard Edition can run on Ubuntu 16.04 to Ubuntu 18.04 and other versions of Ubuntu operating systems. To ensure stability and security, we recommend that you use Ubuntu 16.04 to Ubuntu 18.04 operating systems. This topic uses the x86_64 Ubuntu 16.04 platform as an example to show you how to install and deploy Link IoT Edge Standard Edition. You can download the software packages for other architectures in the "Standard Edition" section of the Download URLs topic.

Prerequisites

An Ubuntu 16.04 PC or virtual machine is prepared. The PC or virtual machine is connected to networks. For information about how to install Ubuntu 16.04, see Install Ubuntu 16.04 desktop.

Configure the runtime environment

You must configure the Link IoT Edge runtime environment on the x86_64 Ubuntu 16.04 machine.

  1. Open the on-premises terminal of the x86_64 Ubuntu 16.04 machine or the Secure Shell (SSH)-based terminal. Then, run the following command on the terminal to download and run the environment check tool:

    wget http://iotedge-web.oss-cn-shanghai.aliyuncs.com/public/testingTool/link-iot-edge_env-check.sh
    sudo chmod +x ./link-iot-edge_env-check.sh
    sudo ./link-iot-edge_env-check.sh
    Note

    You must run the link-iot-edge_env-check.sh script as a root user on a platform that supports Link IoT Edge Standard Edition. Make sure that you can run the following Linux commands in your system:

    printf, echo, cat, ls, expr, grep, test, uname, set, head, sort, cut, uniq, xargs, and ifconfig

  2. Install the required dependencies on your machine as prompted by the environment check tool. If the following information is displayed after the check is complete, Link IoT Edge can run on your machine as expected.

    1

Create an edge instance and a gateway

  1. Log on to the Link IoT Edge console.
  2. In the left-side navigation pane, click Edge Instances.
  3. Create an edge instance.
    1. Click Create Instance. In the Create Instance dialog box, enter an instance name.
      Note The instance name must be 1 to 20 characters in length, and can contain letters, digits, underscores (_), and hyphens (-).
    2. In the Gateway Products section, 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.
    3. In the Create Product dialog box, set the required parameters and click OK.
      Create Gateway Product in Link IoT Edge inherits the features of Devices > Products in the IoT Platform console. The procedure to create a product is simplified. You can create gateway products that are applicable to Link IoT Edge in a quick manner.
      Table 1. Parameters
      ParameterDescription
      Product NameThe name of the gateway product. You can search or identify gateway products by name. The name must be 4 to 30 characters in length, and can contain letters, digits, and underscores (_).
      Product DescriptionEnter a description for the product. The description must be 1 to 100 characters in length. This parameter is optional.

      After the product is created, you are redirected to the Create Instance dialog box. The created gateway product appears in the drop-down list of the Gateway Products section.

    4. In the Create Instance dialog box, click Add Gateway Device in the Gateway Devices section.
      Create Gateway Device in Link IoT Edge inherits the features of Devices > Devices in the IoT Platform console.
    5. Set the required parameters as prompted and click OK.
      Table 2. Parameters
      ParameterDescription
      ProductThe gateway product to which the device that you want to create belongs. The system automatically specifies the new gateway for this parameter.
      Device NameThe name of the gateway device. Each device name must be unique in the product. If you do not specify this parameter, the system generates a random device name.
      Note The device name must be 4 to 32 characters in length, and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:).
    6. Select the required specifications for the Link IoT Edge product based on the environment that you build. For more information, see Specifications.
    7. Optional. In the Tag Information section, click Add Tag to add tags to the instance. Tags provide an efficient method to identify and group instances. This parameter is optional.
      To set an instance tag, you must enter a tag key and tag value.
      Table 3. Parameters
      ParameterDescription
      Tag KeyYou must specify a tag key for each tag. The tag key must be 1 to 20 characters in length, and can contain letters. The key of each tag is unique for an instance.
      Tag ValueYou must specify a tag value for each tag. The tag value must be 1 to 20 characters in length, and can contain letters, digits, underscores (_), and hyphens (-).
  4. After you configure the required parameters, click OK.

Install and start Link IoT Edge

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

  1. On the Edge Instances page, click Install Software in the Actions column of the required edge instance.
    Download command
  2. Set the parameters for the installation command based on the environment, and click Generate Command.

    Generate the installation command
    Table 1. 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 is specified when you create the edge instance. The parameter value cannot be changed.

    Edge Version

    The version of Link IoT Edge.

    Operating System

    The operating system of your device. In this example, select Linux.

  3. Copy the installation command for subsequent use.

    Copy the command for installing Standard Edition on Linux
  4. Log on to your x86_64 Ubuntu 16.04 machine.

  5. Run the command copied in step 3 in any directory.
    The command is used to download, configure, and start Link IoT Edge with one click. After the command is executed, the link-iot-edge-standard.sh script is downloaded to the current directory.
    Note If this is not your first time to install and start Link IoT Edge, you can execute the link-iot-edge-standard.sh script to restart or stop Link IoT Edge, obtain its status, and modify its configuration parameters. The following figure shows the commands in the script.Additional operations
  6. Run the following command to check the status of Link IoT Edge.

    sudo ./link-iot-edge-standard.sh --status

    If the following information is displayed in the command output, Link IoT Edge is started as expected.

    Gateway is started

    You can also check the gateway status by performing the following steps: Log on to the Link IoT Edge console. In the left-side navigation pane, click Edge Instances. On the page that appears, find the edge instance that you created and click View in the Actions column. On the Gateways tab of the Instance Details page, check the gateway status.

    Gateway is online

    You can perform remote gateway management by turning on Remote Access. 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. Make sure that the role has the required permissions to manage CloudMonitor. For more information, see Access resources of other Alibaba Cloud services.
    2. Click the Monitoring tab and turn on the CloudMonitor Status switch, as shown in the following figure.
      Turn on the CloudMonitor Status switch

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

  8. Optional. Authorize other Alibaba Cloud users to perform the required operations on the instance.
    On the Edge Instances page, click Authorize in the upper-left corner of the page. In the dialog box that appears, click Add Authorization. In the dialog box that appears, set the required parameters as prompted.Authorization
    Table 6. Parameters
    ParameterDescription
    Authorized User UIDThe Alibaba Cloud account ID of the user that you want to authorize.
    Authorized InstanceThe edge instance on which you want to authorize the Alibaba Cloud account to perform remote O&M.

Use systemd to manage Link IoT Edge

Use systemd to start or stop Link IoT Edge or view the status of Link IoT Edge.

The systemd service file of Link IoT Edge is as follows:

[Unit]
Description=Link IoT Edge

[Service]
Type=forking
Restart=on-failure
ExecStart=/linkedge/gateway/build/script/iot_gateway_start.sh
ExecReload=/linkedge/gateway/build/script/iot_gateway_start.sh
ExecStop=/linkedge/gateway/build/script/iot_gateway_stop.sh

[Install]
WantedBy=multi-user.target

Run the following commands to download the service file and copy it to the /etc/systemd/system/ directory.

wget http://iotedge-web.oss-cn-shanghai.aliyuncs.com/public/testingTool/LinkIoTEdge.service
sudo cp LinkIoTEdge.service /etc/systemd/system/LinkIoTEdge.service

Run the following commands to start or restart Link IoT Edge:

  • Start Link IoT Edge: sudo systemctl start LinkIoTEdge.service
  • Restart Link IoT Edge: sudo systemctl restart LinkIoTEdge.service

Run the following command to stop Link IoT Edge:

sudo systemctl stop LinkIoTEdge.service

Run the following command to enable service running at startup:

sudo systemctl enable LinkIoTEdge.service

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