在删除关系之前销毁服务会导致两个服务都挂起

在删除关系之前销毁服务会导致两个服务都挂起

我部署了 wordpress 和 mysql,并添加了 wordpress 和 mysql 之间的关系。我尝试在删除 wordpress 和 mysql 之间的关系之前销毁 wordpress。

现在,这两项服务都挂了。我该怎么办?有没有办法手动彻底删除该服务?

我正在运行 Ubuntu 12.04 LTS。

以下是 juju status mysql 的输出:

controller:~$ juju status mysql
environment: maas
machines:
  "0":
    agent-state: started
    agent-version: 1.16.6.1
    dns-name: node-1.master
    instance-id: /MAAS/api/1.0/nodes/node-345fea0a-9f84-11e3-88be-525400429c50/
    series: precise
services:
  mysql:
    charm: cs:precise/mysql-35
    exposed: false
    life: dying
    relations:
      cluster:
      - mysql
      db:
      - wordpress
    units:
      mysql/0:
        agent-state: started
        agent-version: 1.16.6.1
        life: dying
        machine: "0"
        public-address: node-1.master

juju status 的部分输出(是的,它以 db: - mysql 结束)

  wordpress:
    charm: cs:precise/wordpress-21
    exposed: false
    life: dying
    relations:
      db:
      - mysql

日志相关(juju debug-log):

