---
title: 配置Redis
description: "为单实例Redis部署配置Redis，需要修改Redis配置文件中的一些关键设置以及调整Redis的行为。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdbs/ecosystemEnable/Redis/kunpengredis_04_0006.html
sourcePath: /source/zh/kunpengdbs/ecosystemEnable/Redis/kunpengredis_04_0006.html
indexId: 66012e3ff950c952cb72d788080fc033275d166ee6f95520fc0337d7f69bc9f869
---
# 配置Redis

为单实例Redis部署配置Redis，需要修改Redis配置文件中的一些关键设置以及调整Redis的行为。

1. 创建Redis运行目录。这里创建的目录是“/home/redis/standalone”。

```
mkdir -p /home/redis/standalone
```


2. 复制默认配置文件。本例中默认配置文件路径为“/home/redis-6.0.20/redis.conf”。

```
cd /home/redis/standalone
cp /home/redis-6.0.20/redis.conf ./
```


3. 修改配置文件。

  a. 切换到Redis运行目录。

```
cd /home/redis/standalone
```


  b. 使用sed命令修改配置文件中的几个关键设置，包括允许Redis监听所有网络接口上的连接、禁用保护模式以提高可访问性（但需注意安全风险），以及忽略ARM64架构上可能遇到的特定错误警告。

```
sed -i "s/bind 127.0.0.1/#bind 127.0.0.1/g" redis.conf
sed -i "s/protected-mode yes/protected-mode no/g" redis.conf
sed -i "s/# ignore-warnings ARM64-COW-BUG/ignore-warnings ARM64-COW-BUG/g" redis.conf
```
