Shutting down the analytics subsystem

Disable the analytics service and shutdown the analytics subsystem.

About this task

This operation requires the use of the analytics CLI.

Disabling the analytics subsystem stops the collection and storage of data and makes the subsystem inaccessible.

Procedure

  1. Backup your analytics data as explained in Backup, restore, and disaster recovery.
  2. Setup the toolkit CLI so you can run analytics CLI operations: Analytics CLI.
  3. Optional: Disable shard allocation.

    Disable shard allocation to prevent new shards from being created for replication when a node is unavailable. For more information about shards, see OpenSearch nodes, indices, shards, and replicas.

    1. Create a JSON file called analytics_persistent_settings.json and insert the contents:
      {"persistent":{"cluster.routing.allocation.enable":"none"}}
    2. Run the following analytics CLI command:
      apic --mode analytics clustermgmt:putSettings --server <platform api endpoint> --analytics-service <analytics service name> --format json analytics_persistent_settings.json
      where:
      • <platform api endpoint> is the platform API endpoint.
      • <analytics service name> is the name of analytics service as configured in the Cloud Manager UI.
    Expected output:
    {"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"none"}}}},"transient":{}}
  4. Optional: Run a synced flush of storage.

    The synced flush operation flushes all current index operations synchronously and writes all in-flight transactions to disk.

    apic --mode analytics clustermgmt:postFlush --server <platform api endpoint> --analytics-service <analytics service name> --format json
    where:
    • <platform api endpoint> is the platform API endpoint.
    • <analytics service name> is the name of analytics service as configured in the Cloud Manager UI.
    When you flush storage, the response looks like the following example, with the failed count set to zero:
    {
        "_shards": {
            "total": 16,
            "successful": 6,
            "failed": 0
        }
    }

    This operation occasionally fails, but it is safe to rerun it multiple times until it passes and the failed count is zero.

  5. Unassociate the analytics service from all gateway services.
    1. In Cloud Manager, click Topology icon Topology.
    2. In the section for the Availability Zone that contains the analytics service, locate the Gateway service that the analytics service is associated with.
    3. Click Actions menu and select Unassociate.
  6. Unregister the analytics service from Cloud Manager:
    1. In Cloud Manager, click Topology icon Topology.
    2. In the section for the Availability Zone that contains the analytics service, locate the analytics service and click Delete.

    For more information, see Registering an analytics service.

  7. Kubernetes, OpenShift, and Cloud Pak for Integration only: Set replicas to zero for the analytics pods by editing the Deployments and StatefulSets that manage them: director, mtls-gw, ingestion, and storage:
    kubectl -n <namespace> edit deploy analytics-director
    kubectl -n <namespace> edit deploy analytics-mtls-gw
    kubectl -n <namespace> edit sts analytics-ingestion
    kubectl -n <namespace> edit sts analytics-storage
    
    Note: The Deployments and StatefulSets on Cloud Pak for Integration and OpenShift with the top-level CR have the name format <instance name>-a7s-...
    Set replicas to zero:
    spec:
      ...
      replicas: 0
      ...
    The analytics director, mtls-gw, ingestion, and storage pods all terminate.

Reenabling the analytics subsystem

  1. Kubernetes, OpenShift, and Cloud Pak for Integration only: Repeat step 7 but in reverse order and setting the replicas value back to what it was before.
    The pods all start:
    kubectl get deploy -n <namespace> 
    analytics-director                                  1/1     1            1           7h10m
    analytics-mtls-gw                                   1/1     1            1           7h6m
    
    kubectl get sts -n <namespace> 
    analytics-ingestion   1/1     7h10m
    analytics-storage     1/1     7h12m
  2. Reregister the analytics service: Registering an analytics service.
  3. Reassociate your analytics service with your gateways Associate new analytics service(s) with gateway(s).
  4. Enable shard allocation by following these steps:
    Note: If you did not disable shard allocation in step 3, skip this step.
    1. Create a JSON file called analytics_persistent_settings.json and insert the contents:
      {"persistent":{"cluster.routing.allocation.enable":"all"}}
    2. Run the following analytics CLI command:
      apic --mode analytics clustermgmt:putSettings --server <platform api endpoint> --analytics-service <analytics service name> --format json analytics_persistent_settings.json
      where:
      • <platform api endpoint> is the platform API endpoint.
      • <analytics service name> is the name of analytics service as configured in the Cloud Manager UI.
    When you enable shard allocation, the response looks like the following example:
    {"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"all"}}}},"transient":{}}