During maintenance of an API Connect cluster, you can shut down the Analytics subsystem
by disabling the client, ingestion, and storage microservices so that those processes are not
running and there is no way to reach them.
Before you begin
Disabling the Analytics subsystem stops the collection and storage of data as well as making the
subsystem unavailable. If you just want to pause data collection without disabling the entire
subsystem (for example, while renewing certificates), see Stopping Analytics data collection.
About this task
When you disable Analytics, there will be no data in either the API Manager Dashboards or
third-party offloads.
Procedure
-
Back up your Analytics data as explained in Backing up and restoring the analytics database.
-
Disable shard allocation for storage.
Disabling shard allocation is optional, but is recommended because it prevents new shards from
being created for replication when a node is unavailable, and helps avoid corruption issues in full
system restarts. Disable shard allocation for storage by running the following command:
kubectl -n namespace exec -it storage-master|shared_pod -- curl_es _cluster/settings -XPUT -d '{"persistent":{"cluster.routing.allocation.enable":"none"}}'
When you disable shard allocation, the response looks like the following
example:
{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"none"}}}},"transient":{}}
-
Unassociate the Analytics service from all gateway services.
-
In Cloud Manager, click
Topology.
-
In the section for the Availability Zone that contains the Analytics service, locate the
Gateway service that the Analytics service is associated with.
-
Click
and select Unassociate analytics service.
-
Unregister the Analytics service from Cloud Manager:
-
In Cloud Manager, click
Topology.
-
In the section for the Availability Zone that contains the Analytics service, locate the
Analytics service and click Delete.
-
Perform a synced flush of storage.
Flushing the storage is optional, but is recommended because it helps to avoid losing the data
that was not yet written to disk. This step flushes all current index operations synchronously and
attempts to write everything that is in flux to disk. Perform a synced flush of storage by running
the following command:
kubectl -n namespace exec -it storage-master|shared_pod -- curl_es _flush/synced -XPOST
When you flush storage, the response looks like the following
example:
{"_shards":{"total":33,"successful":13,"failed":0},".export-status":{"total":1,"successful":1,"failed":0},".apic-config":{"total":1,"successful":1,"failed":0},".kibana-6":{"total":1,"successful":1,"failed":0},"apic-api-2020.06.19-000002":{"total":15,"successful":5,"failed":0},"apic-api-2020.06.18-1":{"total":15,"successful":5,"failed":0}}
The operation often fails, and it is safe to rerun it multiple times until it passes and there
are all "failed" counts are zero. If it continues to fail after running multiple attempts over the
span of a couple minutes, you can proceed to the next step.
-
Edit the Analytics CR to disable ingestion, storage, and the client.
-
Run the following command to open the CR for editing:
kubectl edit a7s -n <namespace>
-
Add the
enabled: false
setting to the ingestion
,
storage
, and client
sections as in the following example:
spec:
client:
enabled: false
ingestion:
enabled: false
storage:
enabled: false
-
Save the change and exit the editor.