open-horizon / devops

Devops processes to build and deploy horizon components
Apache License 2.0
10 stars 43 forks source link

horizon.service is missing when running deploy-mgmt-hub.sh on Ubuntu 20.04 #173

Closed jiangphcn closed 2 months ago

jiangphcn commented 2 months ago

I am trying to "Deploy All-in-One Horizon Management Hub, Agent and CLI" using the deploy-mgmt-hub.sh script. When running deploy-mgmt-hub.sh, it is strange that I found that horizon.service is not created under /lib/systemd/system directory. I got error that Failed to restart/stop horizon.service: Unit horizon.service not loaded.

Also, I want to create horizon.service using https://github.com/open-horizon/anax/blob/852b61b89d65e41cad5f3d3faf53306f46c9c716/pkg/deb/horizon/lib/systemd/system/horizon.service#L10, but anax is also missing.

/lib/systemd/system# ls -lrt /usr/horizon/bin/anax
ls: cannot access '/usr/horizon/bin/anax': No such file or directory
/lib/systemd/system# more /etc/default/horizon
HZN_EXCHANGE_URL=http://127.0.0.1:3090/v1
HZN_FSS_CSSURL=http://127.0.0.1:9443/
HZN_AGBOT_URL=http://127.0.0.1:3111
HZN_FDO_SVC_URL=http://127.0.0.1:9008/api
HZN_DEVICE_ID=node1
ANAX_LOG_LEVEL=3

Here is more log...

------- Downloading/installing/configuring Horizon agent and CLI...
Downloading the Horizon agent and CLI packages...
Installing the Horizon agent and CLI packages...
Configuring the Horizon agent and CLI...
Publishing /tmp/horizon-all-in-1/agent-install.cfg in CSS as public object agent-install.cfg in the IBM org...
Digital sign with SHA256 will be performed for data integrity. It will delay the MMS object publish.
Start hashing the file...
Data hash is generated. Start digital signing with the data hash...
Digital sign finished.
Object agent-install.cfg added to org IBM in the Model Management Service
------- Installing Horizon example services, policies, and patterns...
Using examples repo tag v2.31.0-1511 derived from the hzn version
Cloning https://github.com/open-horizon/examples.git to /tmp/open-horizon/examples ...
Switching to tag v2.31.0-1511 ...
Switched to a new branch 'v2.31.0-1511'
Publishing services and patterns of edge/services/cpu_percent to IBM org...
Publishing services and patterns of edge/services/gps to IBM org...
Publishing services and patterns of edge/services/helloworld to IBM org...
Publishing deployment policy of edge/services/helloworld to myorg org...
Publishing services and patterns of edge/services/helloMMS to IBM org...
Publishing services and patterns of edge/services/helloSecretWorld to IBM org...
Publishing services and patterns of edge/services/nginx-operator to IBM org...
Publishing deployment policy of edge/services/nginx-operator to myorg org...
Publishing services and patterns of edge/evtstreams/cpu2evtstreams to IBM org...
Publishing deployment policy of edge/evtstreams/cpu2evtstreams to myorg org...
Successfully published all examples to the exchange. Removing /tmp/open-horizon/examples directory.
------- Creating and registering the edge node with policy to run the helloworld Horizon example...
Waiting for the agent to be ready...............
Error: can not reach the agent (tried for 30 seconds): Error: Can't connect to the Horizon REST API to run GET http://localhost:8510/node. Run 'systemctl status horizon' to check if the Horizon agent is running. Or run 'curl http://localhost:8510/status' to check the Horizon agent status. Or set HORIZON_URL to connect to another local port that is connected to a remote Horizon agent via a ssh tunnel. Specific error is: Get "http://localhost:8510/node": dial tcp 127.0.0.1:8510: connect: connection refused
jiangphcn commented 2 months ago

The problem was identified that it is due that jq can't be installed from apt in my environment. However, the error was hidden due to silent installation.