Error report and solution when connecting to Redis
-
Problem description: Could not connect to Redis at 127.0.0.1:6379: Unable to connect because the target computer actively refused.
-
Cause of the problem: redis startup method is incorrect
-
solution:
-
Open the command line window in the redis root directory and enter the command redis-server.exe redis.windows.conf. Do not close this window.
-
Reopen the cmd window and enter redis-cli to execute.
-
-
Three ways to start redis
- The default port 6379 starts: redis-server
- Start on the specified port: redis-server --port 8888
- Configuration file startup:
- The configuration file in redis is redis.conf
- Command to start the configuration file:./src/redis-server redis-01.conf
-
Command to keep the redis service open: redis-server --service-install redis.windows-service.conf --loglevel verbose