Registering your edge machine with the helloworld example
When you install and start the Horizon software, you can register your edge machine with Horizon exchange to add your machine onto the Horizon network.
Before you begin
Ensure that you installed the Horizon software on your edge nodes. For more information, see Installing Horizon software.
Procedure
-
Set these environment variables:
export ICP_URL='<your-cluster-IP-address>:<your-icp-port>' export HZN_ORG_ID='your-cluster-name' export HZN_EXCHANGE_USER_AUTH='iamapikey:your-platform-api-key'
You can display your IBM Cloud Private cluster name with:
curl -sk https://$ICP_URL/api/v1/config | jq -r .cluster_ca_domain
-
Verify that the environment variable values are set correctly:
hzn exchange user list
-
View the list of sample edge service deployment patterns:
hzn exchange pattern list IBM/
-
The helloworld edge service is the most basic example, which makes it a good place to begin. Follow the instructions in the first section of the
helloworld
to register your edge node on IBM Edge Computing for Devices. -
Navigate to Example: Host CPU load percentage to continue with other deployment examples and to learn how to deploy edge services.
Exploring the hzn command
On Horizon edge nodes, the hzn
command enables you to inspect many aspects of the state of the local system, and of the larger Horizon ecosystem outside your edge node. The hzn
command also allows you to interact with the
system and make changes to the state for resources you own.
You can get help for the hzn
command, including more details about any of the sub-commands that are included in this guide (and all of the other hzn
sub-commands) by using the --help
(or -h
) flag
at any sub-command level. For example, see the following commands:
hzn --help
hzn node --help
hzn exchange pattern --help
You can use the --verbose
(or -v
) flag in the hzn
command to provide more detailed output. Most often hzn
commands are convenience wrappers over the REST APIs that are provided by Horizon components,
and the --verbose
flag typically shows the details of the REST interactions behind the scenes. For example, try the following command:
hzn node list -v
The output of that command shows the two REST GET
method invocations on localhost
URLs where the local Horizon agent responds to REST requests.
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:
What to do next
If you want to deploy your own software, you must create your own edge services and then assign the deployment pattern for that service to your edge machine. For more information, see Creating edge services.