Cache Manager
Description
Opsview Cache manager is a fast, distributed in-memory key-value store, which can be used to cache session and other disposable data with a short shelf life. As the storage is only in memory, restarting the Cache Manager will potentially lose previously stored cache data and the components making use of this will then need to re-populate that data.
The Cache Manager has an API available to client components with both HTTP and HTTPS endpoints. It also uses this API to communicate with other peers within the cluster to implement the distributed cache.
Package Dependencies
- opsview-python.
Service Dependencies
- opsview-registry
Installation
The component is deployed on Collectors by Opsview Deploy. The specific playbook is cache-manager-install.yaml
.
Configuration
Specific configuration options should be set in /opt/opsview/cachemanager/etc/cachemanager.yaml
. Opsview Deploy will automatically configure Cache Manager peers within the cluster.
The following settings can be managed, but it is strongly recommended that they managed via Opsview-Deploy to ensure that they are synchronized within each cluster, otherwise the Cache Manager may not function correctly.
Setting | Description |
---|---|
worker_timeout | The time a worker remains dormant after an error before re-starting (default 30s). |
max_cache_size | The maximum size of the local cache (default = 1GB, 0B = no limit). |
max_item_size | The maximum size of an individual cache entry (default 10MB, 0B = no limit). |
peer_refresh_time | The time delay before peers marked as "down" will be rechecked. |
peer_connection_timeout | The timeout value when attempting communication with a peer. |
timestamp_error_margin | The max time difference allowable when validating an encrypted namespace. |
cache_purge_time | The time delay before expired items are actively purged from the cache. |
http_server | The settings for the HTTP endpoint (including namespace encryption). |
https_server | The settings for the HTTPS endpoint (including namespace encryption). The encryption must match that specified in the http_server. The client certificate, ca certificate and server certificate should also be specified here. (Generally automatically setup by Opsview Deploy) |
registry | The connection to Opsview Registry. (Generally automatically setup by Opsview Deploy) |
peer_nodes | The other Cache Manager nodes in the cluster. (Generally automatically setup by Opsview Deploy) |
Management
Start/Stop cachemanager
# Once configured on the machine you need to run the following command to get it working
sudo /opt/opsview/watchdog/bin/opsview-monit reload
sudo /opt/opsview/watchdog/bin/opsview-monit start opsview-cachemanager
# To stop the cachemanager
sudo /opt/opsview/watchdog/bin/opsview-monit stop opsview-cachemanager
Validate cache manager status
Get status of cache manager
curl http://127.0.0.1:8182/status -s | python -m json.tool
{
"available_peer_refs": [
"1d20de92-12bd-4067-8563-8d63e83429cc"
],
"cache_items": 0,
"peers": [
{
"deactivated": 0,
"ref": "1d20de92-12bd-4067-8563-8d63e83429cc"
}
],
"ref": "1d20de92-12bd-4067-8563-8d63e83429cc",
"uptime": 4581
}
Logging
Logs to syslog as per all other components
Example logging:
Oct 14 11:13:11 cdb-cachemanager journal: opsview : [NOTICE] Launching Opsview Cache-Manager daemon.
Oct 14 11:13:11 cdb-cachemanager journal: opsview.cachemanager.cachemanagerworker : [NOTICE] Worker started (PID=15807).
Updated almost 4 years ago