在 redis.windows.conf 配置了notify-keyspace-events:
notify-keyspace-events "AKE"
但是 重啟redis 之后還是沒有反應, 還是不接收不到redis 事件,why?
后來發現 配置文件問題, redis-server.exe 啟動並不會加載 redis.windows.conf 或其他配置文件,而是默認的配置; 默認的配置在哪里? 估計是在redis-server.exe 程序里寫死的。
D:\devTool\redis3.2> redis-server.exe -h Usage: ./redis-server [/path/to/redis.conf] [options] ./redis-server - (read config from stdin) ./redis-server -v or --version ./redis-server -h or --help ./redis-server --test-memory <megabytes> Examples: ./redis-server (run the server with default conf) ./redis-server /etc/redis/6379.conf ./redis-server --port 7777 ./redis-server --port 7777 --slaveof 127.0.0.1 8888 ./redis-server /etc/myredis.conf --loglevel verbose Sentinel mode: ./redis-server /etc/sentinel.conf --sentinel
我本以為默認配置文件就是同目錄的 , 結果不是。。
是不是僅Windows是這樣, 其實linux 也是這樣, 看來還是需要指定具體的配置文件地址!