Windows under Install and Setup Redis

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


Windows under Install and Setup Redis





Redis is officially supported for Linux, and the installation and use of it is nothing to say, ordinary use according to official instructions, within 5 minutes can be done. Please refer to:



Http://redis.io/download






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

Win64 Unofficial The Redis project does not directly support Windows,
However the Microsoft Open Tech group develops and maintains
an Windows port targeting Win64.
 

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

https://github.com/MSOpenTech/redis

After opening it, you can download it directly using a browser or git clone it.

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

(Note: The dist file changed the download address: https://github.com/MSOpenTech/redis/releases)

On the Release page, you can find the msi installation file and the .zip file (and there is a beta version of 3.0, please drop down to find it).

Download the decompression, there is nothing to say, there are the following files in the bin directory after decompression:

 

redis-benchmark.exe #benchmark
redis-check-aof.exe # aof
redis-check-dump.exe # dump
redis-cli.exe # client
redis-server.exe # server
redis.windows.conf # configuration file
Of course, there is also a RedisService.docx file, which seems to be some instructions for starting and installing the service, but according to his instructions, you will die very miserably, somehow died, and I do not know why.

[It has been found after changing the machine and re-testing that if it is not an Administrator user, various problems will occur, and the service cannot be started after installation, and so on. It should be possible to modify the service properties-> login user and other options to correct.]

[If you don't have an Administrator account for windows installation, please refer to this article:

N ways to enable super administrator administrator account in Windows 7
 】

I consulted some materials online and found that they can be used, so I didn't dig deeper, and directly took the theory:

The startup script is as follows:

 

redis-server redis.windows.conf
You can save it as a file startup.bat; you can start it next time.

But after executing this command in cmd, an error is reported:

 

D: \ Develop \ redis-2.8.12> redis-server.exe redis.windows.conf
[7736] 10 Aug 21: 39: 42.974 #
The Windows version of Redis allocates a large memory mapped file for sharing
the heap with the forked process used in persistence operations. This file
will be created in the current working directory or the directory specified by
the ‘dir’ directive in the .conf file. Windows is reporting that there is
insufficient disk space available for this file (Windows error 0x70).

You may fix this problem by either reducing the size of the Redis heap with
the --maxheap flag, or by starting redis from a working directory with
sufficient space available for the Redis heap.

Please see the documentation included with the binary distributions for more
details on the --maxheap flag.

Redis can not continue. Exiting.
According to the prompt, there is a problem with the maxheap logo. Open the configuration file redis.windows.conf, search for maxheap, and then specify the content directly.

.......
#
# maxheap <bytes>
maxheap 1024000000
.......
Then start again, OK, success.

D: \ Develop \ redis-2.8.12> redis-server redis.windows.conf
                _._
           _.- `` __ ‘‘ -._
      _.- `` `.` _. ‘‘ -._ Redis 2.8.12 (00000000/0) 64 bit
  .-`` .-```. `` `\ / _., _‘ ‘-._
 (‘, .-` |`,) Running in stand alone mode
 | `-._` -...- `__...-.` `-._ |‘ `_.-‘ | Port: 6379
 | `-._` ._ / _.- ‘| PID: 6736
  `-._` -._ `-. / _.-‘ _.- ’
 | `-._` -._ `-.__.-‘ _.-‘_.- ’|
 | `-._` -._ _.-‘_.- ’| http://redis.io
  `-._` -._ `-.__.-‘_.-’ _.- ’
 | `-._` -._ `-.__.-‘ _.-‘_.- ’|
 | `-._` -._ _.-‘_.- ’| |
  `-._` -._ `-.__.-‘_.-’ _.- ’
      `-._` -.__.- ‘_.-’
          `-._ _.-‘
              `-.__.-‘

[6736] 10 Aug 22: 01: 22.247 # Server started, Redis version 2.8.12
[6736] 10 Aug 22: 01: 22.248 * The server is now ready to accept connections on port 6379
You can then use the built-in client tools for testing.

Double-click to open redis-cli.exe, if no error is reported, connect to the local server, and then test, such as the set command, get command:

 

127.0.0.1:6379> set tiemao http://blog.csdn.net/renfufei
OK
127.0.0.1:6379> get tiemao
"http://blog.csdn.net/renfufei"
127.0.0.1:6379>
This should be well understood, connected to port 6379 of this machine.

If you need help, you can enter help in the cli window, for example:

 

127.0.0.1:6379> help
redis-cli 2.8.12
Type: "help @ <group>" to get a list of commands in <group>
      "help <command>" for help on <command>
      "help <tab>" to get a list of possible help topics
      "quit" to exit
127.0.0.1:6379> help @string
According to the prompt, you can enter the help space and then press the tab key, which can tell you which help groups you can have like a command prompt. Try typing more tabs?
instruction manual:

1. This version is Win64, so don't toss about 32-bit windows.

2. My operating system is Windows 7 64-bit Ultimate, running 16GB of memory, the user is not Administrator, but hase, so I set the compatibility permission in the properties of redis-server.exe and redis-cli.exe Run as administrator), if you run wrong, you may need to set it up here.

3. What is 360, UAC, firewall, please close it. . .

4. If you have any other questions, please leave a message or comment, this is just a toss when you are whimping
I have been in contact with Redis for a long time but have not used it under windows, please tap.

Attach several bat batch scripts, please configure flexibly as needed

service-install.bat

 

redis-server.exe --service-install redis.windows.conf --loglevel verbose
uninstall-service.bat

redis-server --service-uninstall
startup.bat

redis-server.exe redis.windows.conf
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.