如何将回声应用程序部署到Marathon(在Mac上的Docker上的Mesos上)?

时间:2017-02-19 13:27:54

标签: docker apache-zookeeper mesos marathon

我尝试使用Docker在本地计算机上安装Mesos。我读了this tutorial并稍微改了一下,因为我使用的是Docker for Mac。我的想法是将动物园管理员,船长,马拉松和奴隶放入一个网络进行相互通信。

我拥有的主节点已经识别出奴隶(我在下面说明了一个图)但我的问题是一个简单的应用程序无法部署echo "hello" >> /tmp/1543Feb19.txt而Marathon一直在说实例0/1带黄灯

enter image description here

我检查了网络,检查这些容器是否可以通信,但看起来可以。但

"Containers": {
            "3d5497bfd7bcde3cbad3113c906628099c7c487fc860a40e301c963630569375": {
                "Name": "marathon",
                "EndpointID": "05c4d28d9663df2f2af333d472096082079eef4c8d435dc1db915b795fabd1a7",
                "MacAddress": "02:42:ac:12:00:04",
                "IPv4Address": "172.18.0.4/16",
                "IPv6Address": ""
            },
            "3e72bd6beadd954ec78d3f6ce838f8748408fe6f09b7846e3bcdeb4e938cd138": {
                "Name": "master",
                "EndpointID": "93b32998a2eb3b4d3ab6f39abd13f65c98515eaf2a38f25d12e4c3926032fe16",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "46cefc46c6d82d21d60a5d0959140307931d226490dfb739223195b99f82fe2f": {
                "Name": "zookeeper",
                "EndpointID": "f91eccae086f3461dbd4620bd93b636b6c63fc5f9118f753e28735c746445869",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            },
            "d626436646874e0b81871b567f951751a5b34c2f45a09869ee614adcc9731159": {
                "Name": "slave_1",
                "EndpointID": "8b86d7878a44273a7bd94b31d12c10c8ebfe767b79e9a4c8c0ede2f7a8af49ea",
                "MacAddress": "02:42:ac:12:00:05",
                "IPv4Address": "172.18.0.5/16",
                "IPv6Address": ""
            }
        },

这就是我跑马拉松的方式(172.18.0.2是Zookeeper的IP)

docker run -d -p 8080:8080 --net="my-tiny-cluster" \
--name="marathon" "garland/mesosphere-docker-marathon" \
--master zk://172.18.0.2:2181/mesos --zk zk://172.18.0.2:2181/marathon

我的问题是我错过了正常运行的东西?谢谢。

enter image description here

更新:日志

主节点:

I0226 06:34:35.071885     9 master.cpp:3068] Registering slave at slave(1)@172.18.0.5:5051 (d62643664687) with id 20170226-053009-50336428-5050-1-S0
I0226 06:34:35.073649    15 registrar.cpp:445] Applied 1 operations in 185687ns; attempting to update the 'registry'
I0226 06:34:35.074841    15 registrar.cpp:490] Successfully updated the 'registry' in 1.059072ms
I0226 06:34:35.077747    15 master.cpp:3122] Registered slave 20170226-053009-50336428-5050-1-S0 at slave(1)@172.18.0.5:5051 (d62643664687) with cpus(*):2; mem(*):999; disk(*):55325; ports(*):[31000-32000]
I0226 06:34:35.078001    16 hierarchical_allocator_process.hpp:442] Added slave 20170226-053009-50336428-5050-1-S0 (d62643664687) with cpus(*):2; mem(*):999; disk(*):55325; ports(*):[31000-32000] (and cpus(*):2; mem(*):999; disk(*):55325; ports(*):[31000-32000] available)

马拉松:

I0227 19:29:52.714860    38 group.cpp:349] Group process (group(1)@172.18.0.5:33909) connected to ZooKeeper
I0227 19:29:52.715006    38 group.cpp:837] Syncing group operations: queue size (joins, cancels, datas) = (0, 0, 0)
I0227 19:29:52.715059    38 group.cpp:427] Trying to create path '/mesos' in ZooKeeper
I0227 19:29:52.716549    38 detector.cpp:152] Detected a new leader: (id='5')
I0227 19:29:52.716820    40 group.cpp:706] Trying to get '/mesos/info_0000000005' in ZooKeeper
W0227 19:29:52.717524    36 zookeeper.cpp:221] Leading master master@172.18.0.3:5050 is using a Protobuf binary format when registering with ZooKeeper (info): this will be deprecated as of Mesos 0.24 (see MESOS-2340)
I0227 19:29:52.717629    36 zookeeper.cpp:259] A new leading master (UPID=master@172.18.0.3:5050) is detected
I0227 19:29:52.717713    36 sched.cpp:330] New master detected at master@172.18.0.3:5050
[2017-02-20 21:07:22,930] INFO Requesting task reconciliation with the Mesos master (mesosphere.marathon.MarathonScheduler:299)
[2017-02-20 21:07:22,933] INFO Need to scale test01 from 0 up to 1 instances (mesosphere.marathon.MarathonScheduler:338)
[2017-02-20 21:07:22,933] INFO Already queued 1 tasks for test01. Not scaling. (mesosphere.marathon.MarathonScheduler:349)
[2017-02-20 21:07:52,924] INFO Syncing tasks for all apps (mesosphere.marathon.MarathonScheduler:282)
[2017-02-20 21:07:52,925] INFO Requesting task reconciliation with the Mesos master (mesosphere.marathon.MarathonScheduler:299)

二次

I0221 01:11:23.349058    12 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723675115374884days
I0221 01:12:23.350314    12 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723674663006701days
I0221 01:13:23.352875    12 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723674663006701days
I0221 01:14:23.355108    11 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723674210638518days
I0221 01:15:23.356853    11 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723674210638518days
I0221 01:16:23.358719    11 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723674210638518days
I0221 01:17:23.360033    11 slave.cpp:3321] Current usage 22.52%. Max allowed age: 4.723673758270336days

动物园管理员

2017-02-26 05:30:22,611 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@928] - Client attempting to establish new session at /172.18.0.4:46344
2017-02-26 05:30:22,626 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@673] - Established session 0x15a78e5b7110003 with negotiated timeout 10000 for client /172.18.0.4:46344
2017-02-26 05:30:23,384 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /172.18.0.4:46346
2017-02-26 05:30:23,390 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@882] - Connection request from old client /172.18.0.4:46346; will be dropped if server is in r-o mode
2017-02-26 05:30:23,390 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@928] - Client attempting to establish new session at /172.18.0.4:46346
2017-02-26 05:30:23,407 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@673] - Established session 0x15a78e5b7110004 with negotiated timeout 10000 for client /172.18.0.4:46346
2017-02-26 06:34:34,432 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /172.18.0.5:58000
2017-02-26 06:34:34,440 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@882] - Connection request from old client /172.18.0.5:58000; will be dropped if server is in r-o mode
2017-02-26 06:34:34,440 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@928] - Client attempting to establish new session at /172.18.0.5:58000
2017-02-26 06:34:34,468 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@673] - Established session 0x15a78e5b7110005 with negotiated timeout 10000 for client /172.18.0.5:58000
2017-02-26 06:36:17,295 [myid:] - INFO  [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@649] - Got user-level KeeperException when processing sessionid:0x15a78e5b7110003 type:create cxid:0x58b26927 zxid:0xcd txntype:-1 reqpath:n/a Error Path:/marathon Error:KeeperErrorCode = NodeExists for /marathon
2017-02-26 06:36:17,307 [myid:] - INFO  [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@649] - Got user-level KeeperException when processing sessionid:0x15a78e5b7110003 type:create cxid:0x58b26928 zxid:0xce txntype:-1 reqpath:n/a Error Path:/marathon/state Error:KeeperErrorCode = NodeExists for /marathon/state

更新:如何运行马拉松容器

docker run --net="my-tiny-cluster" --ip="172.18.0.4" \
-p 8080:8080 \
-e "LIBPROCESS_IP=172.18.0.4" \
-d \
--name="marathon" "garland/mesosphere-docker-marathon" \
--master "zk://172.18.0.2:2181/mesos" --zk "zk://172.18.0.2:2181/marathon"

0 个答案:

没有答案