一、软件仓库的更新与安装Redis
sudo apt-get install update
sudo apt-get install redis-server
注:若报错找不到安装包则运行 sudo apt-get update
安装后检查Redis系统进程与服务状态
ps -aux|grep redis
netstat -nlt|grep 6379
二、进入Redis数据库并操作
redis-cli # 进入redis数据库
set key1 'hello word' # 增加一条记录key: 'hello word'
get key1 # 查看记录
三、添加验证密码和允许远程访问
1.设置访问密码(注释并将foobared修改成你要的密码,如:123456)
sudo vi /etc/redis/redis.conf
# requirepass foobared
requirepass 123456
2.放通外网访问(注释掉r