Install and set up Redis under Windows

Source: Internet
Author: User
Tags redis download redis version install redis

Install and set up Redis under Windows

Redis is officially supported for Linux, there is nothing to say about installation and use, and normal use is under official guidance and can be done within 5 minutes. For more information, please refer to:

Http://redis.io/download

But sometimes when you want to toss Redis under Windows, you can see the following tips from the Redis download page (Search for "windows" in the page):

[Plain]View Plaincopy
    1. Win64 unofficial The Redis project does not directly support Windows,
    2. However the Microsoft Open Tech Group develops and maintains
    3. An Windows port targeting Win64.

The main idea is that Redis officially does not support windows, but Microsoft Open Tech Group has developed a Win64 version on GitHub with the project address:

Https://github.com/MSOpenTech/redis

When you open it, you can download it directly from your browser, or Git clone.

You can find the zip package on the right side of the project homepage: https://github.com/MSOpenTech/redis/archive/2.8.zip

( Note : Dist file changed: https://github.com/MSOpenTech/redis/releases)

On the Release page, you can find the MSI installation file and the. zip file (and a 3.0 beta version, please drop-down to find).

Download unzip, there is nothing to say, in the extracted bin directory under the following these files:

[Plain]View Plaincopy
    1. Redis-benchmark.exe #基准测试
    2. Redis-check-aof.exe # AOF
    3. Redis-check-dump.exe # Dump
    4. Redis-cli.exe # Client
    5. Redis-server.exe # Server
    6. REDIS.WINDOWS.CONF # configuration file

Of course, there is a Redisservice.docx file, which appears to be a description of some startup and installation services, but according to his instructions, you will die very miserable, inexplicably dead, do not know the reason.

"After the machine re-test has been identified, if not administrator users, there will be a variety of problems, service installation can not start and so on, you should be able to modify the properties of the service--login users and other options to fix."

"If you installed Windows without a administrator account, please refer to this article:

n ways to enable the Super Admin administrator account in Windows 7

The online reference of some information, found that can be used, there is no drill, direct take doctrine:

The startup script is as follows:

[Plain]View Plaincopy
    1. Redis-server redis.windows.conf

It can be saved as a file startup.bat ; The next time you can start directly.

However, after executing this command in CMD, the error is:

[Plain]View Plaincopy
  1. D:\develop\redis-2.8.12>redis-server.exe redis.windows.conf
  2. [7736] 21:39:42.974 #
  3. The Windows version of Redis allocates a large memory mapped file for sharing
  4. The heap with the forked process used in persistence operations. This file
  5. 'll be created in the working directory or the directory specified by
  6. The ' dir ' directive in the. conf file. Windows is reporting this there is
  7. Insufficient disk space available for this file (Windows error 0x70).
  8. Fix this problem by either reducing the size of the Redis heap with
  9. The--MAXHEAP flag, or by starting Redis from a working directory with
  10. Sufficient space available for the Redis heap.
  11. Please see the documentation included with the binary distributions for more
  12. Details on the--MAXHEAP flag.
  13. Redis can not continue. Exiting.


As a hint, there is a problem with the Maxheap identity, open the profile redis.windows.conf, search for maxheap , and then directly specify the good content.

[Plain]View Plaincopy
    1. .......
    2. #
    3. # Maxheap <bytes>
    4. Maxheap 1024000000
    5. .......

Then start again, OK, success.

[Plain]View Plaincopy
  1. D:\develop\redis-2.8.12>redis-server redis.windows.conf
  2. _._
  3. _.-' __ '-._
  4. _.-``    `.  `_. "-._ Redis 2.8.12 (00000000/0)
  5. .-`` .-```. ' \ \ _.,_ '-._
  6. (',.-' | ',) Running in Stand alone mode
  7. | '-._ '-...-' __...-. '-._| '     ' _.-' | port:6379
  8. |     '-._ '. _/_.-' | pid:6736
  9. '-._ '-._ '-./_.-' _.-'
  10. | '-._ '-._ '-.__.-' _.-' _.-' |
  11. |           '-._ '-._ _.-' _.-' | Http://redis.io
  12. '-._ '-._ '-.__.-' _.-' _.-'
  13. | '-._ '-._ '-.__.-' _.-' _.-' |
  14. | '-._ '-._ _.-' _.-' |
  15. '-._ '-._ '-.__.-' _.-' _.-'
  16. '-._ '-.__.-' _.-'
  17. '-._ _.-'
  18. '-.__.-'
  19. [6736] 22:01:22.247 # Server started, Redis version 2.8.12
  20. [6736] 22:01:22.248 * The server is now a ready-to-accept connections on port 6379


You can then use your own client-side tools for testing.

Double hit Open Redis-cli.exe , if not error, then connected to the local server, and then test, such as the SET command, get command:

[Plain]View Plaincopy
    1. 127.0.0.1:6379> Set Tiemao Http://blog.csdn.net/renfufei
    2. Ok
    3. 127.0.0.1:6379> Get Tiemao
    4. "Http://blog.csdn.net/renfufei"
    5. 127.0.0.1:6379>

This should be well understood, connected to the 6379 port on this machine.

If you need assistance, you can enter help view in the CLI window, for example:

[Plain]View Plaincopy
    1. 127.0.0.1:6379> Help
    2. REDIS-CLI 2.8.12
    3. Type: ' Help @<group> ' to get a list of commands in <group>
    4. "Help <command>" to help on <command>
    5. "Help <tab>" to get a list of possible Help topics
    6. "Quit" to exit
    7. 127.0.0.1:6379> Help @string

According to the prompt, you can enter help space and then hit the TAB key, you can like a command prompt to tell you what can be helpful groups, more than a few tab to try?
Remark Description:

1. This version is Win64, so 32-bit Windows don't toss it.

2. My operating system is the Windows 7 64-bit flagship, running memory 16GB, the user is not administrator, but Hasee, so set the next Redis-server.exe and Redis-cli.exe properties in the compatibility permissions ( Run as administrator), if you run an error, you may need to set up here.

3. What 360 Ah, UAC Ah, firewall ah, the shut off please ...

4. If there are other questions, please leave a message or comment, this is just a whim when the toss
have been in touch with Redis for a long time but haven't used it under Windows, tap.

Attach several bat batch scripts, flexibly configured as needed

Service-install.bat

[Plain]View Plaincopy
    1. Redis-server.exe--service-install redis.windows.conf--loglevel verbose

Uninstall-service.bat

[Plain]View Plaincopy
    1. Redis-server--service-uninstall

Startup.bat

[Plain]View Plaincopy
    1. Redis-server.exe redis.windows.conf



For more information, please refer to: Redis Local environment build. MD

I am in this group, the group has a large number of master lurking, Welcome to join: Click on the link to join the group "Redis 2000 people Total Group"

Install and set up Redis under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.