Install Redis under Ubuntu12.10 (graphic explanation) + Jedis to connect to Redis

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.