]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
3 | <html> | |
4 | <head> | |
5 | <link type="text/css" rel="stylesheet" href="style.css" /> | |
6 | </head> | |
7 | <body> | |
8 | <div id="page"> | |
9 | ||
10 | <div id='header'> | |
11 | <a href="index.html"> | |
12 | <img style="border:none" alt="Redis Documentation" src="redis.png"> | |
13 | </a> | |
14 | </div> | |
15 | ||
16 | <div id="pagecontent"> | |
17 | <div class="index"> | |
18 | <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. --> | |
19 | <b>QuickStart: Contents</b><br> <a href="#Obtain the latest version">Obtain the latest version</a><br> <a href="#Compile">Compile</a><br> <a href="#Run the server">Run the server</a><br> <a href="#Play with the built in client">Play with the built in client</a><br> <a href="#Further reading">Further reading</a> | |
20 | </div> | |
21 | ||
22 | <h1 class="wikiname">QuickStart</h1> | |
23 | ||
24 | <div class="summary"> | |
25 | ||
26 | </div> | |
27 | ||
28 | <div class="narrow"> | |
29 | = Quick Start =<br/><br/>This quickstart is a five minutes howto on how to get started with Redis. For more information on Redis check <a href="http://code.google.com/p/redis/wiki/index" target="_blank">Redis Documentation Index</a>.<h2><a name="Obtain the latest version">Obtain the latest version</a></h2>The latest stable source distribution of Redis can be obtained <a href="http://code.google.com/p/redis/downloads/list" target="_blank">at this location as a tarball</a>.<br/><br/><pre class="codeblock python" name="code"> | |
30 | $ wget http://redis.googlecode.com/files/redis-1.02.tar.gz | |
31 | </pre>The unstable source code, with more features but not ready for production, can be downloaded using git:<br/><br/><pre class="codeblock python python" name="code"> | |
32 | $ git clone git://github.com/antirez/redis.git | |
33 | </pre><h2><a name="Compile">Compile</a></h2>Redis can be compiled in most <a href="SupportedPlatforms.html">POSIX systems</a>. To compile Redis just untar the tar.gz, enter the directly and type 'make'.<br/><br/><pre class="codeblock python python python" name="code"> | |
34 | $ tar xvzf redis-1.02.tar.gz | |
35 | $ cd redis-1.02 | |
36 | $ make | |
37 | </pre>In order to test if the Redis server is working well in your computer make sure to run <code name="code" class="python">make test</code> and check that all the tests are passed.<h2><a name="Run the server">Run the server</a></h2>Redis can run just fine without a configuration file (when executed without a config file a standard configuration is used). To run Redis just type the following command:<br/><br/><pre class="codeblock python python python python" name="code"> | |
38 | $ ./redis-server | |
39 | </pre>With the <a href="Configuration.html">default configuration</a> Redis will log to the standard output so you can check what happens. Later, you can <a href="Configuration.html">change the default settings</a>.<h2><a name="Play with the built in client">Play with the built in client</a></h2>Redis ships with a command line client that is automatically compiled when you ran <code name="code" class="python">make</code> and it is called <code name="code" class="python">redis-cli</code>For instance to set a key and read back the value use the following:<br/><br/><pre class="codeblock python python python python python" name="code"> | |
40 | $ ./redis-cli set mykey somevalue | |
41 | OK | |
42 | $ ./redis-cli get mykey | |
43 | somevalue | |
44 | </pre>What about adding elements to a <a href="Lists.html">list</a>:<br/><br/><pre class="codeblock python python python python python python" name="code"> | |
45 | $ ./redis-cli lpush mylist firstvalue | |
46 | OK | |
47 | $ ./redis-cli lpush mylist secondvalue | |
48 | OK | |
49 | $ ./redis-cli lpush mylist thirdvalue | |
50 | OK | |
51 | $ ./redis-cli lrange mylist 0 -1 | |
52 | 1. thirdvalue | |
53 | 2. secondvalue | |
54 | 3. firstvalue | |
55 | $ ./redis-cli rpop mylist | |
56 | firstvalue | |
57 | $ ./redis-cli lrange mylist 0 -1 | |
58 | 1. thirdvalue | |
59 | 2. secondvalue | |
60 | </pre><h2><a name="Further reading">Further reading</a></h2><ul><li> What to play more with Redis? Read <a href="IntroductionToRedisDataTypes.html">Fifteen minutes introduction to Redis data types</a>.</li><li> Check all the <a href="Features.html">Features</a></li><li> Read the full list of available commands in the <a href="CommandReference.html">Command Reference</a>.</li><li> Start using Redis from your <a href="SupportedLanguages.html">favorite language</a>.</li><li> Take a look at some <a href="ProgrammingExamples.html">Programming Examples</a>. </li></ul> | |
61 | </div> | |
62 | ||
63 | </div> | |
64 | </div> | |
65 | </body> | |
66 | </html> | |
67 |