当前位置:网站首页>Linux server installation redis
Linux server installation redis
2022-06-30 07:00:00 【A rookie is a great God】
The server used in this article is CentOS7.6
1、 download redis
wget Is a free tool to download files from the Internet automatically , Supported by HTTP、HTTPS、FTP Three of the most common TCP/IP agreement download , And can be used HTTP agent .“wget” The name comes from “World Wide Web” And “get” The combination of .
wget https://download.redis.io/releases/redis-6.0.8.tar.gz
2 、 Move the compressed package location
We usually put the installation package of the program in opt Under the table of contents , This is the directory where the additional software is installed for the host , So we will move the downloaded installation package to opt Under the table of contents , And extract the .
mv redis-6.0.8.tar.gz /opt
1
Get into opt Folder
cd /opt
3、 Unzip the file
Execute this command on the... We just downloaded redis Compress the package to decompress
tar -zxvf redis-6.0.8.tar.gz
Other decompression commands
tar –xvf file.tar // decompression tar package
tar -zxvf file.tar.gz // decompression tar.gz
tar -jxvf file.tar.bz2 // decompression tar.bz2
tar –Zxvf file.tar.Z // decompression tar.Z
4、 Enter the extracted file
cd redis-6.0.8
5、 Basic environment installation
because redis yes c Written , So we need to install c Language environment , without gcc Environmental Science , The following commands need to be executed .
yum install gcc-c++ tcl
In some cases, this step is performed directly
make
make install
mak:
If the following error occurs after use , Because redis6 The above version should use gcc7

upgrade gcc
yum install centos-release-scl
yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
When the upgrade is complete , Perform the following make distclean Clear the files that failed to compile , And then again make, This is a success

make install:

6. Copy redis Default configuration file
The default installation path is generally usr/local/bin, Let's go into this directory .
In order to prevent unnecessary trouble caused by frequent modification of the configuration file , We need to copy the configuration file , Future modifications are only for the copied configuration file
mkdir config # Create folder
cp /opt/redis-6.0.8/redis.conf config # take /opt Under the table of contents redis Copy the configuration file to config Under the table of contents
Subsequent operations are based on this configuration file
7、 Set to start in the background
redis It is not started in the background by default , We're going to modify the configuration file , Change to run in the background
vim config/redis.conf
take daemonize no Change it to yes Can .
tip : You can click the slash and enter keywords for global search

Daemon (daemon) It's a special kind of process that runs in the background , Used to perform specific system tasks . Many daemons start when the system boots , And keep running until the system is shut down . Others start only when they need to , Finish the task automatically
8、 start-up
redis-server config/redis.conf
Check the process to determine whether the startup is successful
ps -fe | grep redis
Test connection
redis-cli -p 6379
close
shutdown
9、 Set the password
Enter the configuration file to modify
requirepass: This is redis I've got my password , If you want to connect remotely, configure this password

10、 Remote connection
1、 To configure the password ( If you do not configure a password, turn off protected mode , This is not recommended )
2、redis The default is that remote connection is not supported , Manual opening required , stay redis.conf In file , Find the method code , Comment out :

Then restart the service
Then open 6379 This port number , This port number is also available on the server workbench
Can pass QuickRedis Test success
It's all done here !!!
边栏推荐
- Vscode returns the previous cursor (previous browse position)
- Goland常用快捷键设置
- Steps for formulating class or file templates in idea
- The solution of memcpy memory overlap
- 1.2 (supplementary)
- SOC_ AHB_ SD_ IF
- 【Mask-RCNN】基于Mask-RCNN的目标检测和识别
- [fuzzy neural network] mobile robot path planning based on Fuzzy Neural Network
- Out of class implementation of member function of class template
- 汇编语言学习一(有栈协程铺垫,32位寄存器和相关指令学习,未完待续06/29)
猜你喜欢

ROS service communication programming

原理:WebMvcConfigurer 与 WebMvcConfigurationSupport避坑指南

Unity中实现溶解(Dissolve)特效及其原理解析
![[datawhale team learning] task02: mathematical operation, string and text, list](/img/3e/c9c984d7576a2e410da7f81a8c0aa6.jpg)
[datawhale team learning] task02: mathematical operation, string and text, list

Xshell传输文件

1.4 - fixed and floating point numbers
![[transfer] analysis of memory structure, cache and DMA architecture](/img/c1/6a872babf9b5236d226de455a49b8b.png)
[transfer] analysis of memory structure, cache and DMA architecture

Go项目目录结构介绍

Performance comparison of random network, scale-free network, small world network and NS small world matlab simulation

汇编语言学习一(有栈协程铺垫,32位寄存器和相关指令学习,未完待续06/29)
随机推荐
原来你是这样的数组,终于学会了
1.7 - CPU performance indicators
It turns out that you are such an array. You have finally learned
Go语言指针介绍
Finished product upgrade procedure
Traverse map
Vscode returns the previous cursor (previous browse position)
Cmake post makefile:32: * * * missing separator Stop.
Mysql5.7 compressed version installation tutorial
[Hot100]10. Regular Expression Matching
【Mask-RCNN】基于Mask-RCNN的目标检测和识别
【申博攻略】五.专家推荐信模板
记录一次腾讯测试开发工程师自动化接口测试实践经验
Cluster distributed
如果我在珠海,到哪里开户比较好?另外,手机开户安全么?
Record common problems: spaces in encodeuricomponent decoding and the use of Schema in third-party apps to invoke apps
ROS service communication programming
What if I forget my account number after opening an account? Is it safe to open an account online?
The most complete sentence in history
Connection Flood攻击原理