Centos7 安装 redis

版权声明:原创文章欢迎转载,不过要记得加出处哦 https://blog.csdn.net/wljk506/article/details/82533209

安装 Centos7

配置IP

https://blog.csdn.net/fenglailea/article/details/12191607
根据上面案例配置出IP和DNS

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=a131caf0-525b-459a-9520-f1d29998a22c
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.125.133
GATEWAY=192.168.125.1
NETMASK=255.255.255.0
PREFIX=24
DNS1=114.114.114.114
DNS2=8.8.8.8

关闭防火墙

这里是内网测试,所以不涉及到安全问题,这里防火墙全部关闭

systemctl stop firewalld            #关闭
systemctl disable firewalld         #开机禁用

安装基础配置

yum -y update

#安装最新版redis
yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum --enablerepo=remi install redis

查看版本

redis-cli --version

查看安装时创建的文件

rpm -ql redis

输出

/etc/logrotate.d/redis
/etc/redis-sentinel.conf
/etc/redis.conf
/etc/systemd/system/redis-sentinel.service.d
/etc/systemd/system/redis-sentinel.service.d/limit.conf
/etc/systemd/system/redis.service.d
/etc/systemd/system/redis.service.d/limit.conf
/usr/bin/redis-benchmark
/usr/bin/redis-check-aof
/usr/bin/redis-check-rdb
/usr/bin/redis-cli
/usr/bin/redis-sentinel
/usr/bin/redis-server
/usr/lib/systemd/system/redis-sentinel.service
/usr/lib/systemd/system/redis.service
/usr/lib64/redis
/usr/lib64/redis/modules
/usr/libexec/redis-shutdown
/usr/share/licenses/redis-4.0.11
/usr/share/licenses/redis-4.0.11/COPYING
/usr/share/man/man1/redis-benchmark.1.gz
/usr/share/man/man1/redis-check-aof.1.gz
/usr/share/man/man1/redis-check-rdb.1.gz
/usr/share/man/man1/redis-cli.1.gz
/usr/share/man/man1/redis-sentinel.1.gz
/usr/share/man/man1/redis-server.1.gz
/usr/share/man/man5/redis-sentinel.conf.5.gz
/usr/share/man/man5/redis.conf.5.gz
/var/lib/redis
/var/log/redis
/var/run/redis

编辑配置文件,开启远程访问

vim /etc/redis.conf

bind 127.0.0.1改成 bind 0.0.0.0

启动redis

systemctl start redis.service 

开启开机启动 redis

systemctl enable redis.service 

来源
https://www.cnblogs.com/autohome7390/p/6433956.html

阅读更多

扫码向博主提问

风来了-

非学,无以致疑;非问,无以广识
  • 擅长领域:
  • php
  • java
  • go
  • 架构
  • more
去开通我的Chat快问
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页