是否可以在调试挂钩窗口中跟踪添加关系挂钩?

Kur*_*urt 5 juju openstack

是否可以在调试挂钩窗口中跟踪添加关系挂钩?是否需要设置特定的环境变量才能成功?

我的 juju-core 版本是 1.13.3。

我想观察 cloud-compute-relation-changed 钩子的运行情况,因为我在尝试添加 nova-cloud-controller 和 nova-compute 之间的关系时看到了这个失败:

amcet:2013-09-12 20:18:39 INFO juju context.go:221 worker/uniter: HOOK getaddrinfo xxn79: Name or service not known
amcet:2013-09-12 20:18:39 INFO juju server.go:105 worker/uniter/jujuc: running hook tool "juju-log" ["nova-cloud-controller ERROR: nova-cloud-controller: Couldn't obtain SSH host key from xxn79."]
amcet:2013-09-12 20:18:39 DEBUG juju server.go:106 worker/uniter/jujuc: hook context id "nova-cloud-controller/0:cloud-compute-relation-changed:4369123461286104487"; dir "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm"
amcet:2013-09-12 20:18:39 INFO juju juju-log.go:64 nova-cloud-controller/0 cloud-compute:32: nova-cloud-controller ERROR: nova-cloud-controller: Couldn't obtain SSH host key from xxn79.
amcet:2013-09-12 20:18:39 ERROR juju uniter.go:352 worker/uniter: hook failed: exit status 1
amcet:2013-09-12 20:18:39 DEBUG juju modes.go:412 worker/uniter: ModeAbide exiting
amcet:2013-09-12 20:18:39 INFO juju modes.go:410 worker/uniter: ModeHookError starting
Run Code Online (Sandbox Code Playgroud)

执行时,我从调试钩子窗口看不到真正有意义的输出。

小智 2

您应该在调试挂钩窗口中看到有意义的输出。我可以想到你可能不这样做的两个原因:

  1. 您在关系更改后或挂钩运行时运行了 debug-hooks
  2. 您没有使用正确的单元名称(例如 nova-cloud-controller/0)作为调试挂钩参数。

Juju 捕获钩子执行的标准输出并将其记录下来。现在过滤掉这个并不容易,但很快,我们可能会至少让它对 grep 友好。

看起来您收到的错误是这样的:

nova-cloud-controller:无法从 xxn79 获取 SSH 主机密钥。

juju debug-log尚未提供对日志进行过滤的功能,但这已在我们的路线图中。