Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

redis

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.

like image 809
inOut Avatar asked Aug 02 '15 06:08

inOut


3 Answers

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.

like image 195
FeignMan Avatar answered Nov 13 '22 23:11

FeignMan


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

like image 24
liyuhui Avatar answered Nov 13 '22 22:11

liyuhui


Now service is normally.I run redis-cli.exe in the same window,and it connect correctly.Then I typed shutdown,the service is over.Reopen a command windows,type redis-server.The service run correctly.But I still did not understand why # Creating Server TCP listening socket *:6379:No such file or directory came out.

like image 27
inOut Avatar answered Nov 13 '22 22:11

inOut