Transferred from: http://blog.csdn.net/gebitan505/article/details/17076333
1. Access to Redis source code
Http://redis.io
2. Unzip, set permissions
3.make & make install (optional, if install is executed, REDIS-SERVER,REDIS-CLI will be generated into/usr/local/bin)
4. Copy the key files to the target directory
# CP redis.conf/etc/
# CD SRC
# CP Redis-benchmark REDIS-CLI redis-server/usr/bin/
5. Start the service and verify
After starting Redis, we see a warning message and we follow the prompts to
vm.overcommit_memory = 1
Append to
/etc/sysctl.conf
End of File and execute
sysctl Vm.overcommit_memory=1
Command
Restart Redis, no more warnings, everything OK:
Verify the startup status, everything is OK:
6. Simple test with Telnet
Use Telnet to connect to Redis and perform a simple command to test.
Note: To open a new window, just the server window is running Redis-server
The following is a simple command to test (note: Here the SET command format is set key value ) (you can also use the REDIS-CLI set Key1 value1 to set the key/value pair)
7. Close the service
The Redis Server service can be shut down by command redis-cli shutdown (you can also use Redis-cli-p 6397 shutdown off)
After the command is executed, the server window displays:
Attached: Redis boot: redis-server/etc/redis.conf using: redis-cli client or telnet localhost 6379 OFF: Use shutdown in the REDIS-CLI client to turn off the Redis service or use the kill-9 PID