Install the Horizon agent on your edge device and register it with the hello world example

When you install and start the Horizon agent software on your edge node, you can register your edge device with IBM Edge Computing for Devices to add your device into the edge computing management domain.

Hello world is a minimal example to introduce you to IBM Edge Computing for Devices deployment patterns.

Before you begin

You must have already performed the steps in Preparing an edge device. This includes creating the file agent-install.cfg and copying it to this edge device.

Method 1: Automated installation and registration of an agent

Note: These steps are the same for all device types.

  1. In the section Gather the necessary information and files, you collected some files and Horizon Debian packages that you need now. If they were not collected on this edge device, copy them here and ensure that you are in the directory that you copied the files to:

    ls agent-install.cfg agent-install.crt *horizon*
    
  2. Install the Horizon agent and configure your edge device using agent-install.sh:

    1. Download and run the latest version of the agent-install.sh script to install and configure the Horizon agent, and to register your edge device to run the helloworld sample:

      curl -O https://raw.githubusercontent.com/open-horizon/anax/v3.2.1/agent-install/agent-install.sh && \
      chmod +x ./agent-install.sh && \
      sudo -s ./agent-install.sh -i .
      
    2. Set your specific information as environment variables in your shell. This will enable you to view or manage exchange objects with the hzn exchange sub-command in the future:

      eval export $(cat agent-install.cfg)
      
    3. You are now finished installing, configuring, and registering your edge device. Now navigate to Host CPU load percentage example (cpu2evtstreams) to continue with other edge service examples.

Method 2: Advanced manual installation and registration of an agent

See Advanced manual installation and registration of an agent.

Method 3: Installation and registration of multiple edge nodes

You can install multiple edge nodes by copying agent-install.sh and associated configuration files onto a USB and manually transferring that content to the edge nodes.

Procedure

  1. Locate the tar file ibm-edge-computing-x86_64-3.2.1.1.tar.gz that was downloaded from Passport Advantage.
  2. Extract the deb pkgs and agent-install.sh:

    tar -zxvf ibm-edge-computing-x86_64-3.2.1.1.tar.gz ibm-edge-computing-x86_64-3.2.1.1/horizon-edge-packages
    
  3. Copy them to a USB stick:

    cp -a ibm-edge-computing-x86_64-3.2.1.1/horizon-edge-packages/* <usb-mount-point>
    
  4. Create agent-install.cfg and agent-install.crt (these are the same files created at the beginning of this section).

  5. Copy agent-install.cfg and agent-install.crt to the USB stick.
  6. For each device being installed:
    • Plug in USB stick (and mount it if necessary)
    • cd to that mount point
    • ./agent-install.sh
    • Unmount and unplug the USB stick

What to do next

Navigate to Host CPU load percentage example (cpu2evtstreams) to continue with other edge service examples.

Questions and troubleshooting

If you have any difficulties with any of the steps in this guide, review the provided troubleshooting and frequently asked question topics. For more information, see: