【问题标题】:Create DC/OS app deployment from native executable local file从本机可执行本地文件创建 DC/OS 应用程序部署
【发布时间】:2017-01-28 02:50:23
【问题描述】:

我正在尝试使用 DC/OS 我想尝试原生文件运行功能,在不使用 docker 的情况下运行原生可执行文件,概述于 https://dcos.io/docs/1.8/usage/tutorials/dcos-101/app2/

我可以成功地按照教程但是我想使用我自己的应用程序(一个独立的可执行文件),在线文档说除了 https://uri 之外,fetch 命令还支持 file://uri和别的。 (https://mesosphere.github.io/marathon/docs/application-basics.html)

因此,如果我使用教程中的应用程序部署清单作为基础,但我已将可执行文件上传到位于 /home/core/app 的主节点(在 linux 文件系统中) 并将 uri 更改为部署显示的“file:///home/core/app”

I0127 14:42:06.533756 40159 fetcher.cpp:167] 使用命令复制资源:cp '/home/core/app' '/var/lib/mesos/slave/slaves/a0ff5689-5816-4812-864b- b3c4b914a272-S0/frameworks/a0ff5689-5816-4812-864b-b3c4b914a272-0000/executors/dcos-101_app2.c641de8d-e49e-11e6-93c4-de7054394bed/runs/f266a0120c-1171-3ebbae-1171-3ebbae- cp: cannot stat '/home/core/app': 没有这样的文件或目录”

使用安装在 CoreOS 上的 DC/OS 1.8,一主一代理(仅用于开发测试)

我确定我只是缺少了一些基本的东西,比如 mesos 文件系统,但是我到处寻找教程,他们要么假设你使用 docker,要么通过 http 提供服务...没有文件://

因此,当使用 file:// uri 时,它的位置与 linux 文件系统不同,还是我遗漏了其他东西。

请对 DC/OS 新手提供一点帮助

谢谢

编辑

这里是 app.json 文件

{
  "id": "/dcos-101/app2",
  "cmd": "chmod u+x app && ./app",
  "args": null,
  "user": null,
  "env": null,
  "instances": 1,
  "cpus": 1,
  "mem": 128,
  "disk": 0,
  "gpus": 0,
  "executor": null,
  "constraints": null,
  "fetch": [
    {
      "uri": "file:///home/core/app"
    }
  ],
  "storeUrls": null,
  "backoffSeconds": 1,
  "backoffFactor": 1.15,
  "maxLaunchDelaySeconds": 3600,
  "container": null,
  "healthChecks": null,
  "readinessChecks": null,
  "dependencies": null,
  "upgradeStrategy": {
    "minimumHealthCapacity": 1,
    "maximumOverCapacity": 1
  },
  "acceptedResourceRoles": null,
  "ipAddress": null,
  "residency": null,
  "secrets": null,
  "taskKillGracePeriodSeconds": null,
  "portDefinitions": [
    {
      "protocol": "tcp",
      "port": 10000,
      "labels": {
        "VIP_0": "/dcos-101/app2:10000"
      }
    }
  ],
  "labels": {
    "HAPROXY_GROUP": "external"
  },
  "requirePorts": false
}

【问题讨论】:

  • 请提供您的 Marathon 应用规范,即定义您如何启动应用的 JSON 文件

标签: mesos marathon dcos


【解决方案1】:

这行不通,除非/home/core/app 存在于您的每个 代理节点上,或者您将其更改为外部 HTTP URL。 fetch 所做的是:它将列出的文件下载到 Mesos 沙箱中,具体取决于使用的 URI 模式。由于您使用的是 file: 架构,Mesos 会尝试将其下载到启动任务的代理(而不是主服务器)上。

【讨论】:

  • 谢谢,我通过将文件放在我的代理上进行了尝试,并且成功了。我假设 fetch 从您连接的主服务器上检索文件,然后将其放置在它正在部署到的节点的沙箱中。这对我来说更有意义。但是这个解决方案适用于快速开发的东西,所以我不必设置 http repo。感谢您的及时帮助!
猜你喜欢
  • 1970-01-01
  • 2011-12-12
  • 1970-01-01
  • 1970-01-01
  • 2016-08-14
  • 2013-04-05
  • 1970-01-01
  • 1970-01-01
  • 2012-01-27
相关资源
最近更新 更多