Como instalar Redis no Linux

outubro 28th, 2011 | by | redis

out
28

Quem não conhece o redis ele é um banco de dados NOSQL do tipo chave:valor persistente e distribuído, ou seja, ótimo para cache.

Para instalarmos ele é bem simples siga esses comandos:

$ wget http://redis.googlecode.com/files/redis-2.2.8.tar.gz
$ tar xzf redis-2.2.8.tar.gz
$ cd redis-2.2.8
$ make
Para rodar o servidor é 'so ir na pasta src e mandar rodar o redis-server:

 

$ cd src && ./redis-server

Para testá-lo com o cliente do redis é só seguir:


$ cd src && ./redis-cli
redis> set nome Suissa
OK
redis> get nome
"Suissa"

Simples e fácil como é o próprio banco.


 

 

Authored by

2 Responses to “Como instalar Redis no Linux”

Show / Hide Comments
  1. eu nao entendi o que esta nesse warning ?

    aonde eu adiciono esse config file que ele pede e como ele e ?

    kakaroto@ubuntu:~/redis$ ./src/redis-server
    [10896] 22 Nov 00:12:10 # Warning: no config file specified, using the default config. In order to specify a config file use ‘redis-server /path/to/redis.conf’
    [10896] 22 Nov 00:12:10 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 992.
    _._
    _.-“__ ”-._
    _.-“ `. `_. ”-._ Redis 2.9.0 (afd0f06b/0) 64 bit
    .-“ .-“`. “`\/ _.,_ ”-._
    ( ‘ , .-` | `, ) Running in stand alone mode
    |`-._`-…-` __…-.“-._|’` _.-’| Port: 6379
    | `-._ `._ / _.-’ | PID: 10896
    `-._ `-._ `-./ _.-’ _.-’
    |`-._`-._ `-.__.-’ _.-’_.-’|
    | `-._`-._ _.-’_.-’ | http://redis.io
    `-._ `-._`-.__.-’_.-’ _.-’
    |`-._`-._ `-.__.-’ _.-’_.-’|
    | `-._`-._ _.-’_.-’ |
    `-._ `-._`-.__.-’_.-’ _.-’
    `-._ `-.__.-’ _.-’
    `-._ _.-’
    `-.__.-’

    [10896] 22 Nov 00:12:10 * Server started, Redis version 2.9.0
    [10896] 22 Nov 00:12:10 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1′ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1′ for this to take effect.
    [10896] 22 Nov 00:12:10 * The server is now ready to accept connections on port 6379
    [10896] 22 Nov 00:12:10 – 0 clients connected (0 slaves), 741336 bytes in use

  2. +henrique esta falando para você add ‘vm.overcommit_memory = 1′ no seu conf, para ter um overcommit de memoria.