Updated on 2023-11-24 GMT+08:00

Registering Nodes in Batches

Scenario

If you need to manage, update, and maintain a large number of edge nodes of the same type, it will be labor-consuming to do so one by one as described in Registering an Edge Node.

IEF provides batch node registration to pre-install required software on edge nodes of the same type so that they can be connected to the network after they are powered on. This one-to-many design improves management efficiency and reduces O&M costs.

Procedure of Registering Nodes in Batches

The procedure for managing edge nodes in batches is as follows:

  1. Prepare edge nodes that meet certain requirements. Then, configure the environment on the edge nodes by referring to Configuring the Edge Node Environment.
  2. After creating a batch node registration job, obtain the configuration file and registration software, and pre-install them on the edge nodes. For details, see Managing Edge Nodes in Batches. If the registration command is configured in the startup script, the device will be automatically managed as an edge node of IEF after being powered on and connected to the network.

Creating a Batch Node Registration Job

  1. Log in to the IEF console.
  2. In the navigation pane, choose Batch Management > Node Registration Jobs, and click Register Edge Nodes in the upper right corner of the displayed page.
  3. Configure basic information. The parameters marked with * are mandatory.

    • Name: name of the batch node registration job.
    • Description: description of the job.
    • Tags: Tags can be used to classify resources, facilitating resource management.
    • Properties: A property is in key-value pair format. Enter a key and value.

  4. Click Register in the lower right corner. You can choose to register the edge nodes using a certificate or a token.

    • Method 1: registration using a certificate: Download the configuration file, EdgeCore Register, and EdgeCore Installer.

      To enhance node security, you must download the configuration file and tools now. The configuration file and tools cannot be retrieved later.

      1. Click Download cert_1.tar.gz to download the configuration file.
      2. Select the CPU architecture of your edge nodes, and click Download Node Registration Tool and Download Node Installation Tool.
    • Method 2: registration using a token: Download EdgeCore Register and EdgeCore Installer and save the installation credential.
      Figure 1 Downloading EdgeCore Register and EdgeCore Installer
      Figure 2 Installation credential
      1. Select the CPU architecture of your edge nodes, and click Download Node Registration Tool and Download Node Installation Tool.
      2. Save the identifier field of the installation command.

  5. Upload the downloaded file to the edge nodes, and then manage the edge nodes on IEF by referring to Managing Edge Nodes in Batches.

Managing Edge Nodes in Batches

Follow the procedure of the finish step on the Register Edge Nodes page to perform the batch management operation to the edge nodes.

  1. Log in to an edge node as a user with sudo permissions.
  2. Upload the configuration files and tools downloaded in step 4 of "Creating a Batch Node Registration Job" to the edge nodes.
  3. Run the following commands to decompress the configuration file, EdgeCore Register, and EdgeCore Installer:

    sudo tar -zxvf edge-installer_1.0.10_x86_64.tar.gz -C /opt

    sudo tar -zxvf edge-register_2.0.10_x86_64.tar.gz -C /opt

    sudo tar -zxvf cert_batchNodes.tar.gz -C /opt/edge-register/ (This command is not required for registration using a token.)

    Replace edge-installer_1.0.10_x86_64.tar.gz, edge-register_2.0.10_x86_64.tar.gz, and cert_batchNodes.tar.gz with the names of the files downloaded in Creating a Batch Node Registration Job.

  4. (Optional) Customize the node information.

    For batch node management, the default configuration will be applied for these edge nodes. Where:

    • The node name is the combination of the host name and MAC address of the node, that is, Host name_MAC address.
    • The GPU and NPU options are disabled.
    • The Docker function is enabled.

    If you want to customize node information, configure the nodeinfo file. Run the following commands to open the nodeinfo file:

    cd /opt/edge-register

    vi nodeinfo

    Specify the node information in the nodeinfo file. The following example lists all configurable parameters. You can set the parameters based on site requirements and delete the parameters that do not need to be customized.

    Parameters such as the node name, descriptions, GPU enabled or not, NPU, NPU types, attributes, and log configuration are included. For details about the parameters, see API Reference > Registering an Edge Node.
    {
        "name": "nodename",
        "description": "",
        "enable_gpu": false,
        "enable_npu": true,
        "npu_type": "***",
        "enable_docker": true,
        "attributes": [
            {
                "key": "key1",
                "value": "value1"
            }
        ],
        "log_configs": [
            {
                "component": "app",
                "type": "local",
                "level": "debug",
                "size": 100,
                "rotate_num": 5,
                "rotate_period": "daily"
            }
        ],
        "device_infos": [
            {
                "device_ids": ["15696983-5ee6-43b4-9653-5d8512813dcc"],
                "relation": "camera",
                "comment": "devicedescription"
            }
        ],
        "mqtt_config": {
            "enable_mqtt": false,
            "mqtts": []
        },
        "tags": [
            {
                "key": "name",
                "value": "value"
            }
        ]
    }

  5. Run one of the following commands to manage the edge nodes:

    • For edge nodes registered using certificates:

      cd /opt/edge-register; ./register --mode=cert

    • For edge nodes registered using tokens:

      cd /opt/edge-register; ./register --mode=identifier --identifier=Credential for registration using a token

      Replace Credential for registration using a token with the value of identifier field of the installation credential saved in Creating a Batch Node Registration Job.

    After the command is executed, check whether the node is successfully registered by referring to Viewing Managed Nodes.

    You can also add the registration command cd /opt/edge-register; ./register --mode=cert to the startup script. In this way, the edge node can automatically run the registration command when it is powered on.

    If the command output is 0, the edge node is successfully registered on IEF.

Viewing Managed Nodes

You can view the nodes managed in batches on the console.

  1. Log in to the IEF console.
  2. In the navigation pane, choose Batch Management > Node Registration Jobs, and click a job name on the displayed page.
  3. You can view the managed nodes on the Nodes tab.

    Figure 3 Viewing nodes managed in batches