juju bundle 在 LXC 中的一台机器上部署?

juju bundle 在 LXC 中的一台机器上部署?

你好到目前为止我已经开发了包含三个 charms 的 juju charm bundle。我有两个问题(Q1)我需要在 LXC 中的一台机器上部署 juju charm bundle。我有三个 charms,通常当我部署 charm 时,它会部署在三台不同的机器上。我已经关注了这个问题(如何将 OpenStack 捆绑包部署到一台机器?) 并将“to:0”添加到我的 charm bundle yaml 文件中的每个 charm。然后我收到这个错误。

An error occurred while deploying the bundle: cannot assign unit "mysql/0" to machine 0: machine "0" cannot host units

所以首先我想知道是否有可能在一台机器中添加所有的魅力。如果可能的话我的捆绑包有什么问题。这里我附上了我的捆绑包。

sample:
  services:
    mysql:
      to: 0
      charm: "cs:precise/mysql-27"
      num_units: 1
      annotations:
        "gui-x": "139"
        "gui-y": "168"
    wordpress:
      to : 0
      charm: "cs:precise/wordpress-20"
      num_units: 1
      annotations:
        "gui-x": "481"
        "gui-y": "178"
  relations:
    - - "wordpress:db"
      - "mysql:db"

(Q2)我看到的最后一件事(http://marcoceppi.com/2014/06/deploying-openstack-with-just-two-machines/) 也就是说,可以在 OpenStack 中的一台机器中添加更多 charms。所以这是只有 charms 而不是 bundle 的手动安装。我想知道我有一个 bundle,并且我想使用 juju GUI 将我的 bundle 部署在一台机器中(因为我的云中只有三个节点)也在 OpenStack 中。可以吗??

答案1

我将在下面附加一个轻微的捆绑修改,以便您能够启动并运行。

sample:
  services:
    ubuntu:
      charm: "cs:trusty/ubuntu"
      num_units: 1
    mysql:
      to: lxc:ubuntu=0
      charm: "cs:precise/mysql-27"
      num_units: 1
      annotations:
        "gui-x": "139"
        "gui-y": "168"
    wordpress:
      to : lxc:ubuntu=0
      charm: "cs:precise/wordpress-20"
      num_units: 1
      annotations:
        "gui-x": "481"
        "gui-y": "178"
  relations:
    - - "wordpress:db"
      - "mysql:db"

我所做的不同之处在于将 ubuntu charm 部署到画布上,它只会部署一个 ubuntu 主机。没什么特别的——没有额外的配置。从那里,我部署到针对该主机的 LXC 容器,它将在 LXC 中存储您的 MySQL 和 Wordpress 实例 - 请注意,我们仍未解决外部世界的可访问性问题,这将需要一个反向代理服务器,例如 haproxy 来驻留在“ubuntu”节点上。不是 LXC,而是父服务。

juju deploy cs:trusty/haproxy --to ubuntu/0

或者如果你的机器 ID 是 #1

juju deploy cs:trusty/haproxy --to 1

从这里你应该看到总共消耗了 2 台机器(1 台用于引导程序,1 台用于 LXC 容器 + haproxy)

相关内容