daemonize yes
port 6379
bind 0.0.0.0
requirepass 123456
save 3600 1 300 100 60 10000
dir /usr/local/redis
dbfilename dump.rdb
logfile redis.log
pidfile redis.pid
##save 3600 1 300 100 60 10000
##3600秒(一小时),至少有一个值的话,会进行存盘
##300秒(五分钟),至少有一百个值的话,会进行存盘
##60秒,至少有一万个值的话,会进行存盘
redis安装命令
1.到src目录下make
2.make PREFIX=/redis install
/redis/bin/redis-server /usr/local/redis/redis.conf
[root@sq2355-20220517--1 redis]# /redis/bin/redis-cli
127.0.0.1:6379> ping
(error) NOAUTH Authentication required.
127.0.0.1:6379> AUTH 123456
OK
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set name zhangsan
OK
127.0.0.1:6379> set age 23
OK
127.0.0.1:6379> config get save
1) "save"
2) ""
127.0.0.1:6379> save
OK
redis启停脚本
vim stop.sh
-----
#!/bin/bash
export REDISCLI_AUTH=123456
/redis/bin/redis-cli SHUTDOWN
-----
chmod 777 stop.sh
vim start.sh
------
#!/bin/bash
/redis/bin/redis-server /usr/local/redis/redis.conf
-----
chmod 777 start.sh