配置文件详解
[123456@localhost Desktop]$ redis-server /etc/redis/redis.conf
[123456@localhost Desktop]$ redis-cli
得到啟動Redis的路徑
127.0.0.1:6379> config get dir
1) "dir"
2) "/home/123456/Desktop"
得到requirepass
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) ""
給requirepass設置密碼,鎖住redis服務
127.0.0.1:6379> config set requirepass "123456"
OK
127.0.0.1:6379> ping
(error) NOAUTH Authentication required.
auth+密碼之后開啟redis服務
127.0.0.1:6379> auth 123456
OK
volatile-lru:使用LRU算法移除key,只對設置了過期時間的鍵
allkeys-lru:使用LRU算法移除key
volatile-random:在過期集合中移除隨機的key,只對設置了過期時間的鍵
allkeys-random:移除隨機的key
volatile-ttl:移除那些TTL值最小的key,即那些最近要過期的key
noeviction:不進行移除。針對寫操作,只是返回錯誤信息
轉載于:https://www.cnblogs.com/mxf97826/p/8707969.html
總結
- 上一篇: 【原创】论码农的财富修养
- 下一篇: Java中序列化的好处及意义