Install Redis service on Windows

Deploying on Windows Using RedisPosted in Backend By KeenWon On July 3, 2014 Views: 24,218

Download Redis
There are various versions on the Redis official website download page, I deployed on Windows this time, go to Download on GitHub. The current version is version 2.8.12. Unzip it directly. There is a compressed package in the \bin\release directory. This is what we need:



start Redis
and open the command window directly in the directory above, and run:

redis-server redis.windows The .conf


result is tragic, prompting: QForkMasterInit: system error caught. error code=0x000005af, message=VirtualAllocEx failed.: unknown error . The reason is a memory allocation problem (if your computer is powerful enough, it may not be a problem). There are two solutions. The first is to use the --maxmemory command to limit the memory of Redis 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 bytes, after the change is as follows:



then run redis-server redis.windows.conf to start it:



but the problem comes again, closing the cmd window will close Redis, should the server be always open? This is obviously unscientific. Let's see how to deploy it 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 installation, you can see that Redis has been used as a windows service





. Redis does not start, the start command is as follows:

redis-server --service-start
stop command:

redis-server --service-stop
can also install multiple instances

redis-server --service-install --service-name redisService1 --port 10001
redis-server --service-start --service-name redisService1
redis-server --service-install --service-name redisService2 --port 10002
redis-server --service-start --service-name redisService2
redis-server --service-install --service-name redisService3 --port 10003
redis-server --service-start --service-name redisService3
uninstall command:

Redis-server --service-uninstall
Last reminder: Version 2.8 does not support 32-bit systems, and 32-bit systems need to download version 2.6. Version 2.6 cannot be deployed as easily as above. It provides a program called RedisWatcher to run the redis server. Redis will restart automatically after it stops.




Unzip the package, client download address: link: http://pan.baidu.com/s/1mii8uqW password: sjjs

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326381879&siteId=291194637