1.安装

1  wget https://download.redis.io/releases/redis-6.0.9.tar.gz
2  tar xzf redis-6.0.9.tar.gz
3  cd redis-6.0.9
4  make
5  make install PREFIX=/usr/local/redis

2.管理配置文件

1  mkdir /usr/local/redis/conf
2  cp redis.conf /usr/local/redis/conf/

编辑redis.conf文件

cd /usr/local/redis/conf
1 //后台运行
2 daemonize yes
3 //注释掉
4 bind 127.0.0.1  
5 //关闭受保护模式
6 protected-mode no
7 //设置密码
8 requirepass qwer1234.0

3.开机启动文件

vi /etc/systemd/system/redis.service
[Unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf
PrivateTmp=true

[Install]
WantedBy=multi-user.target
systemctl enable redis.service

4.启动

systemctl start redis.service

 5.测试

netstat -lntp|grep 6379

Centos8安装Redis

相关文章:

  • 2021-07-12
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-01-01
  • 2021-10-21
  • 2021-05-16
猜你喜欢
  • 2021-10-16
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案