wsl2 redis
时间: 2023-08-31 17:12:15 浏览: 168
在WSL2上安装Redis的步骤如下:
1. 首先,你需要在WSL2中安装一个Linux发行版,比如CentOS8。这个发行版已经预安装了Redis,你可以通过以下命令查看安装路径和配置文件路径:
- Redis安装路径:/usr/local/redis
- Redis配置文件路径:/etc/redis.conf
引用
2. 确保你已经创建好了docker-compose.yml文件,其中包含了Redis的配置。以下是一个示例的docker-compose.yml文件:
```
version: '3.1'
services:
master:
image: redis
container_name: redis-master
ports:
- 7001:7001
volumes:
- ./redis7001:/usr/local/etc/redis
command: redis-server /usr/local/etc/redis/redis.conf
slave1:
image: redis
container_name: redis-slave1
ports:
- 7002:
#### 引用[.reference_title]
- *1* [WSL2+docker+redis 集群部署(1主2从)](https://blog.csdn.net/qq_41129489/article/details/124692931)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [CentOS8镜像(数据库):mysql5.7.38 redis-7.0.0 mongodb5.0.8](https://download.csdn.net/download/qq_38442140/85475466)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [WSL2+docker+redis 数据卷挂载部署](https://blog.csdn.net/qq_41129489/article/details/124684443)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文