Install the Redis tutorial under 64 bit Windows

  • 2020-05-09 19:37:01
  • OfStack

Redis is officially supported for Linux. There is nothing to say about the installation and use of Redis. For details, please refer to: http: / / redis io/download

If you want to play Redis under windows, you can see the following tips on the redis download 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.

Carelessness is Redis official support windows, just Microsoft Open Tech group on GitHub developed a Win64 version, project address is: https: / / github com/MSOpenTech/redis

Once open, you can download it directly using a browser or an git clone.

Can be found in the project home page on the right side of the zip package download address: https: / / github com MSOpenTech/redis archive / 2.8. zip

Download unzip, there is nothing to say, after unzip the bin directory has the following files:


redis-benchmark.exe         # The benchmark
redis-check-aof.exe         # aof
redis-check-dump.exe        # dump
redis-cli.exe               # The client
redis-server.exe            # The server
redis.windows.conf          # The configuration file

Of course, there is also an RedisService.docx file, which seems to be some instructions for starting and installing the service, but if you follow his instructions, you will die tragically, inexplicable, and I don't know why.
After retesting the machine, it has been found that if it is not the Administrator user, there will be all kinds of problems, the service cannot start after installation, and so on. It should be possible to modify the attributes of the service -- > Login user and other options to correct.

(if you have installed windows without Administrator account, please refer to this article: N ways to enable administrator account for super administrator Windows 7)

Online reference 1 some information, found that can be used, also without in-depth study, directly to the doctrine:

The startup script is as follows:


redis-server  redis.windows.conf

You can save it as a file startup.bat; Next time you can start it directly.
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 something wrong with the maxheap logo. Open the configuration file redis.windows.conf, search for maxheap, and then directly specify the content.


.......

# maxheap <bytes>
maxheap 1024000000
.......

And then it starts again,OK, and it works.


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 your own client tools for testing.
Double-click to open redis-cli.exe, if no error is reported, then connect to the local server, and then test, such as set command, get command:


127.0.0.1:6379> set tiemao //www.ofstack.com
OK
127.0.0.1:6379> get tiemao
"//www.ofstack.com"
127.0.0.1:6379>

It should make sense to connect to port 6379 on the machine.

If you need help, 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

When prompted, type in help space and hit tab. This will tell you what you can do to group, as shown in command prompt 1.
Remarks:

1. This version is Win64, so don't bother with the 32-bit windows.

2. My operating system is Windows 7 64-bit flagship version, running memory 16GB, the user is not Administrator, but hasee, so I set the compatibility permissions in the properties of redis-server. exe and redis-cli. exe (running as an administrator).

3. What 360 ah, UAC ah, the firewall ah, the clearance please close...

4. If you have any other questions, please feel free to leave comments or comments. This is just a toss and turn on a whim

I have been in touch with Redis for a long time, but the 1 is not used under windows. Please tap it.


Related articles: