Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis On Windows installation record

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Redis is a popular in-memory non-relational database solution. Relying on high performance, replication characteristics and problem-oriented data structure, it is more and more adopted and applied as the core component of the system. For most application environments, Redis is based on the Linux environment, but it also provides an installation solution for the Windows environment.

This article mainly introduces the method of installing Redis On Windows, which is provided to the friends who need it for reference.

1. Environment and Media

First of all, we can not find the Windows version of Redis media from Redis's official website https://redis.io/. However, on GitHub, you can find the corresponding old Redis On Windows media at ttps://github.com/MSOpenTech/redis/releases.

The author downloaded 64-bit version 3.2, the media name: Redis-x64-3.2.100.zip. Note: like other software, Redis also provides installation of the exe/mis version and zip unzipped version. For users, the exe version is relatively easy to install, and this article focuses on the introduction to the zip version.

2. Installation and configuration

Extract the zip file to the specified installation directory.

-- put it on the corresponding directory

C:\ > cd redis

C:\ Redis > dir

The volume in drive C has no label.

The serial number of the volume is 360A-018F

Directory of C:\ Redis

2018-07-16 22:03.

2018-07-16 22:03..

2016-07-01 16:27 1024 EventLog.dll

2016-07-01 16:07 12509 Redis on Windows Release Notes.docx

2016-07-01 16:07 16727 Redis on Windows.docx

(for reasons of space, there are omissions. )

2016-07-01 16:07 48212 redis.windows-service.conf

2016-07-01 16:07 48201 redis.windows.conf

2016-07-01 09:17 14265 Windows Service Documentation.docx

14 files 22470282 bytes

2 directories 30208651264 available bytes

By default, the running parameters need to be adjusted simply. Note: if it is the production environment, it needs to be carefully considered.

The main adjustment file is redis.windows.conf, in which the data is organized in a key-value manner. We adjust two parameters, one is the memory usage size, and the other is the validation mode.

# maxmemory

Maxmemory 1073741824

# requirepass foobared

Requirepass test

3. Start and test the experiment

If desired, you can add the Redis directory to the environment configuration file PATH. From the command command line, execute the start server command.

C:\ Users\ 51ibm > redis-server.exe redis.windows.conf

Invalid argument during startup: Failed to open the .conf file: redis.windows.conf CWD=C:\ Users\ 51ibm

You need to change to the installation directory for execution, otherwise the corresponding configuration file cannot be found.

C:\ Users\ 51ibm > cd c:/redis

C:\ Redis > redis-server.exe redis.windows.conf

_. _

_.-``_'-. _

_.-``` `_. '' -. _ Redis 3.2.100 (0000000 Redis 0) 64 bit

.-``.-```. ```\ / _, _'-. _

(',.-`|`,) Running in standalone mode

| | `-. _` -.-`_ _.-.`` -. _ |'` _. -'| Port: 6379 |

| | `-. _`. _ / _. -'| PID: 9392 |

[9392] 16 Jul 22:17:26.870 # Server started, Redis version 3.2.100

[9392] 16 Jul 22 1715 26.871 * The server is now ready to accept connections on port 6379

After the server starts, wait for a connection at a specific port (default port 6379). Redis provides a standard command line access tool, redis-cli.exe, for access.

C:\ Users\ 51ibm > redis-cli.exe

127.0.0.1 purl 6379 > info

NOAUTH Authentication required.

127.0.0.1 purl 6379 > auth test

OK

127.0.0.1 purl 6379 > info

# Memory

Used_memory:690096

Maxmemory:1073741824

(for reasons of space, there are omissions. )

In a Windows environment, if you close the command window in the background, the server shuts down automatically.

[9392] 16 Jul 22:19:52.594 # User requested shutdown...

[9392] 16 Jul 22 1915 52.594 * Saving the final RDB snapshot before exiting.

[9392] 16 Jul 22 19 52.680 * DB saved on disk

[9392] 16 Jul 22:19:52.680 # Redis is now ready to exit, bye bye...

4. Install startup service

On Windows, similar services are best managed as the operating system service Service. It can be configured through a special command line.

C:\ Redis > redis-server-- service-install redis.windows.conf-- loglevel verbose

[9236] 16 Jul 22 NT AUTHORITY 22 NT AUTHORITY 54.376 # Granting read/write access to'NT AUTHORITY\ NetworkService' on: "c:\ Red

Is "" c:\ Redis\ "

[9236] 16 Jul 22:22:54.377 # Redis successfully installed as a service.

C:\ Redis >

After starting the service, the system can be accessed normally.

127.0.0.1 purl 6379 > auth test

OK

127.0.0.1 purl 6379 > set name Tom

OK

127.0.0.1 purl 6379 > get name

"Tom"

127.0.0.1purl 6379 >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report