This topic describes how to build the runtime environment on Ubuntu 16.04 for the Standard edition of Link IoT Edge (LE Standard).
|x86_64||Ubuntu 16.04 to Ubuntu 18.04|
|ARMv7||Ubuntu 16.04 to Ubuntu 18.04|
|ARMv8 (AArch64)||Ubuntu 16.04 to 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 describe how to install and deploy Link IoT Edge Standard Edition. You can download the software packages for other architectures. For more information, see Download URLs.
An Ubuntu 16.04 personal computer or virtual machine is prepared. The personal computer or virtual machine are 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.
- Open the local terminal of the x86_64 Ubuntu 16.04 machine or the SSH terminal. Then,
run the following command in the terminal to download and run the environment check
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.shNote You must run the link-iot-edge_env-check.sh script as a root user on the platform that supports Link IoT Edge Standard Edition. You must ensure 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.
- Install the required dependencies on your machine as prompted by the environment check
tool. If the following information is displayed after the check is completed, Link
IoT Edge can run on your machine as expected.
Create an edge instance and a gateway
- In the left-side navigation pane of the IoT Platform console, choose .
- Create an edge instance.
- 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 (-).
- 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.
- 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 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.
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.
- In the Create Instance dialog box, click Create Gateway Device under Gateway Devices.
Create Gateway Device in Link IoT Edge inherits the features ofin the IoT Platform console.
- 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 (:).
- Set Instance Type of Link IoT Edge based on the environment that you built. For more information, see Specifications.
- 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.
- Click Create Instance. In the dialog box that appears, set Instance Name.
- 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.
- In the left-side navigation pane of the IoT Platform console, choose Install Software in the Actions column.
, find the created instance, and click
- Specify the parameters for the installation command based on the environment, and
click 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 Linux.
- Copy the installation command for subsequent use.
- Log on to your x86_64 Ubuntu 16.04 machine.
- 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.
- Run the following command to check the running status of the Link IoT Edge service.
sudo ./link-iot-edge-standard.sh --status
If the following information is displayed in the command output, the Link IoT Edge service is launched as expected.
You can also log on to the IoT Platform console. In the left-side navigation pane, choose . 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.
You can perform remote gateway management by enabling the Remote Access feature. For more information about the procedure, see Remote service access.
- Optional. On the Instance Details page, check the CPU utilization, memory usage, and storage usage, and authorize instance
processes to access CloudMonitor.
- 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.
- Click the Monitoring tab and turn on CloudMonitor Status, as shown in the following figure.
After CloudMonitor Status is turned on, you can view monitoring information of the gateway on the Monitoring page.
- 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.
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.
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:
- On the Instance Details page, click Deploy in the upper-right corner. In the message that appears, click OK.
- 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.