Systemd fails to start consul: bind: cannot assign requested address

1,671 views
Skip to first unread message

Sean Bollin

unread,
Feb 4, 2016, 5:55:18 PM2/4/16
to Consul
When I reboot the aws ec2 instance I get:

==> Starting Consul agent...

==> Error starting agent: Failed to start Consul server: Failed to start RPC layer: listen tcp 10.0.5.177:8300: bind: cannot assign requested address


Systemd is failing to start consul up on the reboot, however if I manually type "systemctl start consul" it works fine: I don't get the assign error.  Any ideas?


Here's my setup:


[Unit]

Description=Consul Agent


[Service]

Environment="GOMAXPROCS=`nproc`"

User=consul

Group=consul

ExecStart=/bin/sh -c '/opt/consul/bin/consul agent -server -config-dir /etc/consul.d -config-file=/etc/consul.conf >> /var/log/consul 2>&1'


[Install]

WantedBy=multi-user.target

Sean Bollin

unread,
Feb 5, 2016, 3:13:58 PM2/5/16
to Consul
Fixed this by putting the following in my unit file:

Wants=network-online.target

After=network-online.target

Reply all
Reply to author
Forward
0 new messages