我正在搭建一个有4台物理机的MAAS环境。
1 运行 MAAS 和 Ubuntu 13.04
3 是运行 Ubuntu 12.10 的 MAAS 节点(机器 0、1、2)
我的问题是,在 juju bootstrap 之后,只有机器 0 会获得正在运行的代理。所有 3 个节点都是在同一天设置的。
MAAS Web UI 将所有节点显示为"allocated to root"
。
您可以直接 ssh 到机器 1 和 2,并且似乎没有安装 juju 的任何痕迹。您不能juju ssh 1
或juju ssh 2
状态如下juju
:
system@ubuntu1:~$ juju status
2013-11-22 23:19:40,553 INFO Connecting to environment...
2013-11-22 23:19:41,137 INFO Connected to environment.
machines:
0:
agent-state: running
dns-name: 3ycae.ceph
instance-id: /MAAS/api/1.0/nodes/node-d4ef6adc-522b-11e3-abf4-deadbeeefb1a/
instance-state: unknown
1:
instance-id: pending
2:
instance-id: pending
3:
instance-id: pending
services: {}
2013-11-22 23:19:41,200 INFO 'status' command finished successfully
我尝试过 juju destroy-environment,它DNS
工作正常,它们都可以通过名称相互 ping。我已firewall
在主机上关闭它MAAS
。我尝试过部署服务,但无济于事。
system@ubuntu1:~$ juju status
2013-11-22 23:23:54,514 INFO Connecting to environment...
2013-11-22 23:23:55,082 INFO Connected to environment.
machines:
0:
agent-state: running
dns-name: 3ycae.ceph
instance-id: /MAAS/api/1.0/nodes/node-d4ef6adc-522b-11e3-abf4-deadbeeefb1a/
instance-state: unknown
1:
instance-id: pending
2:
instance-id: pending
3:
instance-id: pending
services:
munin:
charm: cs:precise/munin-3
relations: {}
units:
munin/4:
agent-state: pending
machine: 1
public-address: null
munin/5:
agent-state: pending
machine: 2
public-address: null
munin/6:
agent-state: pending
machine: 3
public-address: null
2013-11-22 23:23:55,221 INFO 'status' command finished successfully
如果我运行,juju -v ssh 1
我得到这个输出,也许这会给你一个线索。
system@ubuntu1:~$ juju -v ssh 1
2013-11-22 23:28:16,858 DEBUG Initializing juju ssh runtime
2013-11-22 23:28:16,862 INFO Connecting to environment...
2013-11-22 23:28:16,909 DEBUG Connecting to environment using 3ycae.ceph...
2013-11-22 23:28:16,909 DEBUG Spawning SSH process with remote_user="ubuntu" remote_host="3ycae.ceph" remote_port="2181" local_port="39791".
2013-11-22 23:28:17,416:6182(0x7fa5364bd700):ZOO_INFO@log_env@658: Client environment:zookeeper.version=zookeeper C client 3.3.5
2013-11-22 23:28:17,416:6182(0x7fa5364bd700):ZOO_INFO@log_env@662: Client environment:host.name=ubuntu1
2013-11-22 23:28:17,416:6182(0x7fa5364bd700):ZOO_INFO@log_env@669: Client environment:os.name=Linux
2013-11-22 23:28:17,416:6182(0x7fa5364bd700):ZOO_INFO@log_env@670: Client environment:os.arch=3.8.0-29-generic
2013-11-22 23:28:17,416:6182(0x7fa5364bd700):ZOO_INFO@log_env@671: Client environment:os.version=#42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013
2013-11-22 23:28:17,417:6182(0x7fa5364bd700):ZOO_INFO@log_env@679: Client environment:user.name=system
2013-11-22 23:28:17,417:6182(0x7fa5364bd700):ZOO_INFO@log_env@687: Client environment:user.home=/home/system
2013-11-22 23:28:17,417:6182(0x7fa5364bd700):ZOO_INFO@log_env@699: Client environment:user.dir=/home/system
2013-11-22 23:28:17,417:6182(0x7fa5364bd700):ZOO_INFO@zookeeper_init@727: Initiating client connection, host=localhost:39791 sessionTimeout=10000 watcher=0x7fa5344886b0 sessionId=0 sessionPasswd=<null> context=0x25c4150 flags=0
2013-11-22 23:28:17,418:6182(0x7fa531263700):ZOO_INFO@check_events@1585: initiated connection to server [127.0.0.1:39791]
2013-11-22 23:28:17,427:6182(0x7fa531263700):ZOO_INFO@check_events@1632: session establishment complete on server [127.0.0.1:39791], sessionId=0x1427dc75f5d003a, negotiated timeout=10000
2013-11-22 23:28:17,431 DEBUG Environment is initialized.
2013-11-22 23:28:17,431 INFO Connected to environment.
2013-11-22 23:28:17,432 DEBUG Fetching machine address using juju machine id.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
result = g.send(result)
File "/usr/lib/python2.7/dist-packages/juju/control/utils.py", line 56, in get_ip_address_for_machine
provider_machine = yield provider.get_machine(instance_id)
File "/usr/lib/python2.7/dist-packages/juju/providers/common/base.py", line 178, in get_machine
d = self.get_machines([instance_id])
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
result = g.send(result)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/provider.py", line 91, in get_machines
instances = yield self.maas_client.get_nodes(instance_ids)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 96, in get_nodes
for resource_uri in resource_uris)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 96, in <genexpr>
for resource_uri in resource_uris)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 35, in extract_system_id
match = _re_resource_uri.search(resource_uri)
exceptions.TypeError: expected string or buffer
2013-11-22 23:28:17,457 ERROR Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
result = g.send(result)
File "/usr/lib/python2.7/dist-packages/juju/control/utils.py", line 56, in get_ip_address_for_machine
provider_machine = yield provider.get_machine(instance_id)
File "/usr/lib/python2.7/dist-packages/juju/providers/common/base.py", line 178, in get_machine
d = self.get_machines([instance_id])
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
result = g.send(result)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/provider.py", line 91, in get_machines
instances = yield self.maas_client.get_nodes(instance_ids)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 96, in get_nodes for resource_uri in resource_uris)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 96, in <genexpr> for resource_uri in resource_uris)
File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 35, in extract_system_id
match = _re_resource_uri.search(resource_uri)
exceptions.TypeError: expected string or buffer
expected string or buffer
2013-11-22 23:28:17,459 ERROR expected string or buffer
system@ubuntu1:~$
我该如何解决这个问题?
答案1
根据回溯,您正在使用 Juju 0.7 - Juju 的最新稳定版本是 1.16.3 - 请破坏环境,将 juju 升级到 1.16.3,然后尝试再次引导。
答案2
我现在有 3 节点 Ceph 集群在运行,并且每次都可以将其拆除并重建。
我正在使用 Ubuntu 12.04 LTS 和 MAAS 1.2+bzr1373+dfsg-0ubuntu1~ 和 juju 0.5+bzr531-0ubuntu1.3。
这就是我完成这个设置后学到的知识。
A) 3 节点 Ceph 集群需要 5 台机器。
- MAAS 服务器
Zookeeper 服务器(始终是机器 0)
3,4,5. 将部署 Ceph 的 3 个节点
B)加入 MAAS、启动节点和执行 juju bootstrap 的顺序非常关键。
以下是我推荐的步骤...
按照标准安装指南安装 MAAS 和 juju 包。
准备好 1 台机器进行 PXE 启动。这台机器将成为机器 0,并充当 zookeeper。
PXE 启动机器并等待它启动并自动关机。它现在将显示在 MAAS Gui 中。
从 MAAS Gui 编辑节点并接受/委托该节点。它可能不会 WOL,因此请手动启动它或使用“powerwake MAC_Address”。让它启动并等待它自动关闭。MAAS Gui 节点状态现在为“就绪”。
现在您必须在 MAAS 服务器上运行“juju bootstrap”。再次启动节点(请勿使用 MAAS Gui 启动按钮)。节点现在将安装操作系统并安装 zookeeper。完成后运行 juju status,机器 0 将运行。MAAS Gui 节点状态将为“分配给 root”。
现在准备好 3 个 CEPH 节点。使用 PXE 启动它们并等待它们自动启动和关闭。它们现在将处于 MAAS 中。从 MAAS Gui 接受/委托它们。使用“powerwake MAC_address”再次启动它们。等待它们自动启动和关闭。它们现在将具有 MAAS 就绪状态,并且 juju 状态将显示机器 1、2 和 3 作为实例 ID:待定。
现在运行“juju deploy --config ./ceph.yaml -n 3 ceph”。此时 juju 想要配置另外 3 台机器。
使用“powerwake MAC_address”启动 3 个 CEPH 节点中的每一个,它们将分别安装操作系统并接收 CEPH 配置。
这最后一步需要一些时间,所以要克制住破坏它并重新开始的冲动。要有耐心。
注意# 我发现如果 ceph.yaml 文件中有 osd-journal:,CEPH charm 将不会安装 osd 组件。
这是我的 ceph.yaml:
ceph:
fsid: 6ca7da3e-4760-11e3-836d-ab53797f3654
monitor-secret: AQDoDntSQErjFBAAMcVBPAiMgVNdqSO7tjjGDw==
osd-devices: /dev/sdb /dev/sdc /dev/sdd /dev/sde
最后你会拥有像这样的魔力状态......
system@ubuntu1:~$ juju status
2013-11-27 10:13:08,997 INFO Connecting to environment...
2013-11-27 10:13:09,888 INFO Connected to environment.
machines:
0:
agent-state: running
dns-name: rawpt.ceph
instance-id: /MAAS/api/1.0/nodes/node-69ef3540-557e-11e3-91c1-deadbeeefb1a/
instance-state: unknown
1:
agent-state: running
dns-name: mm6c3.ceph
instance-id: /MAAS/api/1.0/nodes/node-cf74149e-5583-11e3-8493-deadbeeefb1a/
instance-state: unknown
2:
agent-state: running
dns-name: tknpg.ceph
instance-id: /MAAS/api/1.0/nodes/node-49682620-5587-11e3-8493-deadbeeefb1a/
instance-state: unknown
3:
agent-state: running
dns-name: 3ghwq.ceph
instance-id: /MAAS/api/1.0/nodes/node-6da6cfd2-5587-11e3-91c1-deadbeeefb1a/
instance-state: unknown
services:
ceph:
charm: cs:precise/ceph-18
relations:
mon:
- ceph
units:
ceph/10:
agent-state: started
machine: 2
public-address: tknpg.ceph
ceph/11:
agent-state: started
machine: 3
public-address: 3ghwq.ceph
ceph/9:
agent-state: started
machine: 1
public-address: mm6c3.ceph
2013-11-27 10:13:10,110 INFO 'status' command finished successfully
system@ubuntu1:~$ juju ssh 1 sudo ceph -s
2013-11-27 10:24:12,452 INFO Connecting to environment...
2013-11-27 10:24:13,026 INFO Connected to environment.
2013-11-27 10:24:13,059 INFO Connecting to machine 1 at mm6c3.ceph
health HEALTH_OK
monmap e2: 3 mons at {3ghwq=191.168.0.152:6789/0,mm6c3=191.168.0.150:6789/0,tknpg=191.168.0.151:6789/0}, election epoch 2, quorum 0,1,2 3ghwq,mm6c3,tknpg
osdmap e25: 12 osds: 12 up, 12 in
pgmap v120: 192 pgs: 192 active+clean; 0 bytes data, 12446 MB used, 44678 GB / 44690 GB avail
mdsmap e1: 0/0/1 up