1. Download, unzip, rename and compile the Redis installation
wget http://download.redis.io/releases/redis-3.0.5.tar.gz
Tar xzf redis-3.0.5.tar.gz
MV redis-3.0.5 Redis
MV redis/usr/
Cd/usr/redis
Make
Make Test
Make install
2. Specify the location where the data files are saved
The Redis unzip directory has a profile redis.conf, edit this configuration file, and locate dir./This line. Redis writes the In-memory data to a file, and this configuration is the path to the specified data file save.
3. Start the service side
cp/usr/redis/redis.conf/usr/local/etc/
/usr/local/bin/redis-server/usr/local/etc/redis.conf
4. Testing the Client
Redis-cli
5. Automatically start Redis server
sudo vi/library/launchdaemons/io.redis.redis-server.plist
The contents are as follows
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE plist Public "-//apple computer//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/etc/redis.conf</string>
</array>
<key>RunAtLoad</key><true/> </dict>
</plist>
sudo launchctl load/library/launchdaemons/io.redis.redis-server.plist
sudo launchctl start io.redis.redis-server
sudo launchctl stop Io.redis.redis-server
MacOS installation Redis