Skip to content

Instantly share code, notes, and snippets.

@KFoxder
Last active November 28, 2016 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KFoxder/ca291c37e7022cdcdf233388fbacf795 to your computer and use it in GitHub Desktop.
Save KFoxder/ca291c37e7022cdcdf233388fbacf795 to your computer and use it in GitHub Desktop.

If you are migrating from an older version of redis that is outside your vagrant box then run this first so when your new DB is up it has the same info:

# Unloading should create a dump.rdb file in /usr/local/var/dump.rdb
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis28.plist

# Then uninstall redis28
brew uninstall redis28

Then:

cd ~
curl http://download.redis.io/releases/redis-3.2.4.tar.gz -o "redis-3.2.4.tar.gz"
tar xzf redis-3.2.4.tar.gz
cd redis-3.2.4
make test
make

# Move executables to bin and redis config
sudo mv ~/redis-3.2.4/src/redis-server /usr/local/bin
sudo mv ~/redis-3.2.4/src/redis-cli /usr/local/bin
sudo cp /sites/ycharts/confs/redis/redis.conf /usr/local/etc/redis.conf

# Start redis on launch
ln -sfv /sites/ycharts/confs/redis/ycharts.redis.plist ~/Library/LaunchAgents/ycharts.redis.plist

# Start redis now
launchctl load ~/Library/LaunchAgents/ycharts.redis.plist

# Use the redis cli with:
redis-cli
<?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>ycharts.redis</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/redis-server</string>
<string>/usr/local/etc/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/redis.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/redis.log</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment