Wednesday, February 22, 2012

How to: install and test Redis on centos 5

Redis is a lightweight key-value data store.  in terms of the key-value support, it offers several popular data collection types. let’s test it quickly. or check it here for the real tutorial ,

Download the source code,

tar xvf redis-2.4.8.tar.gz
cd redis-2.4.8

If you don’t have the C compiler, try yum install gcc to install the compiler. this may take a while, C has a lot libs/headers to download and update.
BY default, Redis pick up the port 6379, you can find it in the redis.conf setting,
then start the service ‘src/redis-server redis.conf’ which will run in forground by default.

you can change the settings in redis.conf by change demonize:yes, it will run in background.
you can tell the port 6379 is picked up the redis,


Now we can run the CLI client of redis, src/redis-cli

Here is the helloword test, set one key  with one value as string,

We also can define a TTL for this key by put a expire keyword, it will disappear in 120 seconds


then some other collection data types, like Hash
Check whether a key exists
get keys and values,

then we can use a C# app to do the same thing,

No comments:

Locations of visitors to this page