来源linusconfig网站
一、客户端安装
1、sudo apt install redis-tools
2、redis-cli -h hostname
客户端安装后,就可以通过redis-cli命令远程连接到redis服务器了
二、服务端安装
1、suao apt install redis
2、redis-server -v
3、ss -nlt 默认端口6379
sudo systemctl disable redis-server
sudo systemctl enable redis-server
默认redis服务器监听地址为127.0.0.1 如果需要修改,配置文件在/etc/redis/redis.conf。
将bind 127.0.0.1 ::1 这行注释掉。
然后,如果需要远程连接redis,需要关闭保护模式。
修改protected-mode yes 为 no
修改后,需要重启启动redis服务器
service redis-server restart