当前位置:网站首页>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 !!!
边栏推荐
- [Hot100]回文子串 与 最长回文子串
- 1.9 - Cache
- The most complete sentence in history
- 0 basic job transfer software test, how to achieve a monthly salary of 9.5k+
- [transfer] analysis of memory structure, cache and DMA architecture
- 原来你是这样的数组,终于学会了
- Google Earth engine (GEE) - Murray global tidal wetland change V1 (1999-2019) data set
- Browser downloads files as attachments
- Authority management system
- Unity中实现溶解(Dissolve)特效及其原理解析
猜你喜欢
[daily question] 535 Encryption and decryption of tinyurl
SOC_SD_CLK
Why does ETL often become ELT or even let?
原理:WebMvcConfigurer 与 WebMvcConfigurationSupport避坑指南
1.4 - fixed and floating point numbers
Keil - the "trace HW not present" appears during download debugging
Mysql5.7 compressed version installation tutorial
Four tips in numpy
[my advanced OpenGL learning journey] about the access methods of vector and matrix classification of OpenGL shaders: xyzw/rgba/stpq and array subscripts
Unity中实现溶解(Dissolve)特效及其原理解析
随机推荐
元宇宙由哪些底层技术支撑?
Ffmplay is not generated during the compilation and installation of ffmpeg source code
SOC_AHB_SD_IF
0基础转行软件测试,如何实现月薪9.5k+
Traverse map
Why does ETL often become ELT or even let?
Go常用命令
Servlet principle
RT thread Kernel Implementation (V): timer
How to set the hot deployment of idea web project
Fastapi learning Day1
经纬恒润再次荣获PACCAR集团 10PPM 质量奖
1.2 (supplementary)
[my advanced OpenGL learning journey] about the access methods of vector and matrix classification of OpenGL shaders: xyzw/rgba/stpq and array subscripts
ROS-URDF
[Hot100]10. Regular Expression Matching
Porting RT thread to s5p4418 (V): thread communication
Vscode returns the previous cursor (previous browse position)
SOC project AHB_ SD_ Host controller design
IDEA import导入的类明明存在,却飘红?