百度智能云

All Product Document

          Intelligent Edge

          Node Management

          Feature Introduction

          The node is the mapping of the edge device in the cloud. A node in the cloud represents an edge device. On completion of node installation for the edge device, you can manage the edge device by creating the node in the cloud. Furthermore, you can also view the existing node, edit the node information and delete the node in the cloud.

          Operation Instruction

          The operation on node includes the create node, delete node, edit node, and install node.

          Create node

          Click "Create Node" on the edge node page to enter the Node Creation page.

          image.png

          image.png

          • Name: Node name, which cannot be empty or duplicated.
          • Description: Description, which can be empty.
          • Tag: It allows you to identify nodes. You can use it for the associated application. You do not need to bind any tag or can bind multiple tags.
          • Certification mode: The node end cloud uses the certificate synchronously (mandatory).

          Click "OK" to complete the node creation, and you can view the created node in the node list.

          image.png

          Delete node

          Click "Delete" on the Node List page to pop up the OK window.

          image.png

          Click "OK" to delete the node.

          Edit node

          Click "Node" to enter the Node Details page. Then, you can edit the description information and tag of the node, add a new tag, modify the existing tag key-value, or delete the existing tag.

          image.png

          Install node

          Currently, you can install a node online in Kube mode. The baetyl operation mode includes k3s+docker and k3s+containerd. The users can select the operating environment installation command according to the actual needs. Note that you need to install the docker before installing k3s if you select the k3s+docker operating environment.

          • Node installation-container.

          image.png

          • Node installation-docker

          image.png

          After the operating environment gets ready, execute the node installation command to install the edge node, whose effect is as follows:

          image.png

          The services baetyl-core, <13>baetyl-core, <14>baetyl-init, <15>baetyl-function, baetyl-rule and baetyl-broker will be deployed on baetyl-edge-system when the node is installed in above two modes. View that the Pod in the baetyl-edge-system namespace is running, which means that the node is installed completely.

          image.png

          View a node

          You can see that the node has been connected on the Node Details page, indicating the node details and resource utilization.

          image.png

          Click the Application Deployment menu on the left column to view the deployed application-related information and resource utilization.

          ![image.png](https://bce.bdstatic.com/doc/bce-doc/BIE/image\_ead28c8.png

          Node shadow

          The node shadow can be regarded as the mapping of edge device data in the cloud. You can utilize the end cloud synchronization channel to synchronize the cloud node data or property with the edge device through the node shadow. The application on the edge device can obtain data from the cloud through the relevant interface, and update the data through the interface, and then synchronize it to the cloud. In short, the node shadow is a way to synchronize the custom data in the cloud.

          The data format for synchronization is in the form of key-value pair, and the data type is a string. The data content is not limited. For example, when you need to synchronize the configuration file, you can specify the property name as the configuration file name and the expected value as the file content. The device can receive the configuration file synchronized on the cloud. Thus, you can use the configuration file for the hot update of the application.

          The specific usage is as follows: Click the Node Shadow tag on the Cloud Node page to display that the existing property of this node is empty. Then, carry out three operations for the node shadow on the edge device. The first operation is that the edge application subscribes to the system MQTT broker-related topics and receives the property update message from the cloud. The second operation is to obtain all properties of this node in the cloud through OpenAPI. The third operation is to update the property through OpenAPI and send the updated property to the cloud for display as the report value.

          1. Receive data incremental update message of node shadow

          To simulate the subscription of the system MQTT broker from an application, it is necessary to adjust the configuration of the system broker firstly. Note that this is for the convenience of operation only. During the real subscription of an application topic, it is recommended to connect the system MQTT broker through TLS. The following gives the descriptions. image.png

          Click "Edit" to add properties image.png

          Click "OK", and you can view relevant properties in the property list.

          image.png

          Then, all properties will synchronize to the edge device through the end cloud collaboration, and the notification will be issued through incremental updating. The specific operation is to subscribe to relevant topics through MQTT and receive the event message. The message content is the property key-value pair to be updated.

          Typically, the edge-run application subscribes to the system MQTT broker. You have to modify the application configuration of the node system broker to subscribe to the topics here.

          Click "Node Application Deployment", and enter the system broker application (with the broker in the name) to modify the configuration.

          image.png

          Click "Application Configuration"

          image.png

          Add the port configuration, configure the 1883->1883 port mapping, and click "OK".

          image.png

          Then, switch to the data volume tag, and enter the conf volume (with conf in the name) to modify the configuration.

          image.png

          Click "Edit"

          image.png

          Add listeners

          image.png

          The content is

          listeners:
            - address: 'tcp://0.0.0.0:1883'
          session:
            sysTopics:
              - $link
              - $baetyl
          logger:
            level: debug
            encoding: console

          After modification, click "Save", and click "OK".

          image.png

          Open MQTT Box, and configure the device host.

          image.png

          Confirm that it is connected to the device MQTT broker, and subscribe to the $baetyl/node/props topic.

          image.png,

          After that, you will receive a message from this topic, whose content is the cloud node property.

          image.png

          Actual scenario

          In general, the edge application subscribes to the system MQTT broker in the bidirectional TLS mode, to ensure the safe transmission of data. It is directly connected securely through the interface provided by the official baetyl sdk. Furthermore, you can specify the connection address as ssl: //baetyl-broker.baetyl-edge-system: 50010, and configure the connection certificate. There is the certificate required for the connection under the /var/lib/baetyl/system/certs path for the application deployed by BIE.

          2. Obtain the node shadow property through OpenAPI

          It shall be connected to the server in HTTPS mode through OpenAPI by using the certificate. There is the ca.pemcertificate required for the connection under the /var/lib/baetyl/system/certs path for the application deployed by BIE, the connection address in the HTTPS protocol mode is https: //baetyl-core.baetyl-edge-system. The interface to obtain the node shadow property is https: //baetyl-core.baetyl-edge-system/node/properties.

          Here, skip the server certificate verification by simulation. Also, the baetyl-core application configures the port mapping 30050->80.

          image.png

          There is the cloud expectation data at desire.

          3. Update the node shadow property through OpenAPI

          Similar to obtaining the node shadow property, you can update the node shadow in the HTTPS protocol way by using the certificate, and the interface is also https: //baetyl-core.baetyl-edge-system/node/properties.

          In the same way, skip the server certificate verification by the simulation.

          image.png

          Specify the properties to be updated, and the interface will return all properties of the current node shadow. Furthermore, the node shadow in the cloud can see that the edge device updates the properties.

          image.png

          Previous
          Configuration Management
          Next
          Service Call