# Playbook: REDIS

> Historical documentation restored from the Pigsty v1.5.1 tag.
---

> REDIS series [Playbook](/docs/p-playbook/): Define and pull Redis databases in traditional standalone, native, and sentinel clusters.

| Playbook | Function                                                 | Link                                                     |
|--------|--------------------------------------------------------------| ------------------------------------------------------------ |
|  [`redis`](/docs/p-redis/#redis)                        | Deploying a Redis database in Native/Standalone/Sentinel cluster |        [`src`](https://github.com/pgsty/pigsty/blob/v1.5.1/redis.yml)            |
|  [`redis-remove`](/docs/p-redis/#redis-remove)          |        Redis cluster/node destruction        |        [`src`](https://github.com/pgsty/pigsty/blob/v1.5.1/redis-remove.yml)     |


------------------

## `redis`

Deploy redis instances on nodes.

```bash
# init all redis instances on group <cluster>
 ./redis.yml -l <cluster>       # create redis among group <cluster>

# init all redis instances specific node
 ./redis.yml -l 10.10.10.10     # setup all redis instances on node 10.10.10.10

# init one specific instance 10.10.10.11:6501 (skip redis node)
 ./redis.yml -l 10.10.10.11 -e redis_port=6501 -t redis
```

Alias script `bin/createredis` wrap above playbook with:

```bash
bin/createredis redis-common            # init redis cluster redis-common
bin/createredis 10.10.10.10             # init redis node 10.10.10.10
bin/createredis 10.10.10.13 6501 6502   # init redis instance 10.10.10:13:6501 10.10.10:13:6502
```

![](/img/history/v1.5/playbook/redis.svg)

------------------

## `redis-remove`

Remove redis instances from nodes.

```bash
# Remove cluster `redis-test`
redis-remove.yml -l redis-test

# Remove all instance on redis node 10.10.10.13
redis-remove.yml -l 10.10.10.13

# Remove one specific instance 10.10.10.13:6501
redis-remove.yml -l 10.10.10.13 -e redis_port=6501
```

![](/img/history/v1.5/playbook/redis-remove.svg)
