一、关系型数据库和非关系型数据库
二、redis介绍
三、redis命令
四、安装redis
1.关闭防火墙和核心防护
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
2.安装redis
yum install -y gcc gcc-c++ make
cd /opt
tar zxvf /opt/redis-7.0.9.tar.gz -C /opt/
#由于Redis源码包中直接提供了 Makefile 文件,所以在解压完软件包后,
不用先执行 ./configure 进行配置,可直接执行 make 与 make install 命令进行安装。
cd /opt/redis-7.0.9
make
make PREFIX=/usr/local/redis install
#执行软件包提供的 install_server.sh 脚本文件设置 Redis 服务所需要的相关配置文件
cd /opt/redis-5.0.7/utils
./install_server.sh
...... #一直回车
Please select the redis executable path [] /usr/local/redis/bin/redis-server
#需要手动输入 /usr/local/redis/bin/redis-server ,注意要一次性正确输入
3.把redis的可执行程序文件放入路径环境变量的目录中便于系统识别
ln -s /usr/local/redis/bin/* /usr/local/bin/
4.当 install_server.sh 脚本运行完毕,Redis 服务就已经启动,默认监听端口为 6379
netstat -natp | grep redis
5.修改配置 /etc/redis/6379.conf 参数
vim /etc/redis/6379.conf
#70行,添加 监听的主机地址
bind 127.0.0.1 192.168.10.23
6.使配置文件生效
/etc/init.d/redis_6379 restart
redis-cli -h host -p port -a password 进入命令行