当前位置:网站首页>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.3
make
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 foobared
Here, 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-reload
systemctl start redis.service
systemctl 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
边栏推荐
- [12] the water of the waves is clear, which can wash my tassel. The water of the waves is muddy, which can wash my feet
- [shutter] statefulwidget component (create statefulwidget component | materialapp component | scaffold component)
- What is the difference between programming in real work and that in school?
- [shutter] statefulwidget component (floatingactionbutton component | refreshindicator component)
- Construction and maintenance of business websites [10]
- Don't you want to have a face-to-face communication with cloud native and open source experts? (including benefits
- 股票开户要找谁?手机开户是安全么?
- The web version of xshell supports FTP connection and SFTP connection
- Welfare, let me introduce you to someone
- Construction and maintenance of business website [1]
猜你喜欢
treevalue——Master Nested Data Like Tensor
kernel_ uaf
[shutter] statefulwidget component (bottom navigation bar component | bottomnavigationbar component | bottomnavigationbaritem component | tab switching)
Write the content into the picture with type or echo and view it with WinHex
Basic knowledge of tree and binary tree (detailed illustration)
[shutter] shutter layout component (opacity component | clipprect component | padding component)
[dynamic planning] p1220: interval DP: turn off the street lights
[shutter] shutter layout component (Introduction to layout component | row component | column component | sizedbox component | clipoval component)
MySQL learning record (8)
rwctf2022_ QLaaS
随机推荐
~90z axis translation
Redis分布式锁故障,我忍不住想爆粗...
Write the content into the picture with type or echo and view it with WinHex
Check the confession items of 6 yyds
Research Report on market supply and demand and strategy of China's plastic trunking industry
This team with billions of data access and open source dreams is waiting for you to join
Research Report on the overall scale, major manufacturers, major regions, products and applications of building automation power meters in the global market in 2022
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of signal distributors in the global market in 2022
如何防止你的 jar 被反编译?
[shutter] shutter layout component (Introduction to layout component | row component | column component | sizedbox component | clipoval component)
Redis -- three special data types
Structured text language XML
Analysis of enterprise financial statements [1]
How does esrally perform simple custom performance tests?
[fluent] dart technique (independent main function entry | nullable type determination | default value setting)
Makefile: usage of control functions (error, warning, info)
Construction and maintenance of business website [1]
Micro SD Card Industry Research Report - market status analysis and development prospect forecast
Research Report on market supply and demand and strategy of China's Plastic Geogrid industry
Unexpectedly, there are such sand sculpture code comments! I laughed