sudo apt-get update sudo apt-get install redis-server
编辑/etc/redis/redis.conf
/etc/redis/redis.conf
# 设置登录密码 # (取消注释) (设置密码为1234) requirepass 1234 # 允许远程访问 #bind 127.0.0.1
sudo /etc/init.d/redis-server restart
redis-cli -a 1234