kstyrc / embedded-redis

Redis embedded server for Java integration testing
832 stars 366 forks source link

Error on Windows because of "bind 127.0.0.1" #119

Open alesnov-clgx opened 3 years ago

alesnov-clgx commented 3 years ago

The minimal configuration like RedisServer redisServer = new RedisServer(6379); redisServer.start();

results in an error Can't start redis server. Check logs for details. When I debug AbstractRedisInstance.awaitRedisServerReady(), I see the following error is logged: [22264] 27 Aug 19:10:56.673 # Creating Server TCP listening socket 127.0.0.1:6379: bind: No such file or directory

If I just try to run redis-server-2.8.19.exe from the command line, with the config file that contains only "bind 127.0.0.1", it produces exactly the same error. Without this config file, redis-server-2.8.19.exe starts. But it seems impossible to build without this config line, because that's the first thing the build() method does, unconditionally.

StefanXiepj commented 11 months ago

This issue because another server already started, you can check it in window os using this command :

$ netstat -ano | grep 6379
  TCP    0.0.0.0:6379           0.0.0.0:0              LISTENING       22508
  TCP    [::]:6379              [::]:0                 LISTENING       22508

and then kill it:

$ taskkill -F -PID "22508"
成功: 已终止 PID 为 22508 的进程。

In mac OS, you can do it like :

ps -ef | grep 6379

and then kill it:

kill -9 <pid>