Current Redis version: 3.2.100
Typically we can start the Redis service with Redis-server.exe and configuration files:
Redis-server.exe redis.windows.conf
Also open a command-line window Redis-cli.exe can do some simple operation command line
But if we close the console, then the Redis service is closed together, and it is inefficient and cumbersome to use the command to restart the Redis service.
There is a concept of local service in Windows, and our goal is to register Redis as a service in this, and then we can not be affected by the exit of the console.
Registering as a local service
Redis-server.exe--service-install redis.windows.conf
Seeing that it was successfully authorized and registered successfully, let's go to the Windows service (right-click on the Windows menu-Computer Management-services and applications-services) to see if there is a Redis service:
We were able to find that there was already a lot of service in the computer, and that Redis was in it, which means we were really successful in registering.
At this point we are not allowed to connect with the client because it is not started yet.
Turn on Redis Services
Method One: Select the Redis Item right click-"Start
Method Two:redis-server--service-start
When successful, you can see that the Redis item status becomes running , such as:
Here we can successfully connect to the Redis service with REDIS-CLI.
Order Normalization
Registration Service redis-server--service-install redis.windows.conf
Delete Service redis-server--service-uninstall
Open service redis-server--service-start
Stop service redis-server--service-stop
Create more than one Redis instance
Step1: Copy a redis.windows.conf configuration file and rename it to redis.windows10001.conf
Step2: Change the information for the redis.windows10001.conf configuration file
Port number port is 10001
Others do not give instructions first
Step3: Registering as a Windows service
Redis-server.exe--service-install redis.windows10001.conf--service-name redis10001--port 10001
As you can see from the Windows service, there are two redis services that were just registered with REDIS10001 and the service is not yet open as shown in:
Registering Redis as a local service under Windows