node-1:014-03-03 19:32:12 INFO juju runner.go:253 worker: start "uniter"
node-1:014-03-03 19:32:12 INFO juju.worker.uniter uniter.go:83 unit "mysql/0" started
node-1:014-03-03 19:32:12 INFO juju.worker.uniter modes.go:421 ModeInit starting
node-1:014-03-03 19:32:12 INFO juju.worker.uniter modes.go:29 updating unit addresses
node-1:014-03-03 19:32:12 INFO juju.worker.uniter.filter filter.go:454 unit is dying
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:504 charm check         skipped, unit is dying
node-1:014-03-03 19:32:12 INFO juju.worker.uniter modes.go:54 reconciling relation state
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:322 got service change
node-1:014-03-03 19:32:12 INFO juju.worker.uniter uniter.go:517 joining relation "wordpress:db mysql:db"
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:504 charm check     skipped, unit is dying
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:338 got relations change
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:314 got unit change
node-1:014-03-03 19:32:12 INFO juju.worker.uniter uniter.go:543 joined relation "wordpress:db mysql:db"
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter modes.go:423 ModeInit exiting
node-1:014-03-03 19:32:12 INFO juju.worker.uniter modes.go:421 ModeContinue starting
node-1:014-03-03 19:32:12 INFO juju.worker.uniter modes.go:67 loading uniter state
node-1:014-03-03 19:32:12 INFO juju.worker.uniter modes.go:108 found uncommitted     "config-changed" hook
node-1:014-03-03 19:32:12 INFO juju.worker.uniter uniter.go:363 committing "config-    changed" hook
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:330 got config change
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter.filter filter.go:334 preparing new config event
node-1:014-03-03 19:32:12 ERROR juju git.go:188 worker/uniter/charm: git command failed: exit status 128
node-1:ath: /var/lib/juju/agents/unit-mysql-0/charm
node-1:rgs: []string{"commit", "--allow-empty", "-m", "Completed \"config-changed\" hook."}
node-1:rror: object file .git/objects/d4/7f136f29e2319929b668b4e7917dca934b462f is     empty
node-1:atal: loose object d47f136f29e2319929b668b4e7917dca934b462f (stored in .git/objects/d4/7f136f29e2319929b668b4e7917dca934b462f) is corrupt
node-1:014-03-03 19:32:12 DEBUG juju.worker.uniter modes.go:423 ModeContinue exiting
node-1:014-03-03 19:32:12 INFO juju.worker.uniter uniter.go:105 unit "mysql/0"     shutting down: ModeContinue: git commit failed: exit status 128
node-1:014-03-03 19:32:12 ERROR juju.worker.uniter.filter filter.go:117 tomb: dying
node-1:014-03-03 19:32:12 ERROR juju runner.go:211 worker: exited "uniter":     ModeContinue: git commit failed: exit status 128
node-1:014-03-03 19:32:12 INFO juju runner.go:245 worker: restarting "uniter" in 3s
node-1:014-03-03 19:32:15 INFO juju runner.go:253 worker: start "uniter"
node-1:014-03-03 19:32:15 INFO juju.worker.uniter uniter.go:83 unit "mysql/0" started
node-1:014-03-03 19:32:15 INFO juju.worker.uniter modes.go:421 ModeInit starting
node-1:014-03-03 19:32:15 INFO juju.worker.uniter modes.go:29 updating unit addresses
node-1:014-03-03 19:32:15 INFO juju.worker.uniter.filter filter.go:454 unit is dying
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:504 charm check     skipped, unit is dying
node-1:014-03-03 19:32:15 INFO juju.worker.uniter modes.go:54 reconciling relation     state
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:322 got service     change
node-1:014-03-03 19:32:15 INFO juju.worker.uniter uniter.go:517 joining relation     "wordpress:db mysql:db"
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:504 charm check     skipped, unit is dying
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:338 got relations     change
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:314 got unit     change
node-1:014-03-03 19:32:15 INFO juju.worker.uniter uniter.go:543 joined relation     "wordpress:db mysql:db"
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter modes.go:423 ModeInit exiting
node-1:014-03-03 19:32:15 INFO juju.worker.uniter modes.go:421 ModeContinue starting
node-1:014-03-03 19:32:15 INFO juju.worker.uniter modes.go:67 loading uniter state
node-1:014-03-03 19:32:15 INFO juju.worker.uniter modes.go:108 found uncommitted     "config-changed" hook
node-1:014-03-03 19:32:15 INFO juju.worker.uniter uniter.go:363 committing "config-    changed" hook
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:330 got config     change
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter.filter filter.go:334 preparing new     config event
node-1:014-03-03 19:32:15 ERROR juju git.go:188 worker/uniter/charm: git command     failed: exit status 128
node-1:ath: /var/lib/juju/agents/unit-mysql-0/charm
node-1:rgs: []string{"commit", "--allow-empty", "-m", "Completed \"config-changed\"     hook."}
node-1:rror: object file .git/objects/d4/7f136f29e2319929b668b4e7917dca934b462f is empty
node-1:atal: loose object d47f136f29e2319929b668b4e7917dca934b462f (stored in     .git/objects/d4/7f136f29e2319929b668b4e7917dca934b462f) is corrupt
node-1:014-03-03 19:32:15 DEBUG juju.worker.uniter modes.go:423 ModeContinue exiting
node-1:014-03-03 19:32:15 INFO juju.worker.uniter uniter.go:105 unit "mysql/0"     shutting down: ModeContinue: git commit failed: exit status 128
node-1:014-03-03 19:32:15 ERROR juju.worker.uniter.filter filter.go:117 tomb: dying
node-1:014-03-03 19:32:15 ERROR juju runner.go:211 worker: exited "uniter":     ModeContinue: git commit failed: exit status 128
node-1:014-03-03 19:32:15 INFO juju runner.go:245 worker: restarting "uniter" in 3s

如果有简单的解决方法请告诉我?任何建议都将不胜感激。谢谢。

答案1

我不能 100% 肯定这适用于 MAAS - 但我知道这种方法适用于其他提供商。当我想销毁一项服务并且它“卡”在垂死状态时,以您的 wordpress 部署为例:

juju resolve wordpress/0

现在,如果这不能解决问题,因此,它会继续在错误状态下从一个钩子转到另一个钩子,我将极其严重地破坏机器。(请注意,这会导致机器无法恢复,应谨慎对待,就像任何 rm -rf 操作一样 - 这将破坏有问题的机器)

从命令中获取机器 ID juju status- 然后:

 juju destroy-machine --force <machine_id>

如果这继续使 mysql 服务处于困境,您可以按照上述工作流程手动解决它:

juju resolve mysql/0

如果一切都失败了,而你又不关心数据

juju destroy-machine --force <machine_id>

关于日志输出 - 知道有人在努力让 juju 不再使用 git,因此最终用户不会遇到此类问题。我不知道此功能何时会推出,但目前仍在开发中。

相关内容