Window install redis service, uninstall redis service and start redis service Redis installation and use under win7x64

Redis installation and use under win7x64

 

Let’s quote a passage from Baidu Encyclopedia first, you can check it in Encyclopedia for details.

Redis is an open source log-type, key-value database written in ANSI C language, supports network, can be memory-based and persistent, and provides APIs in multiple languages. Since March 15, 2010, the development of Redis has been hosted by VMware. Since May 2013, the development of Redis has been sponsored by Pivotal.

Official download address: http://redis.io/download , but there is no official executable program under 64-bit Windows, currently there is an open source hosted on github, address: https://github.com/ServiceStack/redis -windows  Click this place, download the file and unzip it to your own computer directory.

The version used in this article: redis64-3.0.501.zip

The directory after decompression is as follows:

 

file name brief
redis-benchmark.exe Benchmarks
redis-check-aof.exe aof
redischeck-dump.exe dump
redis-cli.exe client
redis-server.exe server
redis.windows.conf configuration file

 

Then edit the redis.windows.conf file. I read some online tutorials that say to edit maxheap <bytes>  in it, but after version 3.x, the modification is maxmemory  <bytes> , bytes are bytes, please convert by yourself, I will change it here into maxmemory 1024000000 .

In fact, this place does not need to be set, as he has already said in the description, redis will automatically set it.

Set the password of redis: find # requirepass foobared and change it  to  requirepass my password  , you can not set it for local testing.

 

After saving, open the decompression directory of redis, shift + left mouse button to find the menu: open the command line window here or  run the cmd command to this directory by yourself

The command is as follows:

redis-server.exe redis.windows.conf --maxmemory 200M

The --maxmemory 200M is optional. If you configure it in the configuration file redis.windows.conf, this can be omitted. If it is not configured, this can be added or not, as long as you are happy.

When this interface appears, it means that the startup is successful, listening to port 6379, and then let's test the effect.

Re-open a DOS interface, the effect is as follows:

If you set the password of redis, you need to execute the auth password command before set, otherwise it will prompt (error) NOAUTH Authentication required.

Finally, let's talk about adding redis to Windows services. First, start the redis server, then run the redis client, and then use the Windows service-install command to enter

redis-server --service-install redis.windows.conf --loglevel verbose  

In the future, you can use win's service to start, and you don't need to open a DOS interface every time to start.

 

1. Install redis service

redis-install.bat

1 echo install redis-server
2
3 D:\redis\redis-server.exe --service-install D:\redis\redis.windows.conf --loglevel verbose

2. Uninstall the redis service

redis-uninstall.bat

1 echo uninstall redis-server
2
3 D:\redis\redis-server.exe --service-uninstall  

3. Start the redis service

start-redis.bat

1 echo start redis-server
2
3 D:\redis\redis-server.exe D:\redis\redis.windows.conf

Let’s quote a passage from Baidu Encyclopedia first, you can check it in Encyclopedia for details.

Redis is an open source log-type, key-value database written in ANSI C language, supports network, can be memory-based and persistent, and provides APIs in multiple languages. Since March 15, 2010, the development of Redis has been hosted by VMware. Since May 2013, the development of Redis has been sponsored by Pivotal.

Official download address: http://redis.io/download , but there is no official executable program under 64-bit Windows, currently there is an open source hosted on github, address: https://github.com/ServiceStack/redis -windows  Click this place, download the file and unzip it to your own computer directory.

The version used in this article: redis64-3.0.501.zip

The directory after decompression is as follows:

 

file name brief
redis-benchmark.exe Benchmarks
redis-check-aof.exe aof
redischeck-dump.exe dump
redis-cli.exe client
redis-server.exe server
redis.windows.conf configuration file

 

Then edit the redis.windows.conf file. I read some online tutorials that say to edit maxheap <bytes>  in it, but after version 3.x, the modification is maxmemory  <bytes> , bytes are bytes, please convert by yourself, I will change it here into maxmemory 1024000000 .

In fact, this place does not need to be set, as he has already said in the description, redis will automatically set it.

Set the password of redis: find # requirepass foobared and change it  to  requirepass my password  , you can not set it for local testing.

 

After saving, open the decompression directory of redis, shift + left mouse button to find the menu: open the command line window here or  run the cmd command to this directory by yourself

The command is as follows:

redis-server.exe redis.windows.conf --maxmemory 200M

The --maxmemory 200M is optional. If you configure it in the configuration file redis.windows.conf, this can be omitted. If it is not configured, this can be added or not, as long as you are happy.

When this interface appears, it means that the startup is successful, listening to port 6379, and then let's test the effect.

Re-open a DOS interface, the effect is as follows:

If you set the password of redis, you need to execute the auth password command before set, otherwise it will prompt (error) NOAUTH Authentication required.

Finally, let's talk about adding redis to Windows services. First, start the redis server, then run the redis client, and then use the Windows service-install command to enter

redis-server --service-install redis.windows.conf --loglevel verbose  

In the future, you can use win's service to start, and you don't need to open a DOS interface every time to start.

 

1. Install redis service

redis-install.bat

1 echo install redis-server
2
3 D:\redis\redis-server.exe --service-install D:\redis\redis.windows.conf --loglevel verbose

2. Uninstall the redis service

redis-uninstall.bat

1 echo uninstall redis-server
2
3 D:\redis\redis-server.exe --service-uninstall  

3. Start the redis service

start-redis.bat

1 echo start redis-server
2
3 D:\redis\redis-server.exe D:\redis\redis.windows.conf

Guess you like

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