-
Notifications
You must be signed in to change notification settings - Fork 345
Open Horizon setup
Rahul Jadhav edited this page Aug 20, 2022
·
4 revisions
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
- Boot the machine or VM and log in. Become "root" user with
sudo -i
- Install the required packages:
apt-get -y update
apt-get -y install gcc make curl jq git net-tools
- Check VM’s public IP address using:
ifconfig* (let’s assume it’s 192.168.34.233)
- Set an environment variable to that address.
export HZN_LISTEN_IP=192.168.34.233
- 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
- Save the credentials shown at the end of a successful installation process. You will need these later.
- 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
-
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
- Log into your machine or device and become "root" user:
sudo -i
- Follow
Step 2
of the Hub installation instructions to install prerequisites - Follow
Step 7
of the Hub installation instructions to set environment variables. You just need to copy the same environment variables here. - 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
- 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:
- 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
- Again run the
Step 1
, but now the output should beunconfigured
- 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.