1、获取资源
wget https://download.redis.io/releases/redis-6.0.8.tar.gz
2、解压
tar -zxvf redis-6.0.8.tar.gz
3、安装
cd redis-6.0.8
make
cd src
make install PREFIX=/usr/local/redis
4、移动配置文件到安装目录
cd ../
mkdir /usr/local/redis/etc
mv redis.conf /usr/local/redis/etc
5、修改配置,支持台启动和远程连接
daemonize yes
protected-mode no
bind 0.0.0.0
6、拷贝启动脚本至 /usr/local/bin目录
cp /usr/local/redis/bin/redis-server /usr/local/bin
cp /usr/local/redis/bin/redis-cli /usr/local/bin
7、启动
redis-server /usr/local/redis/etc/redis.conf
8、启动客户端
redis-cli
9、设置密码
config set requirepass ****
10、测试
127.0.0.1:6379> set test hello-redis OK 127.0.0.1:6379> get test "hello-redis"
|