Device Cache Warmup

Overview

The Unified Assurance Device Cache Warmup microservice is part of the microservice event pipeline. It preloads devices from a set of zones into redis. It runs once as a sidecar when first installing redis, and subsequent runs are not required.

Prerequisites

  1. A microservices cluster must be setup. Refer to Microservice Cluster Setup.

  2. Redis must be installed. Refer to Redis microservice.

Setup

su - assure1
export NAMESPACE=a1-zone1-pri
export WEBFQDN=<Primary Presentation Web FQDN> 
a1helm install device-cache-warmup assure1/device-cache-warmup -n $NAMESPACE --set global.imageRegistry=$WEBFQDN

Default Configuration

Name Value Possible Values Notes
LOG_LEVEL INFO FATAL, ERROR, WARN, INFO, DEBUG Logging level used by application.
STREAM_INPUT mysql:///Devices Text, 255 characters MySQL connection URI.
STREAM_OUTPUT redis://redis-master.a1-zone1-pri.svc.cluster.local:6379 Text, 255 characters Redis server hostname and port.
CACHE_TTL "21600" Number The TTL in seconds set on each record in the cache.
BATCH_SIZE "20000" Number The amount of records to read at once during the warmup. Higher batch sizes will utilize more resources but lower the total processing time.
ZONES "1" Text, 255 characters A comma separated list of zones. All zones are preloaded if an empty string is set.

Configurations can be changed by passing the values to the a1helm install prefixed with the configData parent key.

Example of setting the log level to DEBUG

a1helm install ... --set configData.LOG_LEVEL=DEBUG

Example of loading all zones

a1helm install device-cache-warmup assure1/device-cache-warmup -n $NAMESPACE --set global.imageRegistry=$WEBFQDN --set-string configData.ZONES=""

Example of loading zone id 2

a1helm install device-cache-warmup assure1/device-cache-warmup -n $NAMESPACE --set global.imageRegistry=$WEBFQDN --set-string configData.ZONES="2"

Example of loading zone ids 1, 2, 3, 4

a1helm install device-cache-warmup assure1/device-cache-warmup -n $NAMESPACE --set global.imageRegistry=$WEBFQDN --set-string configData.ZONES="1\,2\,3\,4"