我一直在尝试 MAAS,https://insights.ubuntu.com/2013/11/15/interested-in-maas-and-juju-heres-how-to-try-it-in-a-vm/,使用 14.04。我肯定做错了什么,因为我无法引导 MAAS 环境。这是我的 environment.yaml 的相关部分:maas:类型:maas
# maas-server specifies the location of the MAAS server. It must
# specify the base path.
#
maas-server: 'http://10.0.0.10/MAAS/'
# maas-oauth holds the OAuth credentials from MAAS.
#
maas-oauth: 'xxxxx...xxxxxx'
admin-secret: '123456'
default-series: 'trusty'
目标节点处于就绪状态,如 MAAS web gui 中所示,我可以通过 ssh 连接到它,ssh[电子邮件保护]。但是,在登录目标节点时,bootstrap 卡住了:
2014-05-15 16:36:43 INFO juju.cmd supercommand.go:297 running juju-1.18.1-trusty-amd64 [gc]
2014-05-15 16:36:43 WARNING juju.cmd.juju common.go:40 ignoring environments.yaml: using bootstrap config in file "/home/navesta/.juju/environments/maas.jenv"
2014-05-15 16:36:43 DEBUG juju.environs open.go:86 ConfigForName found bootstrap config map[string]interface {}{"bootstrap-addresses-delay":10, "ca-cert":"-----BEGIN CERTIFICATE-----\nMIICWTCCAcSgAwIBAgIBADALBgkqhkiG9w0BAQUwQjENMAsGA1UEChMEanVqdTEx\nMC8GA1UEAwwoanVqdS1nZW5lcmF0ZWQgQ0EgZm9yIGVudmlyb25tZW50ICJtYWF
...
2014-05-15 16:36:49 DEBUG juju.provider.maas environ.go:311 maas user data; 1315 bytes
2014-05-15 16:36:50 DEBUG juju.provider.maas environ.go:317 started instance "/MAAS/api/1.0/nodes/node-2ce27bec-dba9-11e3-940c-525400bba9bf/"
- /MAAS/api/1.0/nodes/node-2ce27bec-dba9-11e3-940c-525400bba9bf/
2014-05-15 16:36:50 DEBUG juju.environs.bootstrap state.go:41 putting "provider-state" to bootstrap storage *maas.maasStorage
Waiting for address
Attempting to connect to hbby7.maas:22
Attempting to connect to 10.0.0.31:22
2014-05-15 16:36:50 DEBUG juju.utils.ssh ssh_openssh.go:122 running: ssh -o "StrictHostKeyChecking no" -o "PasswordAuthentication no" -i /home/navesta/.juju/ssh/juju_id_rsa -i /home/navesta/.ssh/id_rsa [email protected] /bin/bash
2014-05-15 16:36:50 DEBUG juju.utils.ssh ssh_openssh.go:122 running: ssh -o "StrictHostKeyChecking no" -o "PasswordAuthentication no" -i /home/navesta/.juju/ssh/juju_id_rsa -i /home/navesta/.ssh/id_rsa [email protected] /bin/bash
2014-05-15 16:36:55 DEBUG juju.utils.ssh ssh_openssh.go:122 running: ssh -o "StrictHostKeyChecking no" -o "PasswordAuthentication no" -i /home/navesta/.juju/ssh/juju_id_rsa -i /home/navesta/.ssh/id_rsa [email protected] /bin/bash
我的问题的另一个症状是,虽然我的目标节点处于就绪状态,但它会在重新启动时关闭。为了避免这个问题,我必须将其置于已分配模式并重新启动它。我尝试过移除、重新调试和销毁大规模环境,但都无济于事。(还关注了,丢失 Juju 配置后重置 MAAS?,但 API 似乎已经改变。)任何提示或想法都值得赞赏。干杯,
答案1
因此,在尝试使用 Juju 之前,您应该让节点处于就绪状态。确保所有虚拟机都设置为网络启动并关闭。MAAS 会在需要时(即当 Juju 想要向它们部署某些东西时)启动它们。
您可能遇到的一个问题是 Juju 尝试通过 SSH 连接到节点时可能会超时。您可以在 environment.yaml 文件中配置超时长度。请参阅Juju 1.18.0 发行说明了解更多详情。
答案2
juju juju.utils.ssh ssh_openssh.go 忽略 .ssh/config 和 $ ssh <...> /bin/bash 需要额外的选项 -o "RequestTTY yes"
似乎在上游有一个双 -t 来“解决”这个问题,但我的建议是使用 .ssh/config