README 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. Where to find complete Redis documentation?
  2. -------------------------------------------
  3. This README is just a fast "quick start" document. You can find more detailed
  4. documentation at http://redis.io
  5. Building Redis
  6. --------------
  7. It is as simple as:
  8. % make
  9. You can run a 32 bit Redis binary using:
  10. % make 32bit
  11. After building Redis is a good idea to test it, using:
  12. % make test
  13. NOTE: if after building Redis with a 32 bit target you need to rebuild it
  14. with a 64 bit target you need to perform a "make clean" in the root
  15. directory of the Redis distribution.
  16. Allocator
  17. ---------
  18. By default Redis compiles and links against jemalloc under Linux, since
  19. glibc malloc() has memory fragmentation problems.
  20. To force a libc malloc() build use:
  21. % make FORCE_LIBC_MALLOC=yes
  22. In all the other non Linux systems the libc malloc() is used by default.
  23. On Mac OS X you can force a jemalloc based build using the following:
  24. % make USE_JEMALLOC=yes
  25. Verbose build
  26. -------------
  27. Redis will build with a user friendly colorized output by default.
  28. If you want to see a more verbose output use the following:
  29. % make V=1
  30. Running Redis
  31. -------------
  32. To run Redis with the default configuration just type:
  33. % cd src
  34. % ./redis-server
  35. If you want to provide your redis.conf, you have to run it using an additional
  36. parameter (the path of the configuration file):
  37. % cd src
  38. % ./redis-server /path/to/redis.conf
  39. Playing with Redis
  40. ------------------
  41. You can use redis-cli to play with Redis. Start a redis-server instance,
  42. then in another terminal try the following:
  43. % cd src
  44. % ./redis-cli
  45. redis> ping
  46. PONG
  47. redis> set foo bar
  48. OK
  49. redis> get foo
  50. "bar"
  51. redis> incr mycounter
  52. (integer) 1
  53. redis> incr mycounter
  54. (integer) 2
  55. redis>
  56. You can find the list of all the available commands here:
  57. http://redis.io/commands
  58. Installing Redis
  59. -----------------
  60. In order to install Redis binaries into /usr/local/bin just use:
  61. % make install
  62. You can use "make PREFIX=/some/other/directory install" if you wish to use a
  63. different destination.
  64. Make install will just install binaries in your system, but will not configure
  65. init scripts and configuration files in the appropriate place. This is not
  66. needed if you want just to play a bit with Redis, but if you are installing
  67. it the proper way for a production system, we have a script doing this
  68. for Ubuntu and Debian systems:
  69. % cd utils
  70. % ./install_server
  71. The script will ask you a few questions and will setup everything you need
  72. to run Redis properly as a background daemon that will start again on
  73. system reboots.
  74. You'll be able to stop and start Redis using the script named
  75. /etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.
  76. Enjoy!