我正在尝试在EC2中使用一个品牌闪亮的新coreos集群上使用fleet部署nsqlookupd.这是我的systemd单元文件:
[Unit]
Description=nsqlookupd service
After=docker.service
Requires=docker.service
[Service]
EnvironmentFile=/etc/environment
ExecStartPre=-/usr/bin/docker kill nsqlookupd
ExecStartPre=-/usr/bin/docker rm nsqlookupd
ExecStart=/usr/bin/docker run -d --name=nsqlookupd -e BROADCAST_ADDRESS=$COREOS_PUBLIC_IPV4 -p 4160:4160 -p 4161:4161 mikedewar/nsqlookupd
ExecStartPost=/usr/bin/etcdctl set /nsqlookupd_broadcast_address $COREOS_PUBLIC_IPV4
ExecStop=/usr/bin/docker stop -t 1 nsqlookupd
ExecStopPost=/usr/bin/etcdctl rm /nsqlookupd_broadcast_address
如果我只运行ExecStart命令,我已经验证了容器正常工作.我的码头日志看起来像
~ $docker logs nsqlookupd
2014/08/08 02:23:58 nsqlookupd v0.2.29-alpha (built w/go1.2.2)
2014/08/08 02:23:58 TCP: listening on [::]:4160
2014/08/08 02:23:58 HTTP: listening on [::]:4161
我的fleetctl期刊看起来像
$fleetctl journal nsqlookupd.service
-- Logs begin at Sun 2014-08-03 12:49:00 UTC,end at Fri 2014-08-08 02:30:06 UTC. --
Aug 08 02:23:57 ip-10-147-9-249 systemd[1]: Starting nsqlookupd service...
Aug 08 02:23:57 ip-10-147-9-249 docker[6140]: Error response from daemon: No such container: nsqlookupd
Aug 08 02:23:57 ip-10-147-9-249 docker[6140]: 2014/08/08 02:23:57 Error: Failed to kill one or more containers
Aug 08 02:23:57 ip-10-147-9-249 docker[6148]: Error response from daemon: No such container: nsqlookupd
Aug 08 02:23:57 ip-10-147-9-249 docker[6148]: 2014/08/08 02:23:57 Error: Failed to remove one or more containers
Aug 08 02:23:57 ip-10-147-9-249 etcdctl[6157]: 54.198.93.169
Aug 08 02:23:57 ip-10-147-9-249 systemd[1]: Started nsqlookupd service.
Aug 08 02:23:57 ip-10-147-9-249 docker[6155]: 0fce4465f61c092541ba9d4c4e89ce13c4d6bedc096519034ed585d7adb5e0d7
Aug 08 02:23:59 ip-10-147-9-249 docker[6194]: nsqlookupd
两者看起来都很好.但是容器安静地死了,我的fleetctl list-units给出了
$fleetctl list-units
UNIT STATE LOAD ACTIVE SUB DESC MACHINE
nsqlookupd.service launched loaded deactivating stop nsqlookupd service 1320802c.../10.147.9.249
运行码头图像有点令人担忧:
$docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
sqlookupd latest 2219c0e783d9 3 weeks ago 710 MB
Box latest a9eb17255234 9 weeks ago 2.433 MB
zmarcantel/cassandra latest b1168b45b4f8 4 months ago 738 MB
因为我在过去3周内经常更新mikedewar / nsqlookupd.也许那是我第一次把东西推到码头中心的时候?我很想知道我正在使用的图像是最新的图像.我已经尝试过docker rmi mikedewar / nsqlookupd,然后是docker pull mikedewar / nsqlookupd,但CREATED列仍然说它是在3周前创建的.
我不知道这是否有用,但ExecStopPost = /usr/bin/etcdctl rm / nsqlookupd_broadcast_address命令似乎有效 – 舰队日志中的etcdctl日志表明我设法将密钥设置为我的IP,但之后容器死了我无法从etcd获得该密钥.
任何关于在哪里寻找线索的帮助,或任何想法为什么会发生这种情况将不胜感激!很明显,我对这类事情很陌生……
最佳答案