Create a unit(docker) with Fleet Api. The server responsed 404.

18 views
Skip to first unread message

王硕

unread,
Dec 27, 2016, 3:24:26 AM12/27/16
to CoreOS Dev
HI  all,
     I'm learning Fleet. I have deployed etcd and fleet at one server. The configuration of etcd is as below, 10.0.18.7 is my server's IP:
...
etcd_servers=["http://10.0.18.7:2379"]

...
public_ip="10.0.18.7"

...

I have used Fleetctl CLI like fleetctl list-units --endpoint http://10.0.18.7:2379 --driver "etcd". Yes, I mush add endpoint and driver, this two argument, otherwise it will return failure.
My problem is when I call  Fleet api http://10.0.18.7:2379/units/myapp, the server return 404 to me. But I 'm sure the unit exists. I suspect the problem may be related to the argument "driver". Because I don't add driver in the CLI, it will return 404 as well. So if anyone has even encounter with this problem, please tell me the solution. Thanks.

Brandon Philips

unread,
Dec 27, 2016, 10:31:56 AM12/27/16
to coreo...@googlegroups.com
On Tue, Dec 27, 2016 at 12:24 AM 王硕 <wang....@gmail.com> wrote:
     I'm learning Fleet. I have deployed etcd and fleet at one server. The configuration of etcd is as below, 10.0.18.7 is my server's IP:

Please be aware that fleet is not recommended for new use cases. https://github.com/coreos/fleet#-deprecation-warning-

 
etcd_servers=["http://10.0.18.7:2379"]

...
public_ip="10.0.18.7"

...

I have used Fleetctl CLI like fleetctl list-units --endpoint http://10.0.18.7:2379 --driver "etcd". Yes, I mush add endpoint and driver, this two argument, otherwise it will return failure.

These flags should not be necessary. Can you just login to the Container Linux host directly and run fleetctl without driver and endpoint flags?
 
My problem is when I call  Fleet api http://10.0.18.7:2379/units/myapp, the server return 404 to me.

The fleet API does not listen on 2379. That is the etcd API. The fleet API is at /var/run/fleet.sock.

Brandon 

王硕

unread,
Dec 27, 2016, 10:09:48 PM12/27/16
to CoreOS Dev
Hi  Brandon,
    Thanks for your replying.

在 2016年12月27日星期二 UTC+8下午11:31:56,Brandon Philips写道:

These flags should not be necessary. Can you just login to the Container Linux host directly and run fleetctl without driver and endpoint flags?
 
 I can't run fleetctl directly. If I run fleetctl without driver and enpoint flags. It will return me this error:
fleetctl list-units 
Error retrieving list of units from repository: Get http://domain-sock/fleet/v1/state?alt=json: dial unix /var/run/fleet.sock: connect: no such file or directory.
I don't know if something wrong in my configration.

Brandon Philips

unread,
Dec 27, 2016, 10:11:47 PM12/27/16
to CoreOS Dev
Are you running fleetctl while ssh'd into a machine running fleet.service?

王硕

unread,
Dec 28, 2016, 8:58:35 PM12/28/16
to CoreOS Dev


在 2016年12月28日星期三 UTC+8上午11:11:47,Brandon Philips写道:
Are you running fleetctl while ssh'd into a machine running fleet.service?

Yes.
systemctl status fleet
● fleet.service - Fleet
   Loaded: loaded (/usr/lib/systemd/system/fleet.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2016-12-19 12:08:57 CST; 1 weeks 2 days ago
 Main PID: 130593 (fleetd)
   Memory: 23.6M
   CGroup: /system.slice/fleet.service
           └─130593 /usr/bin/fleetd 

cat /usr/lib/systemd/system/fleet.service 
[Unit]
Description=Fleet
[Service]
Type=simple
ExecStart=/usr/bin/fleetd
ExecStop=/usr/bin/killall -9 fleetd
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
Reply all
Reply to author
Forward
0 new messages