Mac 10.14.3 Memcached

安装

brew install memcached

修改参数

<?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>homebrew.mxcl.memcached</string>
  <key>KeepAlive</key>
  <true/>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/memcached/bin/memcached</string>
    <string>-l</string>
    <string>0.0.0.0</string>
    <string>-p</string>
    <string>12306</string>
    <string>-m</string>
    <string>2048</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/usr/local</string>
</dict>
</plist>

主要看配置中的

<string>/usr/local/opt/memcached/bin/memcached</string>
    <string>-l</string>
    <string>0.0.0.0</string>
    <string>-p</string>
    <string>12306</string>
    <string>-m</string>
    <string>2048</string>

-p : 指定端口号
-m : 限制内存

启动服务

brew services start memcached

查看进程

ps aux|grep memcached

--- 进程结果 -----
silver 84530 0.0 0.0 4285688 1904 ?? S 4:24下午 0:00.03 /usr/local/opt/memcached/bin/memcached -l 0.0.0.0 -p 12306 -m 2048

相关推荐