我正在遵循以下说明 -如何配置 juju 以供本地使用?一切看起来都很好,直到:
juju deploy mysql
- 这使
2012-08-01 16:14:58,560 INFO Searching for charm cs:precise/mysql in charm store
User timeout caused connection failure.
2012-08-01 16:15:28,592 ERROR User timeout caused connection failure.
~/juju/samples/charms/
是空的。
juju bootstrap 在 10 秒内完成,我怀疑这是不正确的
geme@GEME1:~$ juju bootstrap
2012-08-01 16:13:11,878 INFO Bootstrapping environment 'sample' (origin: distro type: local)...
2012-08-01 16:13:11,880 INFO Checking for required packages...
2012-08-01 16:13:12,525 INFO Starting networking...
2012-08-01 16:13:12,870 INFO Starting zookeeper...
2012-08-01 16:13:13,041 INFO Starting storage server...
2012-08-01 16:13:15,474 INFO Initializing zookeeper hierarchy
2012-08-01 16:13:17,846 INFO Starting machine agent (origin: distro)...
2012-08-01 16:13:19,483 INFO Environment bootstrapped
2012-08-01 16:13:19,487 INFO 'bootstrap' command finished successfully
状态显示:
geme@GEME1:~$ juju status
machines:
0:
agent-state: running
dns-name: localhost
instance-id: local
instance-state: running
services: {}
2012-08-01 16:13:28,304 INFO 'status' command finished successfully
geme@GEME1:~$ juju -v status
2012-08-01 16:13:44,419 DEBUG Initializing juju status runtime
2012-08-01 16:13:44,522:2807(0xb77abb00):ZOO_INFO@log_env@658: Client environment:zookeeper.version=zookeeper C client 3.3.5
2012-08-01 16:13:44,522:2807(0xb77abb00):ZOO_INFO@log_env@662: Client environment:host.name=GEME1
2012-08-01 16:13:44,523:2807(0xb77abb00):ZOO_INFO@log_env@669: Client environment:os.name=Linux
2012-08-01 16:13:44,523:2807(0xb77abb00):ZOO_INFO@log_env@670: Client environment:os.arch=3.2.0-23-generic-pae
2012-08-01 16:13:44,523:2807(0xb77abb00):ZOO_INFO@log_env@671: Client environment:os.version=#36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012
2012-08-01 16:13:44,532:2807(0xb77abb00):ZOO_INFO@log_env@679: Client environment:user.name=geme
2012-08-01 16:13:44,535:2807(0xb77abb00):ZOO_INFO@log_env@687: Client environment:user.home=/home/geme
2012-08-01 16:13:44,535:2807(0xb77abb00):ZOO_INFO@log_env@699: Client environment:user.dir=/home/geme
2012-08-01 16:13:44,535:2807(0xb77abb00):ZOO_INFO@zookeeper_init@727: Initiating client connection, host=192.168.122.1:59761 sessionTimeout=10000 watcher=0xd9f620 sessionId=0 sessionPasswd=<null> context=0x8a43440 flags=0
2012-08-01 16:13:44,545:2807(0xb7483b40):ZOO_INFO@check_events@1585: initiated connection to server [192.168.122.1:59761]
2012-08-01 16:13:44,564:2807(0xb7483b40):ZOO_INFO@check_events@1632: session establishment complete on server [192.168.122.1:59761], sessionId=0x138e2bf765f0003, negotiated timeout=10000
2012-08-01 16:13:44,573 DEBUG Environment is initialized.
machines:
0:
agent-state: running
dns-name: localhost
instance-id: local
instance-state: running
services: {}
2012-08-01 16:13:44,599 INFO 'status' command finished successfully
使用详细标志:
juju -vv deploy mysql
2012-08-02 17:37:52,895 DEBUG Initializing juju deploy runtime
2012-08-02 17:37:52,897 INFO Searching for charm cs:precise/mysql in charm store
Traceback (most recent call last):<br>
Failure: twisted.internet.error.TimeoutError: User timeout caused connection failure.
2012-08-02 17:38:22,936 ERROR Traceback (most recent call last):
Failure: twisted.internet.error.TimeoutError: User timeout caused connection failure.
User timeout caused connection failure.
2012-08-02 17:38:22,942 ERROR User timeout caused connection failure.
答案1
引导过程快速完成是意料之中的。在大多数环境中,引导过程实际上会启动一台机器,当您使用本地部署时,它只会创建第一个 LXC 容器并设置网络。因此这通常需要 10-20 秒。奇迹发生在第一次部署中,如这个本地配置问题,此时 Juju 下载约 300MB 的服务器映像并创建“主容器”,所有未来部署都基于此。
现在,您收到的错误似乎表明尝试访问 Juju Charm 商店时超时。我没注意到有任何中断,但这可能是因为您使用了代理或其他类型的网络问题/超时。我建议重试 ( juju destroy-environment -e local
) 然后重新引导。
如果您遇到代理问题,您可以使用 Bazaar 在本地下载 charms:
mkdir -p ~/charms/precise
cd ~/charms/precise
bzr branch lp:charms/mysql
juju deploy --repository=~/charms local:mysql
虽然目录可以是任何内容,但需要遵循的重要事项是每个 charm 都需要位于一个系列文件夹中(遵循 Ubuntu 版本名称)。除此之外,您还可以使用--repository
它来指示 Juju 搜索这里用于魅力,前缀local:
告诉 Juju 部署将从该本地--repository
路径进行。