使用LXC时Juju卡在“待定”状态[关闭]


8

所以我试图开始使用Juju,并尝试使用LXC在本地进行。

我按照此处的说明进行操作:如何为本地使用配置juju?

不幸的是,这似乎不适用于我。

状态显示以下内容:

$ juju status
machines:
  0:
    agent-state: running
    dns-name: localhost
    instance-id: local
    instance-state: running
services:
  mysql:
    charm: cs:precise/mysql-1
    relations:
      db:
      - wordpress
    units:
      mysql/0:
        agent-state: pending
        machine: 0
        public-address: null
  wordpress:
    charm: cs:precise/wordpress-0
    exposed: true
    relations:
      db:
      - mysql
    units:
      wordpress/0:
        agent-state: pending
        machine: 0
        open-ports: []
        public-address: null
2012-05-10 14:09:38,155 INFO 'status' command finished successfully

如您所见,座席状态为“待定”,并且没有可以访问新创建站点的公共地址。我在这里想念什么吗?

更新:尝试破坏环境,然后再次执行所有操作(多次)。这是debug-log的输出:

~$ juju debug-log 
2012-05-11 08:50:23,790 INFO Enabling distributed debug log.
2012-05-11 08:50:23,806 INFO Tailing logs - Ctrl-C to stop.
2012-05-11 08:50:42,338 Machine:0: juju.agents.machine DEBUG: Units changed old:set([]) new:set(['mysql/0'])
2012-05-11 08:50:42,339 Machine:0: juju.agents.machine DEBUG: Starting service unit: mysql/0 ...
2012-05-11 08:50:42,459 Machine:0: unit.deploy DEBUG: Downloading charm cs:precise/mysql-1 to /home/andre/.juju/data/andre-local/charms
2012-05-11 08:50:42,620 Machine:0: unit.deploy DEBUG: Using <juju.machine.unit.UnitContainerDeployment object at 0x9c54b6c> for mysql/0 in /home/andre/.juju/data/andre-local
2012-05-11 08:50:42,648 Machine:0: unit.deploy DEBUG: Starting service unit mysql/0...
2012-05-11 08:50:42,649 Machine:0: unit.deploy DEBUG: Creating master container...
2012-05-11 08:54:33,992 Machine:0: unit.deploy DEBUG: Created master container andre-local-0-template
2012-05-11 08:54:33,993 Machine:0: unit.deploy INFO: Creating container mysql-0...
2012-05-11 08:56:18,760 Machine:0: unit.deploy INFO: Container created for mysql/0
2012-05-11 08:56:19,466 Machine:0: unit.deploy DEBUG: Charm extracted into container
2012-05-11 08:56:19,569 Machine:0: unit.deploy DEBUG: Starting container...
2012-05-11 08:56:22,707 Machine:0: unit.deploy INFO: Started container for mysql/0
2012-05-11 08:56:22,707 Machine:0: unit.deploy INFO: Started service unit mysql/0
2012-05-11 08:56:23,012 Machine:0: juju.agents.machine DEBUG: Units changed old:set(['mysql/0']) new:set(['wordpress/0', 'mysql/0'])
2012-05-11 08:56:23,039 Machine:0: juju.agents.machine DEBUG: Starting service unit: wordpress/0 ...
2012-05-11 08:56:23,154 Machine:0: unit.deploy DEBUG: Downloading charm cs:precise/wordpress-0 to /home/andre/.juju/data/andre-local/charms
2012-05-11 08:56:23,396 Machine:0: unit.deploy DEBUG: Using <juju.machine.unit.UnitContainerDeployment object at 0x9c519cc> for wordpress/0 in /home/andre/.juju/data/andre-local
2012-05-11 08:56:23,620 Machine:0: unit.deploy DEBUG: Starting service unit wordpress/0...
2012-05-11 08:56:23,621 Machine:0: unit.deploy INFO: Creating container wordpress-0...
2012-05-11 08:58:24,739 Machine:0: unit.deploy INFO: Container created for wordpress/0
2012-05-11 08:58:25,163 Machine:0: unit.deploy DEBUG: Charm extracted into container
2012-05-11 08:58:25,397 Machine:0: unit.deploy DEBUG: Starting container...
2012-05-11 08:58:27,982 Machine:0: unit.deploy INFO: Started container for wordpress/0
2012-05-11 08:58:27,983 Machine:0: unit.deploy INFO: Started service unit wordpress/0

