当前位置:网站首页>Windows installs redis and sets the redis service to start automatically
Windows installs redis and sets the redis service to start automatically
2022-04-23 10:13:00 【Game programming】
Redis As a caching tool , It is mainly used to solve the problem of high concurrency , It is widely used in distributed system ,Redis Itself is applied to Linux/Unix Platform ( Deploy on the server ), The official didn't provide Windows Version of the platform , But the average developer is Windows Development and debugging under the platform , therefore , There needs to be Windows Version of Redis , This article will show you how to Windows Under platform installation Redis And will be Redis Set to service .
1 download Redis
Windows edition Redis Download address :[https://github.com/tporadowski/redis/releases]( The latest version 5.0.14)(https://github.com/tporadowski/redis/releases)
( This is officially maintained by Microsoft , take Redis Migration to Windows platform , May lag behind the official Redis Version of )
Redis Official download address (Linux/Unix edition ): https://redis.io/download
About Windows Platform Redis Here are two versions , One is the installation version , The other is the installation free version , At the same time, both versions only support 64 position , I won't support it 32 position , The author downloaded the installation free version

2 install Redis
In fact, if you download the installation free version Redis Words , Installation is not required , Directly decompress the compressed package to run the service
The specific operation is :

2.1 Turn on Redis service
Decompressed Redis Run in the file directory redis-server.exe
After the command runs , Redis The service has been opened , You can test the connection directly , however , A little bit , This window can't be closed , otherwise , The service is shut down
( Here's a little tip , Press and hold... In the file directory shift + Right mouse button , The pop-up menu options will include Open command window here , The command line is directly in the current directory )
2.2 Test connection Redis service
Still decompressing Redis File directory , Reopen a command line window Run the command redis-cli.exe -h 127.0.0.1 -p 6379
( Here's an explanation ,Redis default ip The address is local , That is to say 127.0.0.1, The default port is 6379 port , This is in the configuration file redis.windows.conf Set in , It will be explained separately later )

2.3 To configure Redis service
Redis The configuration file for the service is Decompressed Redis File directory redis.windows.conf file
The author here only talks about a few basic parameters
- ip Address ( Default to native 127.0.0.1) : bind 127.0.0.1
port ( The default is 6379) : port 6379
Service password ( Default not on ): requirepass Come here ,Redis The service has been turned on , And the test connection is successful , The most basic operation has been completed , You can develop and debug on this machine
The following author will introduce how to Redis Your service is set to windows System services . As you can see from the demonstration just now , We can only in Redis Only by operating under the file directory of Redis Service for , This is too much trouble , Therefore, it is necessary to set it as a global system service ( It's like MySQL It's the same service ), You only need to open the command line window in any directory at a time
OK, Let's get down to business
3 take Redis Set to windows Service for
3.1 take Redis Add the extracted directory to the system environment variable
Right mouse button 「 My computer 」– choice 「 attribute 」– choice 「 Advanced system setup 」–
– choice 「 environment variable 」–
– Find it in the column of system variables 「Path」 This variable , Select and click... Below 「 edit 」–
– Click on 「 newly build 」, take Redis Copy and paste the directory address of the extracted file , Then click on the bottom 「 determine 」 , close window , Click all the windows in front 「 determine 」 After closing
OK, Redis Environment variables have been added , Let's move on to the next step

3.2 take Redis Services write windows service
Still decompressing Redis Create a new command line under the file directory , Enter the command redis-server.exe --service-install redis.windows.conf --loglevel verbose

3.3 View and set up Redis Service for
After writing, you can view and set in the system service
The operation steps are: : Right mouse button 「 The task bar 」– Click on 「 Task manager 」— choice 「 service 」 Options — Click below 「 Open the service 」 Button , After opening the service window, you can find Redis Service for

You can set Redis Properties of the service , When we will Redis Set to windows After a service , The service is automatically opened by default , If we only need to start this service during development and debugging , After debugging, turn off the service , It can be Redis The system service is set to manual
Right mouse button 「Redis」 service — Click on 「 attribute 」 Button — In the pop-up window , take 「 Start type 」 Set to 「 Manual 」, And then click 「 determine 」 that will do

So now , The author has put Redis The setting becomes windows A service of , Now you can open the command line window in any directory to Redis The opening of the service ? The answer is No , One last step Restart the computer , Because the modified environment variable has not yet taken effect
Additional explanation (20180304)
In the revision Redis Configuration file for redis.windows.conf When , Valid configuration item characters must be written in the top left space (eg: Canceling requirepass The front one # when , The front... Must be Space Delete , Otherwise, it will be thrown when the service is started Invalid argument during startup: unknown conf file parameter : requirepass abnormal , If it has been set to windows service , It will be thrown out. system error caught. error code=1053, message = StartService failed: unknown error abnormal )
3.4 Opening and closing Redis service
After restarting the computer , You can operate directly on the command line Redis Yes
Basic commands :
- Opening service redis-server --service-start
Close the service redis-server --service-stop
Uninstall service redis-server --service-uninstall
Service rename redis-server --service-name server-name thus , Complete . Now? Redis Already in Windows Installed under the platform , also Redis Set to service .

author : Fight tiger tonight z
Game programming ️, A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
版权声明
本文为[Game programming]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230949179984.html
边栏推荐
- shell脚本免交互
- Sim Api User Guide(4)
- What if Jerry's function to locate the corresponding address is not accurate sometimes? [chapter]
- 一文看懂 LSTM(Long Short-Term Memory)
- Odoo 服务器搭建备忘
- Zhengda international explains what the Dow Jones industrial index is?
- Realize data value through streaming data integration (2)
- 通过流式数据集成实现数据价值(1)
- ansible 云计算 自动化
- 101. Symmetric Tree
猜你喜欢
Shell script interaction free
Computer network security experiment II DNS protocol vulnerability utilization experiment
Examination questions and answers of the third batch (main person in charge) of Guangdong safety officer a certificate in 2022
IDEA——》每次启动都会Indexing或 scanning files to index
基于PyQt5实现弹出任务进度条功能示例
Jerry's more accurate determination of abnormal address [chapter]
Depth selector
Juc并发编程09——Condition实现源码分析
一文看懂 LSTM(Long Short-Term Memory)
Yarn核心参数配置
随机推荐
ARM调试(1):两种在keil中实现printf重定向到串口的方法
Jerry's more accurate determination of abnormal address [chapter]
转:毛姆:阅读是一座随身携带的避难所
Sim Api User Guide(4)
Realize data value through streaming data integration (3) - real-time continuous data collection
MapReduce计算流程详解
杰理之AES能256bit吗【篇】
第一章 Oracle Database In-Memory 相关概念(续)(IM-1.2)
Go language practice mode - functional options pattern
The central control learning infrared remote control module supports network and serial port control
深度选择器
Jerry sometimes finds that the memory has been tampered with, but there is no exception. How should he find it? [chapter]
Sim Api User Guide(7)
349、两个数组的交集
Common SQL statements of DBA (6) - daily management
What if Jerry's function to locate the corresponding address is not accurate sometimes? [chapter]
DBA常用SQL语句(1)— 概况信息
Odoo server setup notes
Ansible cloud computing automation
Sim Api User Guide(8)