]> git.saurik.com Git - redis.git/blame - README
Added missing license and copyright in deps/hiredis.
[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--------------
30e89410 9
10Redis can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD.
11We support big endian and little endian architectures.
12
13It may compile on Solaris derived systems (for instance SmartOS) but our
14support for this platform is "best effort" and Redis is not guaranteed to
15work as well as in Linux, OSX, and *BSD there.
d3207647 16
17It is as simple as:
18
19 % make
20
d3207647 21You can run a 32 bit Redis binary using:
22
23 % make 32bit
24
3fb1c8a0 25After building Redis is a good idea to test it, using:
d3207647 26
27 % make test
28
3fb1c8a0
JO
29NOTE: if after building Redis with a 32 bit target you need to rebuild it
30 with a 64 bit target you need to perform a "make clean" in the root
31 directory of the Redis distribution.
32
33Allocator
34---------
35
a63a3d4d
PN
36Selecting a non-default memory allocator when building Redis is done by setting
37the `MALLOC` environment variable. Redis is compiled and linked against libc
38malloc by default, with the exception of jemalloc being the default on Linux
39systems. This default was picked because jemalloc has proven to have fewer
40fragmentation problems than libc malloc.
3fb1c8a0 41
a63a3d4d 42To force compiling against libc malloc, use:
3fb1c8a0 43
a63a3d4d 44 % make MALLOC=libc
3fb1c8a0 45
a63a3d4d 46To compile against jemalloc on Mac OS X systems, use:
3fb1c8a0 47
a63a3d4d 48 % make MALLOC=jemalloc
3fb1c8a0
JO
49
50Verbose build
51-------------
52
53Redis will build with a user friendly colorized output by default.
54If you want to see a more verbose output use the following:
55
ca1f766a 56 % make V=1
0a802bd7 57
d3207647 58Running Redis
59-------------
60
61To run Redis with the default configuration just type:
62
63 % cd src
64 % ./redis-server
65
66If you want to provide your redis.conf, you have to run it using an additional
67parameter (the path of the configuration file):
68
69 % cd src
70 % ./redis-server /path/to/redis.conf
71
1576520c 72It is possible to alter the Redis configuration passing parameters directly
73as options using the command line. Examples:
74
75 % ./redis-server --port 9999 --slaveof 127.0.0.1 6379
76 % ./redis-server /etc/redis/6379.conf --loglevel debug
77
78All the options in redis.conf are also supported as options using the command
79line, with exactly the same name.
80
d3207647 81Playing with Redis
82------------------
83
84You can use redis-cli to play with Redis. Start a redis-server instance,
85then in another terminal try the following:
86
87 % cd src
88 % ./redis-cli
89 redis> ping
90 PONG
91 redis> set foo bar
92 OK
93 redis> get foo
94 "bar"
95 redis> incr mycounter
96 (integer) 1
97 redis> incr mycounter
98 (integer) 2
99 redis>
100
101You can find the list of all the available commands here:
102
e491a1a1 103 http://redis.io/commands
d3207647 104
ca1f766a 105Installing Redis
106-----------------
107
108In order to install Redis binaries into /usr/local/bin just use:
109
110 % make install
111
112You can use "make PREFIX=/some/other/directory install" if you wish to use a
113different destination.
114
115Make install will just install binaries in your system, but will not configure
116init scripts and configuration files in the appropriate place. This is not
117needed if you want just to play a bit with Redis, but if you are installing
118it the proper way for a production system, we have a script doing this
119for Ubuntu and Debian systems:
120
121 % cd utils
122 % ./install_server
123
124The script will ask you a few questions and will setup everything you need
125to run Redis properly as a background daemon that will start again on
126system reboots.
127
128You'll be able to stop and start Redis using the script named
129/etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.
130
8e30092f 131Code contributions
132---
133
134Note: by contributing code to the Redis project in any form, including sending
135a pull request via Github, a code fragment or patch via private email or
136public discussion groups, you agree to release your code under the terms
137of the BSD license that you can find in the COPYING file included in the Redis
138source distribution.
139
140Please see the CONTRIBUTING file in this source distribution for more
141information.
142
d3207647 143Enjoy!