当前位置:网站首页>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
边栏推荐
- MySQL learning record (3)
- Accounting regulations and professional ethics [19]
- Record the problems encountered by nodejs asynchronism
- [error record] the command line creates an error pub get failed (server unavailable) -- attempting retry 1 in 1 second
- [shutter] statefulwidget component (pageview component)
- Cloud computing technology [2]
- Backpack template
- MySQL learning record (9)
- Lantern Festival, come and guess lantern riddles to win the "year of the tiger Doll"!
- Accounting regulations and professional ethics [16]
猜你喜欢

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

MySQL learning record (4)

Welfare, let me introduce you to someone

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

kernel_ uaf

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

Check the confession items of 6 yyds

Baidu sued a company called "Ciba screen"
![[hands on deep learning]02 softmax regression](/img/47/eb67ec2c51f6bb7d6b2879b36e769d.jpg)
[hands on deep learning]02 softmax regression

It is said that this year gold three silver four has become gold one silver two..
随机推荐
Micro SD Card Industry Research Report - market status analysis and development prospect forecast
MySQL learning record (3)
[fluent] dart generic (generic class | generic method | generic with specific type constraints)
A river of spring water flows eastward
kernel tty_ struct
Go cache of go cache series
Research Report on minimally invasive medical robot industry - market status analysis and development prospect prediction
Makefile: usage of control functions (error, warning, info)
Research Report on market supply and demand and strategy of China's Plastic Geogrid industry
Analysis of enterprise financial statements [4]
Share the easy-to-use fastadmin open source system - Installation
Longest public prefix of leetcode
Customized Huawei hg8546m restores Huawei's original interface
Report on investment development and strategic recommendations of China's vibration isolator market, 2022-2027
Chinese Indian seasoning market trend report, technical dynamic innovation and market forecast
MySQL learning notes (Advanced)
Research Report on the overall scale, major manufacturers, major regions, products and applications of micro hydraulic cylinders in the global market in 2022
China plastic bottle and container market trend report, technological innovation and market forecast
Number of DP schemes
The web version of xshell supports FTP connection and SFTP connection [detailed tutorial] continued from the previous article