我的虚拟机上安装了redis,有一段时间没用了。(上次我使用它,它确实有效,但现在它没有......在那段时间(大约一个月)没有任何改变)。不用说我很困惑,但我会尽可能多地发布信息。
$ redis-server
服务器启动,但会发出关于过度使用内存设置为 0 的警告。我在虚拟机上,所以如果我愿意,我无法将此设置从 0 更改为 1,无论如何我都不想这样做。不过,我已经编写了一个自定义redis.config
文件,我希望它使用(并且我过去使用过),因此使用默认配置文件启动它对我没有多大好处。让我们再试一次。
$ redis-server redis.config
$
没有什么。安静。没有错误信息,只是没有启动。
$ nohup redis-server redis.config > nohup.out&
我得到一个进程 ID,但随后$ ps
我看到该进程被列为stop
并很快消失。同样,没有错误,nohup.out 和 redis 的日志文件中也没有输出。下面是我正在使用的 redis.config(没有注释以保持简短)
daemonize yes
pidfile [my-user-account-path]/redis/redis.pid
port 0
bind 127.0.0.1
unixsocket [my-user-account-path]/tmp/redis.sock
unixsocketperm 770
timeout 10
tcp-keepalive 60
loglevel warning
logfile [my-user-account-path]/redis/logs/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error no
rdbcompression no
rdbchecksum no
dbfilename dump.rdb
dir [my-user-account-path]/redis/db
slave-serve-stale-data yes
slave-priority 100
appendonly no
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
# ADVANCED CONFIG is set to all default settings#
我敢肯定这可能是愚蠢的,甚至可能是某个地方的权限问题(我尝试以 root 身份执行此操作,仅供参考),但无济于事。任何人都经历过与 Redis 类似的事情吗?