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.
-
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*
-
Install the Horizon agent and configure your edge device using
agent-install.sh
:-
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 .
-
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)
-
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
- Locate the tar file
ibm-edge-computing-x86_64-3.2.1.1.tar.gz
that was downloaded from Passport Advantage. -
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
-
Copy them to a USB stick:
cp -a ibm-edge-computing-x86_64-3.2.1.1/horizon-edge-packages/* <usb-mount-point>
-
Create
agent-install.cfg
andagent-install.crt
(these are the same files created at the beginning of this section). - Copy
agent-install.cfg
andagent-install.crt
to the USB stick. - 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: