Redis安装

下载Redis安装包并解压

在 /opt/soft 内下载redis-5.0.5

wget -c wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar zxvf mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz -C /opt/module/

解压完之后, /opt/module/ ⽬录中会出现⼀个 redis-5.0.5的⽬录

编译并安装

make && make install

将Redis 安装为系统服务并后台启动

 cd utils/
 ./install_server.sh

设置允许远程连接与访问密码

vim /etc/redis/6379.conf
# 找到
bind 127.0.0.1 
# 修改为 
bind 0.0.0.0

# 找到
requirepass foobared 
# 去掉注释,将 foobared 修改为⾃⼰想要的密码,保存即可。
requirepass password
# 然后重启
systemctl restart redis_6379.service

检验安装结果

systemctl status redis_6379.service
# 用 ⾃带的 redis-cli 客户端,测试是否成功
cd utils
redis-cli
-------------------------------------------------
127.0.0.1:6379> set aaa k
OK
127.0.0.1:6379> get aaa
"k"
127.0.0.1:6379> exit
posted @ 2020-05-23 00:47  aaaak  阅读(193)  评论(0编辑  收藏  举报