zoukankan      html  css  js  c++  java
  • MAC 配置Redis开机启动

    一,创建.plist文件

    sudo vim /Library/LaunchDaemons/io.redis.redis-server.plist

    添加配置文件  

    /usr/local/redis-6.0.9/redis.conf 对应你自己的安装目录
    <?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>Label</key>
        <string>io.redis.redis-server</string>
        <key>ProgramArguments</key>
        <array>
            <string>/usr/local/bin/redis-server</string>
            <string>/usr/local/redis-6.0.9/redis.conf</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    </dict>
    </plist>

    二,将文件载入到launchd里

    sudo launchctl load /Library/LaunchDaemons/io.redis.redis-server.plist  

    启动命令

    sudo launchctl start io.redis.redis-server 

    关闭命令

    sudo launchctl stop io.redis.redis-server

    设置别名:

    alias redisstart='sudo launchctl start io.redis.redis-server'
    alias redisstop='sudo launchctl stop io.redis.redis-server'
  • 相关阅读:
    HDU 4389 X mod f(x)
    SRM 400(1-250pt, 1-500pt)
    FZU 2113 Jason的特殊爱好
    POJ 3208 Apocalypse Someday
    HDU 4734 F(x)
    HDU 3555 Bomb
    HDU 2089 不要62
    poj2488(A Knight's Journey)
    poj3267(The Cow Lexicon)
    poj2513(Colored Sticks)
  • 原文地址:https://www.cnblogs.com/qingjiawen/p/14364738.html
Copyright © 2011-2022 走看看