redis cannot boot automatically
macos version: 10.13.6
redis version: 4.0.11
redis is installed by compilation (not brew)
through online tutorials, I edited com.redis.plist
/ Library/LaunchDaemons
.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>com.redis</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/redis-server</string>
<string>/Users/me/conf/redis/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Users/me/conf/redis</string>
<key>StandardErrorPath</key>
<string>/Users/me/conf/redisError.log</string>
<key>StandardOutPath</key>
<string>/Users/me/conf/redisStandardOut.log</string>
</dict>
</plist>
in this file directory, I ran the following command:
launchctl load com.redis.plis
launchctl start com.redis
there is no error message (the same is true for sudo). Check the redis log file:
2044:C 03 Nov 22:08:20.366 -sharp oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
2044:C 03 Nov 22:08:20.366 -sharp Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=2044, just started
2044:C 03 Nov 22:08:20.366 -sharp Configuration loaded
This is the end of . All I can confirm is that there are no errors in the paths of redis-server
and redis.conf
. I can start normally when I copy the command to shell:
> /usr/local/bin/redis-server /Users/me/conf/redis/redis.conf
-sharplog:
2050:C 03 Nov 22:09:18.529 -sharp oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
2050:C 03 Nov 22:09:18.530 -sharp Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=2050, just started
2050:C 03 Nov 22:09:18.530 -sharp Configuration loaded
2051:M 03 Nov 22:09:18.532 * Increased maximum number of open files to 10032 (it was originally set to 256).
_._
_.-``__ ""-._
_.-`` `. `_. ""-._ Redis 4.0.11 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ""-._
( " , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|"` _.-"| Port: 6379
| `-._ `._ / _.-" | PID: 2051
`-._ `-._ `-./ _.-" _.-"
|`-._`-._ `-.__.-" _.-"_.-"|
| `-._`-._ _.-"_.-" | http://redis.io
`-._ `-._`-.__.-"_.-" _.-"
|`-._`-._ `-.__.-" _.-"_.-"|
| `-._`-._ _.-"_.-" |
`-._ `-._`-.__.-"_.-" _.-"
`-._ `-.__.-" _.-"
`-._ _.-"
`-.__.-"
2051:M 03 Nov 22:09:18.537 -sharp Server initialized
2051:M 03 Nov 22:09:18.538 * DB loaded from disk: 0.001 seconds
2051:M 03 Nov 22:09:18.538 * Ready to accept connections