Skip to content

Open Horizon setup

Ankur Kothiwal edited this page Aug 11, 2022 · 4 revisions

Open Horizon setup:

We will need Open Horizon’s Management hub and Agent node component to be installed on two separate VM.

Note Currently only supported on Ubuntu 18.x, Ubuntu 20.x, and macOS

A) Installing the management hub component

  1. Boot the machine or VM and log in.  Become "root" user with
sudo -i
  1. Install the required packages:
apt-get -y update
apt-get -y install gcc make curl jq git net-tools
  1. Check VM’s public IP address using:
ifconfig* (let’s assume it’s 192.168.34.233)
  1. Set an environment variable to that address.
export HZN_LISTEN_IP=192.168.34.233
  1. Install the "all-in-one" script.  Read and follow (https://github.com/open-horizon/devops/tree/master/mgmt-hub), or just run the line below:
curl -sSL https://raw.githubusercontent.com/open-horizon/devops/master/mgmt-hub/deploy-mgmt-hub.sh | bash
  1. Save the credentials shown at the end of a successful installation process. You will need these later.
  2. Set the following environment variables to connect to the Exchange and to allow publishing. Replace the <values> with the actual value indicated. Also add them to your shell's RC file if you'd like them to persist beyond this session.  You may also want to use these for each Agent instance you install on other machines or VMs.
export HZN_ORG_ID=myorg
export HZN_EXCHANGE_USER_AUTH=admin:<insert value from installation credentials>
export HZN_DEVICE_TOKEN=<insert value from installation credentials or use random string>
export HZN_DEVICE_ID=node1
export HZN_EXCHANGE_URL=http://<local-IP-address-here>:3090/v1
export HZN_FSS_CSSURL=http://<local-IP-address-here>:9443
  1. Exit the root shell back to your initial login session.  You may want to export the above variables and persist them in this session as well.

    The Management hub is installed.

B) Installing the agent node

  1. Log into your machine or device and become "root" user:
sudo -i
  1. Follow Step 2 of the Hub installation instructions to install prerequisites
  2. Follow Step 7 of the Hub installation instructions to set environment variables. You just need to copy the same environment variables here.
  3. Download and run the Agent installation script:
curl -sSL https://github.com/open-horizon/anax/releases/latest/download/agent-install.sh | sudo -s -E bash -s -- -i anax: -k css: -c css: -p IBM/pattern-ibm.helloworld -w '*' -T 120
  1. Exit the root shell back to your initial login session. You may want to export the above variables and persist them in this session as well.

Installing Homeassistant

To install [Open Horizon home-assistant service](https://github.com/open-horizon-services/service-homeassistant):

  1. You will need to disable the agent as a container first:
hzn node list | jq '.configstate.state'

If you get output as configured, run:

hzn unregister -f
  1. Again run the Step 1, but now the output should be unconfigured
  2. Clone the open horizon homeassistant repository and run the container using make
git clone https://github.com/open-horizon-services/service-homeassistant.git
cd service-homeassistant
make

This will run the homeassistant container

For more information refer [Open Horizon home-assistant service](https://github.com/open-horizon-services/service-homeassistant).

Clone this wiki locally