【错误方案 弃用 Redis__安装】Redis简单安装和使用

下载 redis-5.0.8.tar.gz
解压 tar zxvf redis-5.0.8.tar.gz
创建目录 mkdir /usr/local/java/redis
cd redis-5.0.8
拷贝配置文件 cp redis.conf /usr/local/java/redis
服务端启动 ./bin/redis-server
客户端使用
[root@bogon package]# cd /usr/local/java/redis
[root@bogon redis]# ./bin/redis-cli -a 123456
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> set a1 12
OK
127.0.0.1:6379> get a1
"12"
127.0.0.1:6379> 
redis.conf配置
# 关闭保护模式,用于公网访问
protected-mode no
port 6379
# 后台启动
daemonize yes
pidfile /var/run/redis_6379.pid
logfile "6379.log"
# dir ./
# bind 127.0.0.1
# 设置redis密码,各节点保持一致
requirepass 123456
posted @ 2020-06-19 20:25  一只桔子2233  阅读(134)  评论(0编辑  收藏  举报