jsiebens / hashi-up

bootstrap HashiCorp Consul, Nomad, or Vault over SSH < 1 minute
MIT License
676 stars 54 forks source link

"Connection refused" on brand new Raspberry Pi 4 install #43

Closed Squazz closed 1 year ago

Squazz commented 1 year ago

The setup:

From a windows machine, I ran the following commands:

.\hashi-up.exe consul install --ssh-target-addr 10.0.0.123 --ssh-target-user pi --ssh-target-password raspberry --server --advertise-addr "{{ GetInterfaceIP \"eth0\" }}" --bind-addr "{{ GetInterfaceIP \"eth0\" }}" --client-addr 0.0.0.0

.\hashi-up.exe nomad install --ssh-target-addr 10.0.0.123 --ssh-target-user pi --ssh-target-password raspberry --server --advertise "{{ GetInterfaceIP \"eth0\" }}" --bootstrap-expect 1

On the raspberry Pi, when I run the following command, I get an "connection refused" error consul members -http-addr=http://10.0.0.123:8500 "Error retrieving members: Get "http://10.0.0.123:8500/v1/agent/members?segment=_all": dial tcp 10.0.0.123:8500: connect: connection refused"

I was able to install both consul and nomad on the pi. Is there something I'm missing to do?

I've now tried doing the install with a ssh key instead of username/password Same error

Squazz commented 1 year ago

Running systemctl list-units --type=service Tells me that consul.service is failed for both "active" and "sub"

Running journalctl -u consul.service

-- Journal begins at Thu 2022-09-22 05:06:10 CEST, ends at Mon 2022-12-12 14:41:57 CET. --
Dec 12 13:04:45 raspberrypi systemd[1]: Started "HashiCorp Consul - A service mesh solution".
Dec 12 13:04:46 raspberrypi consul[837]: ==> 2 errors occurred:
Dec 12 13:04:46 raspberrypi consul[837]:         * advertise_addr: error parsing "{{ GetInterfaceIP \" eth0\\": unable to parse template "{{ GetInterfaceIP \" eth0\\": templa>
Dec 12 13:04:46 raspberrypi consul[837]:         * advertise_addr: error parsing "{{ GetInterfaceIP \" eth0\\": unable to parse template "{{ GetInterfaceIP \" eth0\\": templa>
Dec 12 13:04:46 raspberrypi systemd[1]: consul.service: Main process exited, code=exited, status=1/FAILURE
Dec 12 13:04:46 raspberrypi systemd[1]: consul.service: Failed with result 'exit-code'.
Dec 12 13:04:46 raspberrypi systemd[1]: consul.service: Scheduled restart job, restart counter is at 1.
Dec 12 13:04:46 raspberrypi systemd[1]: Stopped "HashiCorp Consul - A service mesh solution".
.....
Dec 12 13:04:48 raspberrypi systemd[1]: consul.service: Start request repeated too quickly.
Dec 12 13:04:48 raspberrypi systemd[1]: consul.service: Failed with result 'exit-code'.
Dec 12 13:04:48 raspberrypi systemd[1]: Failed to start "HashiCorp Consul - A service mesh solution".
Squazz commented 1 year ago

Removing the following solved the issue

--advertise-addr "{{ GetInterfaceIP \"eth0\" }}" --bind-addr "{{ GetInterfaceIP \"eth0\" }}"

@jsiebens I guess the guide on your blog needs an update?

jsiebens commented 1 year ago

For the blogpost, the Pi was running Ubuntu, and in that case the network interface name is "eth0". Perhaps Raspberry OS Lite is using a different name? If not, what was the content of the generated configuration file?