redis 认证密码

时间:2022-11-23 18:42:08
[root@cache01 ~]# grep "requirepass" /app/server/redis/conf/6379.conf
# If the master is password protected (using the "requirepass" configuration
# requirepass foobared
requirepass bass #主服务器上的认证密码 [root@cache01 ~]# vi /app/server/redis/conf/
6379.conf 6379.conf.bak dump.rdb
[root@cache01 ~]# vi /app/server/redis/conf/6379.conf
[root@cache01 ~]# service redis stop
Stopping ...
Redis stopped
[root@cache01 ~]# service redis start
Starting Redis server...
[root@cache01 ~]# /app/server/redis/bin/redis-cli
127.0.0.1:6379> set name 123456
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth bass
OK
127.0.0.1:6379>