这是状态命令的结果(带有详细标志):

~$ juju -v status
2012-05-11 08:51:53,464 DEBUG Initializing juju status runtime
2012-05-11 08:51:53,625:4030(0xb7345b00):ZOO_INFO@log_env@658: Client environment:zookeeper.version=zookeeper C client 3.3.5
2012-05-11 08:51:53,625:4030(0xb7345b00):ZOO_INFO@log_env@662: Client environment:host.name=andre-ufo
2012-05-11 08:51:53,625:4030(0xb7345b00):ZOO_INFO@log_env@669: Client environment:os.name=Linux
2012-05-11 08:51:53,625:4030(0xb7345b00):ZOO_INFO@log_env@670: Client environment:os.arch=3.2.0-24-generic-pae
2012-05-11 08:51:53,625:4030(0xb7345b00):ZOO_INFO@log_env@671: Client environment:os.version=#37-Ubuntu SMP Wed Apr 25 10:47:59 UTC 2012
2012-05-11 08:51:53,626:4030(0xb7345b00):ZOO_INFO@log_env@679: Client environment:user.name=andre
2012-05-11 08:51:53,626:4030(0xb7345b00):ZOO_INFO@log_env@687: Client environment:user.home=/home/andre
2012-05-11 08:51:53,626:4030(0xb7345b00):ZOO_INFO@log_env@699: Client environment:user.dir=/home/andre
2012-05-11 08:51:53,626:4030(0xb7345b00):ZOO_INFO@zookeeper_init@727: Initiating client connection, host=192.168.122.1:41779 sessionTimeout=10000 watcher=0xb7780620 sessionId=0 sessionPasswd=<null> context=0x9242ee8 flags=0
2012-05-11 08:51:53,627:4030(0xb6b90b40):ZOO_INFO@check_events@1585: initiated connection to server [192.168.122.1:41779]
2012-05-11 08:51:53,649:4030(0xb6b90b40):ZOO_INFO@check_events@1632: session establishment complete on server [192.168.122.1:41779], sessionId=0x1373ae057d90007, negotiated timeout=10000
2012-05-11 08:51:53,651 DEBUG Environment is initialized.
machines:
  0:
    agent-state: running
    dns-name: localhost
    instance-id: local
    instance-state: running
services:
  mysql:
    charm: cs:precise/mysql-1
    relations:
      db:
      - wordpress
    units:
      mysql/0:
        agent-state: pending
        machine: 0
        public-address: null
  wordpress:
    charm: cs:precise/wordpress-0
    relations:
      db:
      - mysql
    units:
      wordpress/0:
        agent-state: pending
        machine: 0
        public-address: null

您可以编辑问题并链接下面的示例吗?
豪尔赫·卡斯特罗

还可以添加'ps auxf'的输出吗?这应该表明wordpress节点仍在挂起,因为它仍在安装其某些组件。如果硬盘驱动器速度慢且RAM不足,则连接速度很慢,安装这些节点可能需要10分钟以上的时间。
SpamapS 2012年

juju bzr分支中有一个有用的工具,该工具将向我们反馈一些信息。您是否可以使用来抓取它bzr branch lp:juju,然后sudo misc/devel-tools/juju-inspect-local-providersudo lxc-ls针对列出的每个图像运行并运行上述工具,因此我们可以看到容器内所有日志的输出。
SpamapS 2012年

