当前位置:网站首页>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
边栏推荐
- 通过流式数据集成实现数据价值(2)
- 2022 mobile crane driver test question bank simulation test platform operation
- 杰理之通常影响CPU性能测试结果的因素有:【篇】
- NEC infrared remote control coding description
- Pyqt5 and communication
- Jerry's factors that usually affect CPU performance test results are: [article]
- LeetCode-608. 树节点
- Depth selector
- 202、快乐数
- Yarn资源调度器
猜你喜欢

Sim Api User Guide(4)

Examination questions and answers of the third batch (main person in charge) of Guangdong safety officer a certificate in 2022

Zhengda international explains what the Dow Jones industrial index is?

2022年流动式起重机司机考试题库模拟考试平台操作

Depth selector

实践六 Windows操作系统安全攻防

JVM——》常用参数

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

JUC concurrent programming 09 -- source code analysis of condition implementation

Failureforwardurl and failureurl
随机推荐
Juc并发编程06——深入剖析队列同步器AQS源码
Understand the new economic model of platofarm and its ecological progress
707、设计链表(链表)
Odoo 服务器搭建备忘
Can Jerry's AES 256bit [chapter]
Sim Api User Guide(5)
Shell script interaction free
Exercise questions and simulation test of refrigeration and air conditioning equipment operation test in 2022
【省选联考 2022 D2T1】卡牌(状态压缩 DP,FWT卷积)
杰理之用户如何最简单的处理事件【篇】
雨生百谷,万物生长
What are the system events of Jerry's [chapter]
"Gu Yu series" airdrop
Failureforwardurl and failureurl
2022年流动式起重机司机考试题库模拟考试平台操作
101. Symmetric Tree
ARM调试(1):两种在keil中实现printf重定向到串口的方法
ansible 云计算 自动化 命令行精简版
计算机网络安全实验二|DNS协议漏洞利用实验
Zhengda international explains what the Dow Jones industrial index is?