正在卸载 Edge

您可以卸载单个组件、所有组件,也可以从系统中完全移除 Edge。此外,如果您已升级,则可以回滚 Edge

卸载个别组件

如需卸载组件,请使用以下形式的 apigee-service 实用程序:

/opt/apigee/apigee-service/bin/apigee-service component_name uninstall

其中,component_name 用于标识您要卸载的组件。component_name 的可能值包括:

  • apigee-cassandra(卡桑德拉)
  • apigee-openldap(打开 LDAP)
  • apigee-postgresql(PostgreSQL 数据库)
  • apigee-qpidd(Qpidd)
  • apigee-sso(边缘单点登录)
  • apigee-zookeeper (ZooKeeper)
  • edge-management-server(管理服务器)
  • edge-management-ui(新版 Edge 界面)
  • edge-message-processor(消息处理器)
  • edge-postgres-server(Postgres 服务器)
  • edge-qpid-server (Qpid Server)
  • edge-router(边缘路由器)
  • edge-ui(传统版界面)

除了这些组件之外,您还可以卸载 apigee-provisionapigee-validate 组件。

例如,如需卸载 Edge 界面,请使用以下命令:

/opt/apigee/apigee-service/bin/apigee-service edge-ui uninstall

此命令不会删除任何数据或日志文件。而只是删除组件。

卸载创收功能

在卸载 Monetization 之前,我们建议您备份 Postgres 中的数据。

如需卸载创收功能,包括所有创收数据,请按以下步骤操作:

  1. 检查贵组织是否已启用创收功能:
    curl -u sysAdminEmail:adminPasswd -X GET http://management_server_IP:8080/v1/organizations/ORG

    其中,ORG 是您的组织名称。以下是示例响应:

    {
      "createdBy" : "admin@apigee.com",
      "displayName" : "edge",
      "environments" : [ "prod", "test" ],
      "lastModifiedBy" : "admin@apigee.com",
      "name" : "edge-platform",
      "properties" : {
        "property" : [ {
          "name" : "features.isMonetizationEnabled",
          "value" : "true"
        } ]
      },
      "type" : "paid"
    }
  2. 使用以下属性为组织停用创收功能并启用删除功能:
    <Property name="features.isMintOrgDataDeletionAllowed">true</Property>:
    <Property name="features.isMonetizationEnabled">false</Property>

    以下是一个更新请求示例:

    curl -H "Content-Type:application/xml" -u sysAdminEmail:adminPasswd \
    -X POST http://management_server_IP:8080/v1/organizations \
    --header 'Content-Type: application/xml' \
    
    --data '<Organization type="paid" name="edge-platform">
       <DisplayName>edge-platform</DisplayName>
       <Properties>
           <Property name="features.isMintOrgDataDeletionAllowed">true</Property>
           <Property name="features.isMonetizationEnabled">false</Property>
            # List all other properties that are present in the organization.
       </Properties>
    </Organization>'
  3. 如需删除组织的创收数据,请使用如下命令:
    curl -H "Content-Type:application/json" \
        -u sysAdminEmail:adminPasswd -X POST \
        http://management_server_IP:8080/v1/organizations/org_name/delete-org-data

    以下是示例响应:

    {
      "id" : "ccfb2d26-a2a2-4ebc-aef7-5f7083c6fd84",
      "log" : "",
      "orgId" : "edge-platform",
      "status" : "RUNNING",
      "type" : "DELETE_ORG"
    }

    该命令会启动一个异步任务来删除创收组织数据。 如需检查此任务的状态,请使用如下命令:

    curl -H "Content-Type:application/json" \
      -u sysAdminEmail:adminPasswd -X GET \
      http://management_server_IP:8080/v1/mint/asyncjobs/JOBID

    其中,JOBID 是任务的 ID。以下是示例响应:

    {
      "id" : "ccfb2d26-a2a2-4ebc-aef7-5f7083c6fd84",
      "log" : "",
      "orgId" : "edge-platform",
      "status" : "COMPLETED",
      "type" : "DELETE_ORG"
    }
  4. 使用如下所示的命令查找为创收功能创建的 Google Analytics(分析)群组:
    curl -H "Content-Type:application/json" \
        -u sysAdminEmail:adminPasswd -X GET \
        http://management_server_IP:8080/v1/analytics/groups/ax/
  5. 从 Google Analytics(分析)群组中移除组织和环境范围:
    curl -H "Content-Type:application/json" \
        -u sysAdminEmail:adminPasswd -X DELETE \
        http://management_server_IP:8080/v1/analytics/groups/ax/GROUP/scopes?org=ORG<\var>&env=ENV

    哪里

    • GROUP 是 Google Analytics(分析)组。
    • ORG 是组织。
    • ENV 是环境。
  6. 从 Analtyics(分析)群组中移除 Qpid、Postgres 和使用方服务器:
    curl -H "Content-Type:application/json" "http://localhost:8080/v1/analytics/groups/ax/mxgroup001/servers/?uuid=UUID&type=TYPEOFSERVER" -X DELETE -u$SUP

    哪里

    • UUID 是通用唯一标识符。
    • TYPEOFSERVER 是服务器类型。
  7. 删除 MX 群组(用于 Apache Qpid 和评分服务器的群组):
    curl -H "Content-Type:application/json" \
        -u sysAdminEmail:adminPasswd -X DELETE \
        http://management_server_IP:8080/v1/analytics/groups/ax/group
  8. 移除创收组件(管理组件和消息处理器):
    apigee-service edge-mint-gateway uninstall

卸载创收功能后,重启管理和消息处理器:

apigee-service edge-management-server restart
apigee-service edge-message-processor restart

卸载所有组件

如需卸载节点上的所有 Apigee 组件,请卸载 apigee-service 实用程序:

/opt/apigee/apigee-service/bin/apigee-service apigee-service uninstall

此命令不会删除任何数据或日志文件。而只是删除组件。

移除边缘

如需从您的系统中完全移除 Edge,请执行以下操作:

  1. 停止机器上运行的所有 Edge 服务:
    /opt/apigee/apigee-service/bin/apigee-all stop
  2. 清除 yum 缓存:
    sudo yum clean all
  3. 移除所有 Apigee RPM:
    sudo rpm -e $(rpm -qa | egrep "(apigee-|edge-)")
  4. 移除安装根目录:
    sudo rm -rf /opt/apigee
  5. 移除 Nginx 目录:
    sudo rm -rf /opt/nginx