114 lines
2.2 KiB
Markdown
114 lines
2.2 KiB
Markdown
# Redis Setup for Windows
|
|
|
|
## Method 1: Using Memurai (Redis-compatible for Windows)
|
|
|
|
Memurai is a Redis-compatible server for Windows.
|
|
|
|
1. **Download Memurai**:
|
|
- Visit: https://www.memurai.com/get-memurai
|
|
- Download the installer
|
|
|
|
2. **Install**:
|
|
- Run the installer
|
|
- Choose default options
|
|
- It will automatically start as a Windows service
|
|
|
|
3. **Verify**:
|
|
```powershell
|
|
# Check if service is running
|
|
Get-Service Memurai
|
|
|
|
# Or connect with redis-cli
|
|
memurai-cli ping
|
|
# Should return: PONG
|
|
```
|
|
|
|
4. **Configure** (if needed):
|
|
- Default port: 6379
|
|
- Service runs automatically on startup
|
|
|
|
## Method 2: Using Docker Desktop
|
|
|
|
1. **Install Docker Desktop**:
|
|
- Download from: https://www.docker.com/products/docker-desktop
|
|
|
|
2. **Start Redis Container**:
|
|
```powershell
|
|
docker run -d --name redis -p 6379:6379 redis:7-alpine
|
|
```
|
|
|
|
3. **Verify**:
|
|
```powershell
|
|
docker ps | Select-String redis
|
|
```
|
|
|
|
## Method 3: Using WSL2 (Windows Subsystem for Linux)
|
|
|
|
1. **Enable WSL2**:
|
|
```powershell
|
|
wsl --install
|
|
```
|
|
|
|
2. **Install Redis in WSL**:
|
|
```bash
|
|
sudo apt update
|
|
sudo apt install redis-server
|
|
sudo service redis-server start
|
|
```
|
|
|
|
3. **Verify**:
|
|
```bash
|
|
redis-cli ping
|
|
# Should return: PONG
|
|
```
|
|
|
|
## Quick Test
|
|
|
|
After starting Redis, test the connection:
|
|
|
|
```powershell
|
|
# If you have redis-cli or memurai-cli
|
|
redis-cli ping
|
|
|
|
# Or use telnet
|
|
Test-NetConnection -ComputerName localhost -Port 6379
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Port Already in Use
|
|
```powershell
|
|
# Check what's using port 6379
|
|
netstat -ano | findstr :6379
|
|
|
|
# Kill the process if needed
|
|
taskkill /PID <PID> /F
|
|
```
|
|
|
|
### Service Not Starting
|
|
```powershell
|
|
# For Memurai
|
|
net start Memurai
|
|
|
|
# Check logs
|
|
Get-EventLog -LogName Application -Source Memurai -Newest 10
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Default Redis/Memurai configuration works out of the box. No changes needed for development.
|
|
|
|
**Connection String**: `redis://localhost:6379`
|
|
|
|
## Production Considerations
|
|
|
|
- Use Redis authentication in production
|
|
- Configure persistence (RDB/AOF)
|
|
- Set up monitoring and alerts
|
|
- Consider Redis Cluster for high availability
|
|
|
|
---
|
|
|
|
**Recommended for Windows Development**: Memurai (easiest) or Docker Desktop
|
|
|