]> git.saurik.com Git - redis.git/blame - README
Merge pull request #430 from anydot/f-testsuite
[redis.git] / README
CommitLineData
d3207647 1Where to find complete Redis documentation?
2-------------------------------------------
3
4This README is just a fast "quick start" document. You can find more detailed
3fb1c8a0 5documentation at http://redis.io
d3207647 6
7Building Redis
8--------------
9
10It is as simple as:
11
12 % make
13
d3207647 14You can run a 32 bit Redis binary using:
15
16 % make 32bit
17
3fb1c8a0 18After building Redis is a good idea to test it, using:
d3207647 19
20 % make test
21
3fb1c8a0
JO
22NOTE: if after building Redis with a 32 bit target you need to rebuild it
23 with a 64 bit target you need to perform a "make clean" in the root
24 directory of the Redis distribution.
25
26Allocator
27---------
28
a63a3d4d
PN
29Selecting a non-default memory allocator when building Redis is done by setting
30the `MALLOC` environment variable. Redis is compiled and linked against libc
31malloc by default, with the exception of jemalloc being the default on Linux
32systems. This default was picked because jemalloc has proven to have fewer
33fragmentation problems than libc malloc.
3fb1c8a0 34
a63a3d4d 35To force compiling against libc malloc, use:
3fb1c8a0 36
a63a3d4d 37 % make MALLOC=libc
3fb1c8a0 38
a63a3d4d 39To compile against jemalloc on Mac OS X systems, use:
3fb1c8a0 40
a63a3d4d 41 % make MALLOC=jemalloc
3fb1c8a0
JO
42
43Verbose build
44-------------
45
46Redis will build with a user friendly colorized output by default.
47If you want to see a more verbose output use the following:
48
ca1f766a 49 % make V=1
0a802bd7 50
d3207647 51Running Redis
52-------------
53
54To run Redis with the default configuration just type:
55
56 % cd src
57 % ./redis-server
58
59If you want to provide your redis.conf, you have to run it using an additional
60parameter (the path of the configuration file):
61
62 % cd src
63 % ./redis-server /path/to/redis.conf
64
1576520c 65It is possible to alter the Redis configuration passing parameters directly
66as options using the command line. Examples:
67
68 % ./redis-server --port 9999 --slaveof 127.0.0.1 6379
69 % ./redis-server /etc/redis/6379.conf --loglevel debug
70
71All the options in redis.conf are also supported as options using the command
72line, with exactly the same name.
73
d3207647 74Playing with Redis
75------------------
76
77You can use redis-cli to play with Redis. Start a redis-server instance,
78then in another terminal try the following:
79
80 % cd src
81 % ./redis-cli
82 redis> ping
83 PONG
84 redis> set foo bar
85 OK
86 redis> get foo
87 "bar"
88 redis> incr mycounter
89 (integer) 1
90 redis> incr mycounter
91 (integer) 2
92 redis>
93
94You can find the list of all the available commands here:
95
e491a1a1 96 http://redis.io/commands
d3207647 97
ca1f766a 98Installing Redis
99-----------------
100
101In order to install Redis binaries into /usr/local/bin just use:
102
103 % make install
104
105You can use "make PREFIX=/some/other/directory install" if you wish to use a
106different destination.
107
108Make install will just install binaries in your system, but will not configure
109init scripts and configuration files in the appropriate place. This is not
110needed if you want just to play a bit with Redis, but if you are installing
111it the proper way for a production system, we have a script doing this
112for Ubuntu and Debian systems:
113
114 % cd utils
115 % ./install_server
116
117The script will ask you a few questions and will setup everything you need
118to run Redis properly as a background daemon that will start again on
119system reboots.
120
121You'll be able to stop and start Redis using the script named
122/etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.
123
d3207647 124Enjoy!