如何重新排列 Juju 上的机器编号?

如何重新排列 Juju 上的机器编号?

我有以下输出juju status

environment: manual
machines:
  "0":
    agent-state: started
    agent-version: 1.20.9
    dns-name: juju.local
    instance-id: 'manual:'
    series: trusty
    hardware: arch=amd64 cpu-cores=1 mem=480M
    state-server-member-status: has-vote
  "1":
    agent-state: down
    agent-state-info: (started)
    agent-version: 1.20.9
    dns-name: mysql.local
    instance-id: manual:mysql.local
    series: trusty
    hardware: arch=amd64 cpu-cores=1 mem=228M
  "2":
    agent-state: down
    agent-state-info: (started)
    agent-version: 1.20.9
    dns-name: zabbix.local
    instance-id: manual:zabbix.local
    series: trusty
    hardware: arch=amd64 cpu-cores=1 mem=228M
  "5":
    agent-state: down
    agent-state-info: (started)
    agent-version: 1.20.9
    dns-name: b2b-server.local
    instance-id: manual:jenkins.local
    series: trusty
    hardware: arch=amd64 cpu-cores=2 mem=7784M
services:
  juju-gui:
    charm: cs:trusty/juju-gui-10
    exposed: false
    units:
      juju-gui/0:
        agent-state: down
        agent-state-info: (started)
        agent-version: 1.20.9
        machine: "0"
        open-ports:
        - 80/tcp
        - 443/tcp
        public-address: juju.local
  mysql:
    charm: cs:trusty/mysql-7
    exposed: false
    relations:
      cluster:
      - mysql
      db:
      - zabbix
    units:
      mysql/0:
        agent-state: down
        agent-state-info: (started)
        agent-version: 1.20.9
        machine: "1"
        public-address: mysql.local
  zabbix:
    charm: cs:~ayrton/trusty/zabbix-3
    exposed: false
    relations:
      db:
      - mysql
units:
  zabbix/0:
    agent-state: down
    agent-state-info: (started)
    agent-version: 1.20.9
    machine: "2"
    open-ports:
    - 80/tcp
    - 10051/tcp
    public-address: jenkins.local

有时我会移除一些机器并添加其他机器,机器的显示顺序为 0、1、2、5...

如何重新排列机器计数器?或者如何手动更改机器标识符?

答案1

您无法更改用于机器 ID 的序列号。它始终从 0 开始,并且永远不会返回,即使您移除一台机器并添加另一台机器也是如此。这是设计使然,并且是维护数据库内部引用完整性所必需的。

相关内容