When installing Redis under windows, an error is reported at the first startup:
[2368] 21 Apr 02:57:05.611 # Creating Server TCP listening socket 127.0.0.1:6379: bind: No error
Solution: Run in the command line
redis-cli.exe
127.0.0.1:6379>shutdown
not connected>exit
Then re-run redis-server.exe redis.windows.conf, the startup is successful!
Start Redis
Open the command window directly in the directory above, and run:
- redis – server redis . windows . conf
The results on the tragedy, QForkMasterInit: system error caught. error code=0x000005af, message=VirtualAllocEx failed.: unknown error
tips: . The reason is the memory allocation problem (if your computer is powerful enough, it may not be a problem). There are two solutions. First: Use --maxmemory
commands to limit Redis memory at startup :
- redis – server redis . windows . conf – maxmemory 200m
The second method is to modify the configuration file redis.windows.conf
:
- maxmemory 209715200
Note that the unit is byte, after the change is as follows:
Then run redis-server redis.windows.conf
it to start:
But here comes the problem again. Redis will be closed when the cmd window is closed. Is it necessary to keep the server open? This is obviously unscientific, let’s see how to deploy on the server.
Deploy Redis
In fact, Redis can be installed as a windows service. It starts automatically after booting. The command is as follows:
- redis – server – service – install redis . windows . conf
After the installation is complete, you can see that Redis has been used as a windows service:
But after the installation, Redis did not start, the startup command is as follows:
- redis – server – service – start
Stop command:
- redis – server – service – stop