More than 5 years have passed since last update.

posted at

updated at

Redis 2.8.24 をソースからインストールする

Redis 2.8.24をソースインストールします。
OSは、Ubuntu 14.04.3 LTSを使います。



sudo apt-get update
sudo apt-get install -y tcl


ソースファイルは からダウンロードします。

$ cd /usr/local/src
$ sudo wget
$ sudo tar zxvf redis-2.8.24.tar.gz



$ sudo useradd -s /bin/false -M redis
$ cd /usr/local/src/redis-2.8.24
$ sudo make
$ sudo make install


$ cd /usr/local/src/redis-2.8.24/utils
$ sudo ./
  Welcome to the redis service installer
  This script will help you easily set up a running redis server

  Please select the redis port for this instance: [6379]
  Selecting default: 6379
  Please select the redis config file name [/etc/redis/6379.conf]
  Selected default - /etc/redis/6379.conf
  Please select the redis log file name [/var/log/redis_6379.log]
  Selected default - /var/log/redis_6379.log
  Please select the data directory for this instance [/var/lib/redis/6379]
  Selected default - /var/lib/redis/6379
  Please select the redis executable path [/usr/local/bin/redis-server]
  Selected config:
  Port           : 6379
  Config file    : /etc/redis/6379.conf
  Log file       : /var/log/redis_6379.log
  Data dir       : /var/lib/redis/6379
  Executable     : /usr/local/bin/redis-server
  Cli Executable : /usr/local/bin/redis-cli
  Is this ok? Then press ENTER to go on or Ctrl-C to abort.
  Copied /tmp/6379.conf => /etc/init.d/redis_6379
  Installing service...
   System start/stop links for /etc/init.d/redis_6379 already exist.
  /var/run/ exists, process is already running or crashed
  Installation successful!


$ sudo service redis_6379 status
  Redis is running (26622)





$ sudo useradd -s /bin/false -M redis
$ cd /usr/local/src/redis-2.8.24/src
$ sudo make redis-benchmark
$ sudo make redis-cli
$ sudo make redis-check-aof
$ sudo make redis-check-dump
$ sudo cp -pf redis-benchmark /usr/local/bin/
$ sudo cp -pf redis-cli /usr/local/bin/
$ sudo cp -pf redis-check-aof /usr/local/bin/
$ sudo cp -pf redis-check-dump /usr/local/bin/


$ redis-
  redis-benchmark   redis-check-aof   redis-check-dump  redis-cli


$ redis-cli --version
  redis-cli 2.8.24
$ redis-cli --help
  redis-cli 2.8.24

  Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
    -h <hostname>      Server hostname (default:
    -p <port>          Server port (default: 6379).
    -s <socket>        Server socket (overrides hostname and port).
    -a <password>      Password to use when connecting to the server.
    -r <repeat>        Execute specified command N times.
    -i <interval>      When -r is used, waits <interval> seconds per command.
                     It is possible to specify sub-second times like -i 0.1.
    -n <db>            Database number.
    -x                 Read last argument from STDIN.
    -d <delimiter>     Multi-bulk delimiter in for raw formatting (default: \n).
    -c                 Enable cluster mode (follow -ASK and -MOVED redirections).
    --raw              Use raw formatting for replies (default when STDOUT is
                     not a tty).
    --no-raw           Force formatted output even when STDOUT is not a tty.
    --csv              Output in CSV format.
    --stat             Print rolling stats about server: mem, clients, ...
    --latency          Enter a special mode continuously sampling latency.
    --latency-history  Like --latency but tracking latency changes over time.
                       Default time interval is 15 sec. Change it using -i.
    --latency-dist     Shows latency as a spectrum, requires xterm 256 colors.
                       Default time interval is 1 sec. Change it using -i.
    --lru-test <keys>  Simulate a cache workload with an 80-20 distribution.
    --slave            Simulate a slave showing commands received from the master.
    --rdb <filename>   Transfer an RDB dump from remote server to local file.
    --pipe             Transfer raw Redis protocol from stdin to server.
    --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.
                       no reply is received within <n> seconds.
                       Default timeout: 30. Use 0 to wait forever.
    --bigkeys          Sample Redis keys looking for big keys.
    --scan             List all keys using the SCAN command.
    --pattern <pat>    Useful with --scan to specify a SCAN pattern.
    --intrinsic-latency <sec> Run a test to measure intrinsic system latency.
                       The test will run for the specified amount of seconds.
    --eval <file>      Send an EVAL command using the Lua script at <file>.
    --help             Output this help and exit.
    --version          Output version and exit.

    cat /etc/passwd | redis-cli -x set mypasswd
    redis-cli get mypasswd
    redis-cli -r 100 lpush mylist x
    redis-cli -r 100 -i 1 info | grep used_memory_human:
    redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3
    redis-cli --scan --pattern '*:12345*'

    (Note: when using --eval the comma separates KEYS[] from ARGV[] items)

  When no command is given, redis-cli starts in interactive mode.
  Type "help" in interactive mode for information on available commands.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up