Mac设置redis开机自启动

编程

1.cd /Library/LaunchDaemons

2.sudo vim com.redis.plist

# 在文件中写入

<?xmlversion="1.0"encoding="UTF-8"?>

<!DOCTYPEplist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plistversion="1.0">

<dict>

        <key>Label</key>

        <string>com.redis</string>

        <key>RunAtLoad</key>

        <true/>

        <key>ProgramArguments</key>

        <array>

                <string>/usr/local/bin/redis-server</string>

                <string>/etc/redis.conf</string>

        </array>

</dict>

</plist>

3.sudo launchctl load /Library/LaunchDaemons/com.redis.plist

4.sudo launchctl start com.redis

以上是 Mac设置redis开机自启动 的全部内容, 来源链接: utcz.com/z/512775.html

回到顶部