当前位置:网站首页>Centos7 installation and configuration of redis database
Centos7 installation and configuration of redis database
2022-07-02 21:35:00 【yaoyaozaiye】
CentOS7 Installation configuration Redis database
【 Operation steps 】
1. download redis Installation package wget http://download.redis.io/releases/redis-5.0.3.tar.gz
2. Unzip the installation package tar -zxvf redis-5.0.3.tar.gz
3. install gcc Environmental Science yum install gcc
redis You need to install first gcc(C Language compiler ), because redis Yes, it is c++ Compiling .
4. compile rediscd redis-5.0.3make
5. install redis, Also specify the directory make install PREFIX=/usr/local/redis
6. The front desk starts rediscd /usr/local/redis/bin/./redis-server
7. Background start redis
① from redis Copy in the unzipped directory of redis.conf File to redis Of the installation directory bin Under the folder :cp /root/redis-5.0.3/redis.conf /usr/local/redis/bin/
② modify redis.conf The contents of the document vi /usr/local/redis/bin/redis.conf
- In the file daemonize Attribute to yes( Indicates the need to run in the background ), Comment out
bind 127.0.0.1, there bind It means that only the specified network segment can remotely access this redis, When the notes are off , There is no such limitation . #requirepass foobaredHere, it is adjusted according to the configuration of the project , My current project configuration redis The password is 123456, So I changed it here torequirepass 123456.
③ Start after modification redis ./redis-server redis.conf
8. Set the boot to start redis
① edit redis.service file vi /etc/systemd/system/redis.service
Copy the following code in , Be careful ExecStart The value of is the previous installation path .
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
② Set up self start systemctl daemon-reloadsystemctl start redis.servicesystemctl enable redis.service
And then in /usr/bin/redis Set one under the directory redis-cli Soft link of file ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis
Common commands - Service operation command
# start-up redis service
systemctl start redis.service
# stop it redis service
systemctl stop redis.service
# Restart the service
systemctl restart redis.service
# View the current status of the service
systemctl status redis.service
# Set power on self start
systemctl enable redis.service
# Stop power on and start up
systemctl disable redis.service
边栏推荐
- Welfare | Hupu isux11 Anniversary Edition is limited to hand sale!
- Common routines of compressed packets in CTF
- ~90z axis translation
- Market trend report, technical dynamic innovation and market forecast of China's low gloss instrument
- Research Report on the overall scale, major manufacturers, major regions, products and applications of hollow porcelain insulators in the global market in 2022
- Share the easy-to-use fastadmin open source system - Installation
- Golang string segmentation
- Internal/validators js:124 throw new ERR_ INVALID_ ARG_ Type (name, 'string', value) -- solution
- Who do you want to open a stock account? Is it safe to open a mobile account?
- MySQL learning record (3)
猜你喜欢

MySQL learning record (7)

D4:非成对图像去雾,基于密度与深度分解的自增强方法(CVPR 2022)

How does esrally perform simple custom performance tests?

MySQL learning record (5)

Go language learning summary (5) -- Summary of go learning notes
![The web version of xshell supports FTP connection and SFTP connection [detailed tutorial] continued from the previous article](/img/8f/6759b4685a129f9d10d6ea1dc8e61e.jpg)
The web version of xshell supports FTP connection and SFTP connection [detailed tutorial] continued from the previous article
![[shutter] statefulwidget component (create statefulwidget component | materialapp component | scaffold component)](/img/04/4070d51ce8b7718db609ef2fc8bcd7.jpg)
[shutter] statefulwidget component (create statefulwidget component | materialapp component | scaffold component)

Today, I met a Alipay and took out 35K. It's really sandpaper to wipe my ass. it's a show for me

Huawei Hongmeng watch achieves fireworks display effect on New Year's Eve

MySQL learning record (9)
随机推荐
Huawei Hongmeng watch achieves fireworks display effect on New Year's Eve
Accounting regulations and professional ethics [18]
I drew a Gu ailing with characters!
Redis分布式锁故障,我忍不住想爆粗...
MySQL learning notes (Advanced)
Research Report on market supply and demand and strategy of China's right-hand outward rotation entry door industry
Record the problems encountered by nodejs asynchronism
Research Report on micro gripper industry - market status analysis and development prospect prediction
Welfare, let me introduce you to someone
Capacity expansion mechanism of ArrayList
How is LinkedList added?
Check the confession items of 6 yyds
kernel_ uaf
Research Report on crude oil tanker industry - market status analysis and development prospect forecast
treevalue——Master Nested Data Like Tensor
Longest public prefix of leetcode
Hot backup routing protocol (HSRP)
Number of DP schemes
Structured text language XML
[shutter] statefulwidget component (bottom navigation bar component | bottomnavigationbar component | bottomnavigationbaritem component | tab switching)