I believe that most of your local development environments are on windows series systems. This article focuses on how to deploy multiple Memcached and Redis services on Windows to facilitate local application testing and access to Memcached and Redis.
Windows deploy multiple Memcached services
1. Preparation
The relevant installation has been uploaded, please refer to Baidu Netdisk Cache.rar for details. If it still doesn’t work, you can privately email my email and I will send it to you directly.
Link: http://pan.baidu.com/s/1pLSJ2Tt Password: k8gj
2. Create Service
Run CMD in administrator mode and execute the following command, where %MEMCACHED_PATH% is the disk path of memcached.exe. Two Memcached services are created as follows, memcached1 and memcached2, the open ports are 31113 and 31114 respectively
sc create memcached1 start= auto binPath= "\"%MEMCACHED_PATH%\memcached.exe\" -d runservice -m 512 -c 2048 -p 31113" DisplayName= "memcached1"
sc create memcached2 start= auto binPath= "\"%MEMCACHED_PATH%\memcached.exe\" -d runservice -m 512 -c 2048 -p 31114" DisplayName= "memcached2"
At this time, you can view it in the service panel (ctrl+r and enter services.msc). The following are the two memcached services I created. The service startup type can be adjusted by itself. Try the system access as soon as possible.
3. Delete Service
In addition to deleting services directly from the service panel, deleting services can also be executed by commands, as follows:
sc delete memcached1
sc delete memcached2
Windows deploy multiple Redis services
1. Preparation
The relevant installation has been uploaded, please refer to the
link of Baidu Netdisk Cache.rar for details : http://pan.baidu.com/s/1pLSJ2Tt Password: k8gj
2. Create Service
Run CMD in administrator mode, switch to the Redis directory prepared above, and execute the following command:
redis-server --service-install redis.windows.conf --loglevel verbose --service-name redis1 --port 10001
redis-server --service-install redis.windows.conf --loglevel verbose --service-name redis2 --port 10002
redis-server --service-install redis.windows.conf --loglevel verbose --service-name redis3 --port 10003
At this time, you can view it in the service panel. The following are the three Redis services I created. The service startup type can be adjusted by itself. Let's take a look.
3. Uninstall the service
Run CMD in administrator mode, switch to the Redis directory prepared above, and execute the following command:
redis-server --service-uninstall --service-name redis1 --port 10001
redis-server --service-uninstall --service-name redis2 --port 10002
redis-server --service-uninstall --service-name redis3 --port 10003