Redis installation Configuration

Source: Internet
Author: User
Tags redis download install redis

RedisIs a key-value storage system. Similar to memcached, But it solves the problem that data is completely lost after power-off, and she supports more undefined value types. Besides string, it also supports lists (linked list), sets, and zsets. These data types support push/pop, Add/Remove, Intersection Set and difference set, and more abundant operations, and these operations are atomic.

Redis Code follows the ANSI-C and can be written in all POSIX systems (such as Linux,*BSD, Mac OS X, Solaris, etc. In addition, redis does not rely on any non-standard library, nor does it need to add compilation parameters. The installation of apsaradb for redis is surprisingly simple, which may be one of the reasons why it is popular and easy to use.


1 download

: Redis download, latest stable edition redis-2.6.9.tar.gz

Document: redis document

2 Installation

$ wget http://redis.googlecode.com/files/redis-2.6.9.tar.gz$ tar xzf redis-2.6.9.tar.gz$ cd redis-2.6.9$ make

3 command

1) Start the server

Src/redis-server redis. conf

2) Enable the client

Src/redis-cli

3) test command

Redis 127.0.0.1: 6379> set myname "Yanggang"
OK
Redis 127.0.0.1: 6379> Get myname
"Yanggang"
Redis 127.0.0.1: 6379> set myblog "http://blog.csdn.net/sunboy_2050"
OK
Redis 127.0.0.1: 6379> Get myblog
Http://blog.csdn.net/sunboy_2050"

4 client Programming

Code:

import redis.clients.jedis.Jedis;public class JedisTest {public static void main(String[] args) {Jedis jedis = new Jedis("localhost");jedis.set("foo", "bar");String value = jedis.get("foo");System.out.print("foo's value : " + value);}}

Running result:

Foo's value: bar

Getting started with redis

Introduction to redis installation and configuration (recommended)

Install redis and configure master-slave Replication

Redis memcache Performance Comparison

Essential differences between memcache and redis

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.