Install Redis under Ubuntu12.10 (graphic explanation) + Jedis to connect to Redis. To ensure that the permissions are correct, perform the following operations with the root account. 1. Obtain the redis source code wgethttp: // response
Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis
To ensure that the permissions are correct, use the root account to perform the following operations.
1. Obtain the redis source code
Wgethttp: // redis.googlecode.com/files/redis-2.2.13.tar.gz
2. decompress and Set permissions.
Copy the decompressed and configured redis directory to the user directory/home/grid (personal habits, do not have to imitate)
3. make & make install
First, execute:
Root @ slavenode1:/home/grid/redis # make
Then execute:
Root @ slavenode1:/home/grid/redis # sudo make install
4. Copy key files to the target directory
Root @ slavenode1:/home/grid/redis # cp redis. conf/etc/
Root @ slavenode1:/home/grid/redis # cd src
Root @ slavenode1:/home/grid/redis/src # cp redis-benchmark redis-cli redis-server/usr/bin/
Root @ slavenode1:/home/grid/redis/src #
5. Start and verify the service
After starting redis, a warning message is reported.
Vm. overcommit_memory = 1
Append
/Etc/sysctl. conf
At the end of the file and execute
Sysctl vm. overcommit_memory = 1
Command
Restart redis without warning. Everything is OK:
Verify the startup status. Everything is normal:
6. Simple telnet Test
Use telnet to connect to redis and execute simple commands for testing.
Note: a new window is required. The server window is running redis-server.
As shown in, when you connect to redis via telnet, the server window displays the following information:
[3523] 21 Jan 23:33:50-Accepted 127.0.0.1: 42711
Run the following simple command to perform the test (Note: The set command format here is set key value, which is slightly different from that demonstrated by the teacher. The reason is unknown ...):
Set/get setex
Lpush rpush lrange
7. Disable the service
Use commandsRedis-clishutdownYou can disable the redis server service.
After the command is executed, the server window displays:
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2