当前位置:网站首页>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
边栏推荐
- 二叉树的构建和遍历
- Turn: Maugham: reading is a portable refuge
- Longest common front string
- DBA common SQL statements (1) - overview information
- NEC infrared remote control coding description
- ansible playbook语法和格式 自动化云计算
- 通过流式数据集成实现数据价值(4)-流数据管道
- SQL调优系列文章之—SQL性能方法论
- 通过流式数据集成实现数据价值(2)
- LeetCode 1249. Minimum Remove to Make Valid Parentheses - FB高频题1
猜你喜欢

《Redis设计与实现》

Exercise questions and simulation test of refrigeration and air conditioning equipment operation test in 2022

Sim Api User Guide(6)

中职网络安全2022国赛之CVE-2019-0708漏洞利用

Computer network security experiment II DNS protocol vulnerability utilization experiment

Depth selector

【无标题】

Redis design and Implementation

Yarn核心参数配置

2022 mobile crane driver test question bank simulation test platform operation
随机推荐
59、螺旋矩阵(数组)
杰理之用户如何最简单的处理事件【篇】
中职网络安全2022国赛之CVE-2019-0708漏洞利用
DBA common SQL statements (2) - SGA and PGA
Realize data value through streaming data integration (3) - real-time continuous data collection
Function realization of printing page
杰理之有时候发现内存被篡改,但是没有造成异常,应该如何查找?【篇】
2022 mobile crane driver test question bank simulation test platform operation
Yarn资源调度器
0704、ansible----01
[untitled]
Question bank and answers of Shanghai safety officer C certificate examination in 2022
通过流式数据集成实现数据价值(5)- 流分析
Configuration of LNMP
MapReduce压缩
Go language practice mode - functional options pattern
IDEA——》每次启动都会Indexing或 scanning files to index
JUC concurrent programming 07 -- is fair lock really fair (source code analysis)
Sim Api User Guide(8)
997、有序数组的平方(数组)