> For the complete documentation index, see [llms.txt](https://wtifs.gitbook.io/diva-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wtifs.gitbook.io/diva-notes/redis/an-zhuang.md).

# 安装

### Installation

#### From source code

Download, extract and compile Redis with:

```
$ wget https://download.redis.io/releases/redis-6.2.6.tar.gz
$ tar xzf redis-6.2.6.tar.gz
$ cd redis-6.2.6
$ make
```

The binaries that are now compiled are available in the `src` directory. Run Redis with:

```
$ src/redis-server
```

You can interact with Redis using the built-in client:

```
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
```

## Cluster启动

```bash
# 1. 安装 Redis

# 2. 复制仓库
git clone git@github.com:redis/redis.git

# 3. 修改配置
cd redis/utils/create-cluster
vim create-cluster

# 修改 BIN_PATH 为 redis-server 所在目录
BIN_PATH="/usr/local/bin/"

# 启动 redis-server
create-cluster start
# 建立集群
create-cluster create
```

### Launch RedisBloom with Docker

<https://oss.redis.com/redisbloom/Quick\\_Start/#launch-redisbloom-with-docker>

```
docker run -p 6379:6379 --name redis-redisbloom redislabs/rebloom:latest
```

**参考**

> <https://redis.io/topics/cluster-tutorial>
