Official | HULFT IoT EdgeStreaming First Step Guide Fourth Edition: July 1, 2021

Level upgrade of EdgeStreaming Runtime

This section describes the procedure for the level upgrade of the existing EdgeStreaming Runtime to the new-level EdgeStreaming Runtime.

 

Level upgrade procedure

To upgrade EdgeStreaming Runtime that is executed in an IoT gateway or other location to a new level, you need to use a new-level EdgeStreaming Studio to rebuild the script and replace the script executed in the IoT gateway.

= Remarks =

EdgeStreaming Runtime is the execution engine of scripts. By building scripts using a new-level EdgeStreaming Studio, Runtime that is the execution engine of scripts is also replaced by a new level.

The overall flow of level upgrade is as follows:

 

  1. Upgrade EdgeStreaming Studio to a new level.

  2. Disable the automatic execution settings of scripts built using the old-level EdgeStreaming Studio.

  3. Back up scripts built using the old-level EdgeStreaming Studio.

  4. Refer to the setting example described in the "Operation" section of the First Step Guide of the old level to enable scripts built in the new-level EdgeStreaming Studio to be automatically executed in the IoT gateway.

  5. Restore the startup script.

  6. Reactivate the automatic execution settings of scripts built using the new-level EdgeStreaming Studio.

 

The level upgrade procedure differs depending on the OS of the IoT gateway that is operating.

In this section, use the example "When you used an IoT gateway operated by a Linux system on which systemd was available" as shown in Operation to configure settings for replacing the script.

 

  1. Upgrade the level of EdgeStreaming Studio.

    For details, refer to Level upgrade of EdgeStreaming Studio.

     

  2. Disable the automatic execution setting of the script.

    When the setting enables scripts to be automatically executed in the IoT gateway, disable that setting.

    1. Stop the automatically executed script.

      #  systemctl stop es-agent.service 
      
    2. Disable the setting that enables automatic execution of EdgeStreaming Runtime.

       #  systemctl disable es-agent.service
      

     

  3. Back up the script of the old level.

    Obtain the backup of the old-level script.

    #  cd /opt
    #  cp -r ./edge ~/backup/
    #  rm -r ./edge/*
    

     

  4. Transfer the script to the IoT gateway by using the new-level EdgeStreaming Studio.

    Open the script in the new-level EdgeStreaming Studio to send it to the IoT gateway and configure the settings for automatic execution.

    1. Use the new-level EdgeStreaming Studio to open the project that contains the script you want to operate.

    2. Double-click the script that you want to operate in Project Explorer of Designer to open the script.

    For an example on how to configure the settings, refer to Transfer of script to IoT gateway.

     

  5. Restore the startup script.

    Restore the startup script "run.sh" from the backup.

    #  cd /opt/edge
    #  cp ~/backup/edge/run.sh ./
    

     

  6. Reactivate the automatic execution setting of the script.

    Reactivate the automatic execution setting of the script.

    #  systemctl enable es-agent.service
    

    You have now replaced the script run in the old level with the new-level script.

    Confirm once more that the settings have been configured correctly.

    Start the service with "systemctl start <service name>" and confirm the status and content of standard output with "systemctl status <service name>".

    If an error is not output at this time, the service has been created from the script correctly, and has been started.

    # systemctl start es-agent.service
    
    # systemctl status es-agent.service
    ● es-agent.service - es-agent
       Loaded: loaded (/etc/systemd/system/es-agent.service; enabled)
       Active: active (running) since Tue 2020-02-25 06:00:39 CET; 7s ago
      Process: 1577 ExecStop=/bin/kill -TERM ${MAINPID} (code=exited, status=0/SUCCESS)
     Main PID: 1661 (es-agent)
       CGroup: /system.slice/es-agent.service
               └─1661 /opt/edge/es-agent run -c /opt/edge/es-agent.yaml
    
    Feb 25 06:00:39 debian run.sh[1661]: time="2020-02-25T05:00:39Z" level=info msg="no plugins to load" file=loade...script
    Feb 25 06:00:39 debian run.sh[1661]: time="2020-02-25T05:00:39Z" level=info msg="Starting the server on :15601"
    Feb 25 06:00:39 debian run.sh[1661]: {"cpu":99.99999999779732,"disk_avail":14.960063934326172}
    Feb 25 06:00:40 debian run.sh[1661]: {"cpu":0,"disk_avail":14.960063934326172}
    Feb 25 06:00:41 debian run.sh[1661]: {"cpu":0,"disk_avail":14.960063934326172}
    Feb 25 06:00:42 debian run.sh[1661]: {"cpu":0.9900990099009309,"disk_avail":14.960063934326172}
    Feb 25 06:00:43 debian run.sh[1661]: {"cpu":0,"disk_avail":14.960063934326172}
    Feb 25 06:00:44 debian run.sh[1661]: {"cpu":0,"disk_avail":14.960063934326172}
    Feb 25 06:00:45 debian run.sh[1661]: {"cpu":0,"disk_avail":14.960063934326172}
    Feb 25 06:00:46 debian run.sh[1661]: {"cpu":0,"disk_avail":14.960063934326172}
    

     

 

 

Official | HULFT IoT EdgeStreaming First Step Guide Fourth Edition: July 1, 2021