Can't bind TCP listener *:6379 using Redis on

2020-05-14 01:54发布

I'm using Redis 2.8 on Windows which I downloaded from github release. After unzip and I've set maxheap in redis.windows.conf file. After running redis-server redis.windows.conf I get # Creating Server TCP listening socket *:6379:No such file or directory, but redis is not running correctly. I don't know why.

标签: redis
9条回答
▲ chillily
2楼-- · 2020-05-14 02:09

I just got the same error message, but the root cause was different: I copied the config file over from a different machine, but it contained a "bind" entry containing an IP address, which - for sure - was invalid for the new machine, i.e. bind 234.234.234.234

I changed it to the correct address and it was working as expected.

查看更多
劳资没心,怎么记你
3楼-- · 2020-05-14 02:10

After getting this error,open the cli and press the command 'shutdown' and restart redis server. You are good to go. You will get the logo and everything is as expected.

查看更多
手持菜刀,她持情操
4楼-- · 2020-05-14 02:12

cdto the bin directory of Redis, and run

  1. redis-cli.exe
  2. shutdown
  3. exit

open another cmd window, cd to the bin directory of Redis, and run

4.redis-server.exe

查看更多
Juvenile、少年°
5楼-- · 2020-05-14 02:14

Got the same behavior after restart. Initially thought Redis is not running, but your question made me to dig some more. Apparently, there's Windows service, called "Redis" and it started after computer reboot.

查看更多
在下西门庆
6楼-- · 2020-05-14 02:20

You must've used the .msi installer. It automagically registers a windows service which starts instantly after the installation (at least on my win 10 machine).

This service uses the default config and binds to port 6379. When you start redis-server from the command line, if you haven't specified a different port through a config file, it picks up the default config again and tries to bind to port 6379 which fails.

Your cli works because it connects to the redis service that's already listening on 6379. Your shutdown command stops the service and from there things work as expected. Mystery solved. Case closed.

查看更多
我想做一个坏孩纸
7楼-- · 2020-05-14 02:23

As @FeigMan said you must've used the .msi installer. It automagically registers a windows service which starts instantly after the installation.

I was getting below error:

[15052] 10 Apr 14:40:14.601 # Creating Server TCP listening socket *:6379: listen: Unknown error

If service is already running you will get above error.
As per need you can restart service by below commands:

redis-server --service-stop
redis-server --service-start

查看更多
登录 后发表回答