Can't load fleet.socket at boot

188 views
Skip to first unread message

AcidCrash

unread,
Apr 2, 2015, 4:21:41 AM4/2/15
to coreo...@googlegroups.com
I'm trying to make fleet api listen on address, so as Documentation said, I've added a dropin to my cloud-config file. This is my cloudconfig:

#cloud-config
write_files:
  - path: /etc/environment
    permissions: 0644
    content: |
     COREOS_PUBLIC_IPV4=**************
     COREOS_PRIVATE_IPV4=192.168.101.184
  - path: /etc/systemd/journald.conf
    permissions: 0644
    content: |
      [Journal]
      SystemMaxUse=50M
      RuntimeMaxUse=50M

# Set Hostname
hostname: myhost-0001

# Set SSH Keys
ssh_authorized_keys:
[...skip...]

coreos:
  etcd:
    # generate a new token for each unique cluster from https://discovery.etcd.io/new
    peer-addr: 192.168.101.184:7001
  fleet:
    public-ip: 192.168.101.184
  units:
    - name: etcd.service
      command: start
    - name: fleet.socket
      command: start
      drop-ins:
      - name: 30-ListenStream.conf
        content: |
          [Socket]
          ListenStream=192.168.101.184:49153
    - name: fleet.service
      command: start

After rebooting, my fleet.socket fails and this is what I see from fleet.socket status.

systemctl status fleet.socket
● fleet.socket
   Loaded: loaded (/usr/lib64/systemd/system/fleet.socket; static; vendor preset: disabled)
  Drop-In: /etc/systemd/system/fleet.socket.d
           └─30-ListenStream.conf
   Active: failed (Result: resources)
   Listen: /var/run/fleet.sock (Stream)
           192.168.101.184:49153 (Stream)

Apr 02 08:12:01 myhost-0001 systemd[1]: Starting fleet.socket.
Apr 02 08:12:01 myhost-0001 systemd[1]: fleet.socket failed to listen on sockets: Cannot assign requested address
Apr 02 08:12:01 myhost-0001 systemd[1]: Failed to listen on fleet.socket.
Apr 02 08:12:01 myhost-0001 systemd[1]: Unit fleet.socket entered failed state.
Apr 02 08:12:01 myhost-0001 systemd[1]: Starting fleet.socket.
Apr 02 08:12:01 myhost-0001 systemd[1]: fleet.socket failed to listen on sockets: Cannot assign requested address
Apr 02 08:12:01 myhost-0001 systemd[1]: Failed to listen on fleet.socket.

What's happening? I've tried all, but I can't figure out what's the problem. Anyone could help me?

Alexei Kounine

unread,
Apr 20, 2015, 8:58:32 AM4/20/15
to coreo...@googlegroups.com
Hello there,

I have the exact same problem (fleet.socket fails saying that it "Cannot assign requested address") when i set an address which is not localhost.

However, if I use the 127.0.0.1 IP, like this:
units:
    - name: etcd.service
      command: start
    - name: fleet.socket
      command: start
      drop-ins:
      - name: 30-ListenStream.conf
        content: |
          [Socket]
          ListenStream=127.0.0.1:49153
    - name: fleet.service
      command: start

Then it works and journalctl -b shows:
core-01 coreos-cloudinit[560]: 2015/04/20 12:49:50 Calling unit command "start" on "fleet.socket"'
core-01 systemd[1]: Starting fleet.socket.
core-01 systemd[1]: Listening on fleet.socket.

The problem is that i want to access the fleet API from inside a container (using the local docker IP 172.17.42.1).
Is there any way to allow this IP to be set in the drop-in, or another trick i could use to access fleet's API from inside a container.

Thanks

Alexei Kounine

unread,
Apr 20, 2015, 9:13:10 AM4/20/15
to coreo...@googlegroups.com
And of course, 5 minutes after posting this, i found the answer :) : just specify the port and not the IP:

drop-ins:
  - name: 30-ListenStream.conf
    content: |
      [Socket]
      ListenStream=49153

With this config i can access the fleet API on 127.0.0.1:49153 and on 172.17.42.1:49153 from inside a container.

Traun Leyden

unread,
May 5, 2015, 1:46:35 PM5/5/15
to coreo...@googlegroups.com

Thanks for posting the solution!  This worked for me too.

I just updated the gist that I was working off of.
Reply all
Reply to author
Forward
0 new messages