Disabling and re-enabling the Analytics subsystem on VMware
Disable the Analytics subsystem by shutting down the VM that hosts it.
Before you begin
About this task
Disabling the Analytics subsystem stops the collection and storage of data as well as making the subsystem unavailable.
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 on VMware.
-
Disable shard allocation for storage by following these steps:
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.
- Create a json file called
analytics_persistent_settings.json
and insert the contents:{"persistent":{"cluster.routing.allocation.enable":"none"}}
- Run the following Analytics CLI
command:
apic --mode analytics clustermgmt:putSettings --server <management server platform api endpoint> --analytics-service <analytics service name> --format json analytics_persistent_settings.json
where:<management server platform api endpoint>
is the Management server platform api endpoint.<analytics service name>
is the name of Analytics service as configured in the Cloud Manager.
The output from this command should be:{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"none"}}}},"transient":{}}
- Create a json file called
-
Perform a synced flush of storage by running the following command:
Flushing the storage is optional, but is recommended because it helps to avoid losing the data that was not yet written to disk before you restart pods. This step flushes all current index operations synchronously and attempts to write everything that is in flux to disk.
apic --mode analytics clustermgmt:postFlush --server <management server platform api endpoint> --analytics-service <analytics service name> --format json
where:<management server platform api endpoint>
is the Management server platform endpoint.<analytics service name>
is the name of Analytics service as configured in the Cloud Manager.
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.
-
Shut down the Analytics VMs.
You can shut down the VMs using one of the following methods:
- Use the VMware console
ssh
into the images and run theshutdown
command
Re-enabling analytics
- Start your analytics VMs.
-
Enable shard allocation by following these steps:
Note: If you did not disable shard allocation, skip this step.
- Create a json file called
analytics_persistent_settings.json
and insert the contents:{"persistent":{"cluster.routing.allocation.enable":"all"}}
- Run the following Analytics CLI command:
apic --mode analytics clustermgmt:putSettings --server <management server platform api endpoint> --analytics-service <analytics service name> --format json analytics_persistent_settings.json
where:<management server platform api endpoint>
is the Management server platform api endpoint.<analytics service name>
is the name of Analytics service as configured in the Cloud Manager.
When you enable shard allocation, the response looks like the following example:{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"all"}}}},"transient":{}}
- Create a json file called