Redis Deploy
Pigsty is a PostgreSQL distribution and a general-purpose application runtime. It can manage, deploy, and monitor other applications and databases, such as Redis.
Similar to PostgreSQL, deploying Redis requires the same two steps.
- Declare/Define the Redis cluster
- Execute Playbook to create the Redis cluster
The Redis entity concept model is almost identical to PostgreSQL and includes the Cluster and Instance. Note that Cluster here does not refer to the clusters in Redis’ native clusters.
The core difference is that Redis typically uses multiple singleton instances, with various Redis instances typically deployed on a single physical/VM to take advantage of multi-core CPUs.
In Pigsty-managed Redis, it is not yet possible to deploy two Redis instances from different clusters on a node, but this does not affect the deployment of multiple independent Redis instances on a node.
Identity Parameters
The identity parameters are the information that must be provided when defining a Redis cluster and include.
: A JSON object with the Key as the instance port and the Value as a JSON object containing the instance-specific configuration.
A condensed definition of three Redis clusters is given below, including.
- A 1-node, 3-instance Redis Sentinel cluster .
- A 2-node, 12-instance Redis Cluster
redis-cluster
. - A 1-node, one primary & two replicas Redis Standalone cluster
redis-standalone
.
It would help to assign a unique port to the Redis instance on the node.
Redis Sentinel Cluster Example
Redis Standalone Example
Create a Redis instance/cluster using the playbook redis.yml
.
Caveat
Although not recommended, it is still possible to deploy a mix of PostgreSQL and Redis to make the most of machine resources.
If the machine’s node_exporter
exists during this process, it will be redeployed.
By default, Prometheus will use the “multi-target crawl” mode, using the Redis Exporter on port 9121 on the node to crawl all Redis instances on that node.
Pigsty currently provides three Redis monitor dashboards as part of a standalone monitoring application .
- Redis Overview: Provide a global overview of Redis in the entire environment.
- Redis Cluster: Focus on monitoring information for a single Redis business cluster.
- Redis Instance: Focus on detailed monitoring information for a single Redis instance.
You can use the included Redis-benchmark test.
Pigsty v1.4 only provides Redis cluster deployment and monitoring capabilities globally. In subsequent versions, such as capacity expansion, capacity reduction, and singleton instance management will be provided.