添加或移除 Qpid 节点

Edge for Private Cloud v4.18.05

本文档介绍如何在现有 Edge 安装中添加和移除 Qpid 服务器。

添加 Qpid 服务器

如需添加 Qpid 服务器,请执行以下操作:

  1. 在管理服务器上,确定分析群组和使用方群组的名称。

    以下许多命令都需要这些信息。默认情况下,分析群组的名称为 axgroup-001,使用方群组的名称为 consumer-group-001。在区域的静默配置文件中,您可以使用 AXGROUP 属性设置分析群组的名称。

    如果您不确定分析群组和使用方群组的名称,请使用以下命令显示它们:

    apigee-adminapi.sh analytics groups list --admin adminEmail --pwd adminPword --host localhost

    此命令会在 name 字段中返回分析群组名称,并在 consumer-groups 字段中返回使用方群组名称。

  2. 使用互联网或非互联网程序在节点上安装 Edge apigee-setup 实用程序,如安装 Edge apigee-setup 实用程序中所述。
  3. 使用 apigee-setup.sh 在节点上安装 Qpid:
    /opt/apigee/apigee-setup/bin/setup.sh -p qs -f configFile

    “-p qs”选项用于指定安装 Qpid。如需了解如何创建 configFile,请参阅在节点上安装 Edge 组件

    安装完成后,脚本会显示 Qpid 服务器的 UUID。如果您稍后需要确定 UUID,请在安装了 Qpid 的主机上使用以下 c网址 命令:

    curl http://qpid_IP:8083/v1/servers/self
  4. 将 Qpid 添加到分析组:
    curl -u adminEmail:pword -H "Content-Type: application/json"
      -X POST "http://ms_IP:8080/v1/analytics/groups/ax/AX_GROUP/servers?uuid=QPID_UUID&type=qpid-server"

    在输出中,您会看到 Qpid 节点的 UUID 已添加到 axgroup-001 下的 qpid-server 属性中:

    {
      "name" : "axgroup-001",
      "properties" : {},
      "scopes" : [ "VALIDATE~test", "sgilson~prod" ],
      "uuids" : {
        "qpid-server" : [
          "d6d0480f-8393-465d-a2a1-b4a16a033c55",
          "8398a95c-3640-4bd9-bf7e-1eb89155810a"
        ]
      }
    }
    

  5. 将 Qpid 添加到使用方群组:
    curl -u adminEmail:pword -H "Content-Type: application/json"
      -X POST "http://ms_IP:8080/v1/analytics/groups/ax/AX_GROUP/consumer-groups/CONSUMER_GROUP/consumers?uuid=QPID_UUID"

    在输出中,您会看到 Qpid 节点的 UUID 已添加到 consumer-group-001 下的 consumer-groups 属性中:

    "consumer-groups" : [ {
      "name" : "consumer-group-001",
      "consumers" : [
        "d6d0480f-8393-465d-a2a1-b4a16a033c55",
        "8398a95c-3640-4bd9-bf7e-1eb89155810a"
      ]
    } ]
  6. 重启所有节点上的所有 edge-qpid-server 组件,确保这些组件接受更改:
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server restart
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server wait_for_ready

安装完成。

移除 Qpid 服务器

如需移除 Qpid 节点,请执行以下操作:

  1. 在管理服务器上,确定分析群组和使用方群组的名称。以下许多命令都需要这些信息。

    默认情况下,分析群组的名称为 axgroup-001,使用方群组的名称为 consumer-group-001。在区域的静默配置文件中,您可以使用 AXGROUP 属性设置分析群组的名称。

    如果您不确定分析群组和使用方群组的名称,请使用以下命令显示它们:

    apigee-adminapi.sh analytics groups list --admin adminEmail --pwd adminPword --host localhost

    此命令会在名称字段中返回分析群组名称,并在使用方群组字段中返回使用方群组名称。

  2. 从使用方群组中移除 Qpid:
    curl -u adminEmail:pword -H "Content-Type: application/json"
      -X DELETE "http://ms_IP:8080/v1/analytics/groups/ax/AX_GROUP/consumer-groups/CONSUMER_GROUP/consumers/QPID_UUID"
  3. 从分析组中移除 Qpid:
    curl -v -u adminEmail:pword
      -X DELETE "http://ms_IP:8080/v1/analytics/groups/ax/AX_GROUP/servers?uuid=QPID_UUID&type=qpid-server"
  4. 在边缘安装中取消注册 Qpid 服务器:
    curl -u adminEmail:pword
      -X POST http://ms_IP:8080/v1/servers -d "type=qpid-server&region=dc-1&pod=central&uuid=QPID_UUID&action=remove"
  5. 从边缘安装中移除 Qpid 服务器:
    curl -u adminEmail:pword -X DELETE http://ms_IP:8080/v1/servers/QPID_UUID
  6. 重启所有节点上的所有 edge-qpid-server 组件,确保这些组件接受更改:
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server restart
    /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server wait_for_ready
  7. 按照卸载 Edge 中的说明卸载 Qpid。