Answers:


10

我遇到了同样的错误,在#juju的好帮手的帮助下,我能够确定在主机上打开防火墙已阻止了zookeeper重新连接到主机。

尝试运行:

sudo ufw disable

然后:

sudo juju destroy-environment

然后把东西放回去 另外,如果这是您第一次在计算机上引导环境,请注意,完成初始魅力下载需要花费一些时间,因此请在部署单元后15-20分钟给它。

这也是一个未解决的错误,因为juju应该会自动处理这种情况。


2
禁用了防火墙,它立即起作用。我希望他们能解决此错误,让我感到不安,以禁用我的ufw,但是至少我现在可以尝试并使用juju玩,直到有服务器可以玩为止:)
Andre

3

如果这是您第一次引导您的本地环境,则将花费几个时间(取决于下载大约400MB的服务器映像数据需要多长时间)来构建第一个主映像。在您的“ data-dir”路径(在您的environment.yaml文件中定义)中machine-agent.log,描述了此过程:

2012-05-09 10:04:03,848: juju.agents.machine@INFO: Machine agent started id:0
2012-05-09 10:05:08,175: juju.agents.machine@DEBUG: Units changed old:set([]) new:set(['mysql/0'])
2012-05-09 10:05:08,176: juju.agents.machine@DEBUG: Starting service unit: mysql/0 ...
2012-05-09 10:05:08,222: unit.deploy@DEBUG: Downloading charm cs:precise/mysql-1 to /home/marco/.juju/local/marco-local/charms
2012-05-09 10:05:08,314: unit.deploy@DEBUG: Using <juju.machine.unit.UnitContainerDeployment object at 0x9cccbec> for mysql/0 in /home/marco/.juju/local/marco-local
2012-05-09 10:05:08,375: unit.deploy@DEBUG: Starting service unit mysql/0...
2012-05-09 10:05:08,376: unit.deploy@DEBUG: Creating master container...

稍后,您将看到以下内容:

2012-05-09 10:09:40,699: unit.deploy@DEBUG: Created master container marco-local-0-template
2012-05-09 10:09:40,699: unit.deploy@INFO: Creating container mysql-0...
2012-05-09 10:10:31,429: unit.deploy@INFO: Container created for mysql/0
2012-05-09 10:10:31,483: unit.deploy@DEBUG: Charm extracted into container

几分钟后详细说明了主容器的创建。

最后,并非每个“本地” boostrap都能正常运行,请尝试运行juju destroy-environment然后重新运行juju bootstrap


谢谢回复。我正在重新启动该过程,并密切注意日志以查看发生了什么。
安德烈(Andre)

破坏juju环境后,我是否必须重新部署魅力?还是它们基本上已经“安装”了?
安德烈(Andre)2012年

@Andre您将不得不重新部署。进行销毁环境将实质上删除该环境及其上运行的所有内容。
Marco Ceppi

不幸的是仍然没有运气。我已经尝试了多次,并等待确保一切完成。我用详细状态和调试日志更新了原始帖子。
安德烈(Andre)

1

我有同样的问题。我发现master-customize.log由于apt-cacher-ng中的软件包损坏而导致apt-get失败(我不确定这是因为我的笔记本电脑在下载过程中挂起了)。我可以通过访问http://localhost:3142/acng-report.html,检查以下信息来纠正问题:

  • 通过文件名和文件目录进行验证(不推荐),
  • 然后通过校验和(SLOW)验证文件内容,还检测损坏的文件,
  • 然后立即截断损坏的文件。

并单击开始扫描和/或到期。然后,我能够销毁枣环境并成功地重新部署它。


0

除了禁用ufw之外,还可以尝试通过以下方式允许juju的(libvirt)网络:

sudo ufw allow from `ip addr show virbr0|tail -n 1 |cut -d' ' -f 6` to any

在我的情况下可以在Ubuntu 12.04上使用

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.