You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows10下Redis服务无法启动求助(依赖Django Channels_redis)

Fixing Redis Startup Issues on Windows for Django Channels

Hey there! Let’s work through this Redis problem together—since you need it for Django Channels, we’ll get it up and running in no time. Let’s break down what’s causing each error and how to fix them.

First, Understand the Errors

Let’s start with the two issues you’re seeing:

  1. When running redis-server redis.windows.conf, you get Creating Server TCP listening socket 127.0.0.1:6379: bind: No error — this usually means the bind operation itself didn’t fail, but something else is stopping Redis from fully starting (most often a port conflict or missing directory).
  2. When running just redis-server, you get bind: No such file or directory — this is a common Windows Redis issue related to missing directories for persistent storage.

Step-by-Step Fixes

1. Make Sure You’re in the Right Directory

Redis needs to be run from its installation/unzip folder. Open Command Prompt (CMD) and navigate to your Redis directory first:

cd C:\path\to\your\redis\folder

(Replace the path with where you installed/unzipped Redis, like C:\Redis.)

2. Fix the "No such file or directory" Error

This happens because Redis can’t create its persistence file (dump.rdb) in the default directory. Here’s how to fix it:

  • Create a new folder named data inside your Redis directory.
  • Open the redis.windows.conf file in a text editor, find the dir line (it looks like dir .), and change it to point to your new data folder:
    dir C:\path\to\your\redis\folder\data
    
  • Save the config file and close it.

3. Check if Port 6379 is Occupied

The "No error" message might hide a port conflict—another program could be using port 6379. To check:
Run this command in CMD:

netstat -ano | findstr :6379
  • If you see output, note the PID number at the end of the line.
  • Open Task Manager, go to the Details tab, find the process with that PID, right-click it, and select End Task.

4. Start Redis Correctly

Now go back to your Redis directory in CMD and run:

redis-server redis.windows.conf

If everything works, you’ll see a message like * Ready to accept connections — that means Redis is running!

5. Verify the Connection

To make sure Redis is working properly, open a new CMD window, navigate to your Redis directory, and run:

redis-cli

Then type ping and press Enter. If you get PONG in response, you’re good to go—Django Channels can now connect to Redis.

Extra Tip

If you still run into issues, try running CMD as Administrator. Sometimes Windows permissions prevent Redis from creating files or binding to ports properly.

内容的提问来源于stack exchange,提问作者Bryar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 18:57:58