Skip to content

Instantly share code, notes, and snippets.

@risyasin
Last active October 7, 2019 19:48
Show Gist options
  • Save risyasin/8215524f6765ad57465e8784983dbe30 to your computer and use it in GitHub Desktop.
Save risyasin/8215524f6765ad57465e8784983dbe30 to your computer and use it in GitHub Desktop.
<?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>EnvironmentVariables</key>
<dict>
<key>DATA_DIR</key>
<string>/usr/local/var/dgraph</string>
</dict>
<key>Label</key>
<string>io.dgraph.alpha</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/dgraph</string>
<string>alpha</string>
<string>--lru_mb</string>
<string>2048</string>
<string>--zero</string>
<string>localhost:5080</string>
<string>--logtostderr</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/dgraph-alpha-error.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/dgraph-alpha.log</string>
<key>WorkingDirectory</key>
<string>/usr/local/var/dgraph</string>
</dict>
</plist>
<?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>EnvironmentVariables</key>
<dict>
<key>DATA_DIR</key>
<string>/usr/local/var/dgraph</string>
</dict>
<key>Label</key>
<string>io.dgraph.ratel</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/dgraph-ratel</string>
<string>-port</string>
<string>8000</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/dgraph-ratel-error.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/dgraph-ratel.log</string>
<key>WorkingDirectory</key>
<string>/usr/local/var/dgraph</string>
</dict>
</plist>
<?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>EnvironmentVariables</key>
<dict>
<key>DATA_DIR</key>
<string>/usr/local/var/dgraph</string>
</dict>
<key>Label</key>
<string>io.dgraph.zero</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/dgraph</string>
<string>zero</string>
<string>--logtostderr</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/dgraph-zero-error.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/dgraph-zero.log</string>
<key>WorkingDirectory</key>
<string>/usr/local/var/dgraph</string>
</dict>
</plist>
@risyasin
Copy link
Author

risyasin commented Oct 7, 2019

Create necessary files and directories:
mkdir /usr/local/var/dgraph
touch /usr/local/var/log/dgraph-{zero,alpha,ratel}.log
touch /usr/local/var/log/dgraph-{zero,alpha,ratel}-error.log

Run via launchctl (or lunchy)
launchctl start -w io.dgraph.zero
launchctl start -w io.dgraph.alpha
launchctl start -w io.dgraph.ratel

For diagnostics:
syslog -w
tail -f /usr/local/var/log/dgraph-*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment