Google Sitemaps用XML自動生成ツール

CentOS6.2にRedisをインストールする

Posted by ごうじん, on Wednesday, May 02, 2012 04:02 PM JST
no image

複数のデータ型が扱えるKVS、RedisCentOS 6.2にインストールしてみました。

インストール環境はxenのDomain-Uです。

xen環境

$ xm list
Name                                    ID   Mem VCPUs      State   Time(s)
Domain-0                                 0  1216     4     r-----    226.3
hohenschwangau                           1   256     1     -b----     20.1
hohenzollern                             2   256     1     -b----     13.8
pfalzgrafenstein                         3   256     1     -b----     19.8

コンパイル環境インストール

コンパイルしてインストールする方法をとりますので、yum で必要なパッケージをインストールしてます。

インストールしたパッケージは、以下のとおり。
  • wget
  • gcc
  • make
  • tcl-devel ※テストで使います。テストしないのであれば不要
yumでパッケージをインストール。
$ uname -a
Linux pfalzgrafenstein 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
$ yum install wget gcc make tcl-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fairway.ne.jp
 * extras: mirror.fairway.ne.jp
 * updates: mirror.fairway.ne.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.6-3.el6 will be installed
---> Package make.x86_64 1:3.81-19.el6 will be installed
---> Package tcl-devel.x86_64 1:8.5.7-6.el6 will be installed
---> Package wget.x86_64 0:1.12-1.4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch            Version                 Repository     Size
================================================================================
Installing:
 gcc                x86_64          4.4.6-3.el6             base           10 M
 make               x86_64          1:3.81-19.el6           base          389 k
 tcl-devel          x86_64          1:8.5.7-6.el6           base          162 k
 wget               x86_64          1.12-1.4.el6            base          481 k

Transaction Summary
================================================================================
Install       4 Package(s)

Total download size: 11 M
Installed size: 22 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): gcc-4.4.6-3.el6.x86_64.rpm                        |  10 MB     00:10
(2/4): make-3.81-19.el6.x86_64.rpm                       | 389 kB     00:00
(3/4): tcl-devel-8.5.7-6.el6.x86_64.rpm                  | 162 kB     00:00
(4/4): wget-1.12-1.4.el6.x86_64.rpm                      | 481 kB     00:00
--------------------------------------------------------------------------------
Total                                           993 kB/s |  11 MB     00:11
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : gcc-4.4.6-3.el6.x86_64                                       1/4
  Installing : 1:make-3.81-19.el6.x86_64                                    2/4
  Installing : 1:tcl-devel-8.5.7-6.el6.x86_64                               3/4
  Installing : wget-1.12-1.4.el6.x86_64                                     4/4

Installed:
  gcc.x86_64 0:4.4.6-3.el6                 make.x86_64 1:3.81-19.el6
  tcl-devel.x86_64 1:8.5.7-6.el6           wget.x86_64 0:1.12-1.4.el6

Complete!

ソースの取得

Download – Redisのstableからソースをダウンロードします。
※バージョンは 2.4.12 です。

$ cd /usr/local/src
$ wget http://redis.googlecode.com/files/redis-2.4.12.tar.gz
--2012-05-02 18:59:59--  http://redis.googlecode.com/files/redis-2.4.12.tar.gz
redis.googlecode.com をDNSに問いあわせています... 74.125.31.82
redis.googlecode.com|74.125.31.82|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 625384 (611K) [application/x-gzip]
`redis-2.4.12.tar.gz' に保存中

100%[======================================>] 625,384     1.81M/s 時間 0.3s

2012-05-02 18:59:59 (1.81 MB/s) - `redis-2.4.12.tar.gz' へ保存完了 [625384/625384]

$ ls -l redis-2.4.12.tar.gz
-rw-r--r--. 1 root root 625384  4月 30 19:29 2012 redis-2.4.12.tar.gz

$ tar xfz redis-2.4.12.tar.gz

$ ls -l
合計 616
drwxrwxr-x. 6 root root   4096  4月 30 19:27 2012 redis-2.4.12
-rw-r--r--. 1 root root 625384  4月 30 19:29 2012 redis-2.4.12.tar.gz

コンパイル

configure ではなく、単に make するだけ。
$ cd redis-2.4.12
$ make
cd src && make all
make[1]: ディレクトリ `/usr/local/src/redis-2.4.12/src' に入ります
MAKE hiredis
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' に入ります
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  sds.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' から出ます
MAKE linenoise
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/linenoise' に入ります
cc  -c -Wall -W -Os -g linenoise.c
cc  -c -Wall -W -Os -g example.c
cc  -Wall -W -Os -g -o linenoise_example linenoise.o example.o
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/linenoise' から出ます
MAKE jemalloc
checking for xsltproc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether compiler supports -std=gnu99... yes
checking whether compiler supports -Wall... yes
checking whether compiler supports -pipe... yes
checking whether compiler supports -g3... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of void *... 8
checking size of int... 4
checking size of long... 8
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether __asm__ syntax is compilable... yes
checking whether __attribute__ syntax is compilable... yes
checking whether compiler supports -fvisibility=hidden... yes
checking whether mremap(...MREMAP_FIXED...) is compilable... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for ld... /usr/bin/ld
checking for autoconf... no
checking whether compiler supports -O3... yes
checking whether compiler supports -funroll-loops... yes
checking configured backtracing method... N/A
checking STATIC_PAGE_SHIFT... 12
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlopen in -ldl... yes
checking for TLS... yes
checking for ffsl... yes
checking whether Darwin OSAtomic*() is compilable... no
checking whether Darwin OSSpin*() is compilable... no
checking for memalign... yes
checking for valloc... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/html.xsl
config.status: creating doc/manpages.xsl
config.status: creating doc/jemalloc.xml
config.status: creating include/jemalloc/jemalloc.h
config.status: creating include/jemalloc/internal/jemalloc_internal.h
config.status: creating test/jemalloc_test.h
config.status: creating config.stamp
config.status: creating include/jemalloc/jemalloc_defs.h
===============================================================================
jemalloc version   : 2.2.5-0-gfc1bb70e5f0d9a58b39efa39cc549b5af5104760

CC                 : gcc
CPPFLAGS           :  -D_GNU_SOURCE -D_REENTRANT
CFLAGS             : -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops
LDFLAGS            :
LIBS               :  -lpthread -ldl
RPATH_EXTRA        :

XSLTPROC           :
XSLROOT            : /usr/share/xml/docbook/stylesheet/docbook-xsl

PREFIX             : /usr/local
BINDIR             : /usr/local/bin
INCLUDEDIR         : /usr/local/include
LIBDIR             : /usr/local/lib
DATADIR            : /usr/local/share
MANDIR             : /usr/local/share/man

srcroot            :
abs_srcroot        : /usr/local/src/redis-2.4.12/deps/jemalloc/
objroot            :
abs_objroot        : /usr/local/src/redis-2.4.12/deps/jemalloc/

JEMALLOC_PREFIX    : je_
JEMALLOC_PRIVATE_NAMESPACE
                   :
install_suffix     :
autogen            : 0
cc-silence         : 1
debug              : 0
stats              : 0
prof               : 0
prof-libunwind     : 0
prof-libgcc        : 0
prof-gcc           : 0
tiny               : 1
tcache             : 1
fill               : 0
xmalloc            : 0
sysv               : 0
swap               : 0
dss                : 0
dynamic_page_shift : 0
lazy_lock          : 1
tls                : 1
===============================================================================
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/jemalloc' に入ります
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/jemalloc.o src/jemalloc.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/arena.o src/arena.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/atomic.o src/atomic.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/base.o src/base.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bitmap.o src/bitmap.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk.o src/chunk.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk_dss.o src/chunk_dss.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk_mmap.o src/chunk_mmap.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk_swap.o src/chunk_swap.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ckh.o src/ckh.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ctl.o src/ctl.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent.o src/extent.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hash.o src/hash.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/huge.o src/huge.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mb.o src/mb.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex.o src/mutex.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prof.o src/prof.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/rtree.o src/rtree.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/stats.o src/stats.c
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tcache.o src/tcache.c
ar crus lib/libjemalloc.a src/jemalloc.o src/arena.o src/atomic.o src/base.o src/bitmap.o src/chunk.o src/chunk_dss.o src/chunk_mmap.o src/chunk_swap.o src/ckh.o src/ctl.o src/extent.o src/hash.o src/huge.o src/mb.o src/mutex.o src/prof.o src/rtree.o src/stats.o src/tcache.o
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/jemalloc' から出ます
    CC ae.o
    CC anet.o
    CC redis-benchmark.o
    CC sds.o
    CC adlist.o
    CC zmalloc.o
MAKE hiredis
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' に入ります
make[2]: `static' に対して行うべき事はありません.
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' から出ます
    LINK redis-benchmark
    CC redis-cli.o
    CC release.o
    LINK redis-cli
    CC redis-check-dump.o
    CC lzf_c.o
    CC lzf_d.o
    LINK redis-check-dump
    CC redis-check-aof.o
    LINK redis-check-aof
    CC dict.o
    CC redis.o
    CC pqsort.o
    CC zipmap.o
    CC sha1.o
    CC ziplist.o
    CC networking.o
    CC util.o
    CC object.o
    CC db.o
    CC replication.o
    CC rdb.o
    CC t_string.o
    CC t_list.o
    CC t_set.o
    CC t_zset.o
    CC t_hash.o
    CC config.o
    CC aof.o
    CC vm.o
    CC pubsub.o
    CC multi.o
    CC debug.o
    CC sort.o
    CC intset.o
    CC syncio.o
    CC slowlog.o
    CC bio.o
    CC memtest.o
    LINK redis-server

Hint: To run 'make test' is a good idea ;)

make[1]: ディレクトリ `/usr/local/src/redis-2.4.12/src' から出ます

ライブラリ依存がないので、とっても簡単です。

テスト

yumで tcl-devel をインストールしたのは、テストするためでした。
テストしないということであれば、このステップはスルーです。

$ make test
cd src && make test
make[1]: ディレクトリ `/usr/local/src/redis-2.4.12/src' に入ります
/usr/bin/tclsh8.5
Cleanup: may take some time... OK
Starting test server at port 11111
[ready]: 5587
Testing unit/printver
[ready]: 5588
Testing unit/auth
[ready]: 5589
Testing unit/protocol
[ready]: 5590
Testing unit/basic
[ready]: 5591
Testing unit/type/list
[ready]: 5593
Testing unit/type/list-2
[ready]: 5592
Testing unit/type/list-3
[ready]: 5594
Testing unit/type/set
[ready]: 5596
Testing unit/type/zset
[ready]: 5595
Testing unit/type/hash
[ready]: 5597
Testing unit/sort
[ready]: 5598
Testing unit/expire
[ready]: 5599
Testing unit/other
[ready]: 5600
Testing unit/cas
[ready]: 5601
Testing unit/quit
[ready]: 5602
Testing integration/replication
[ok]: AUTH fails if there is no password configured server side
[ok]: HSET/HLEN - Small hash creation
[ok]: Is the small hash encoded with a zipmap?
[ok]: Explicit regression for a list bug
[ok]: Handle an empty query
[ok]: LPUSH, RPUSH, LLENGTH, LINDEX - ziplist
[ok]: LPUSH, RPUSH, LLENGTH, LINDEX - regular list
[ok]: Variadic RPUSH/LPUSH
[ok]: Check encoding - ziplist
[ok]: ZSET basic ZADD and score update - ziplist
[ok]: ZSET element can't be set to NaN with ZADD - ziplist
[ok]: ZSET element can't be set to NaN with ZINCRBY
[ok]: ZINCRBY calls leading to NaN result in error
[ok]: ZADD - Variadic version base case
[ok]: ZADD - Return value is the number of actually added items
[ok]: ZADD - Variadic version does not add nothing on single parsing err
[ok]: Negative multibulk length
[ok]: Out of range multibulk length
[ok]: Wrong multibulk payload header
[ok]: Negative multibulk payload length
[ok]: Out of range multibulk payload length
[ok]: Non-number multibulk payload length
[ok]: Multi bulk request not followed by bulk arguments
[ok]: Generic wrong number of args
[ok]: DEL all keys to start with a clean DB
[ok]: SET and GET an item
[ok]: SET and GET an empty item
[ok]: DEL against a single item
[ok]: Vararg DEL
[ok]: SADD, SCARD, SISMEMBER, SMEMBERS basics - regular set
[ok]: SADD, SCARD, SISMEMBER, SMEMBERS basics - intset
[ok]: SADD against non set
[ok]: SADD a non-integer against an intset
[ok]: SADD an integer larger than 64 bits
[ok]: KEYS with pattern
[ok]: KEYS to get all keys
[ok]: ZADD - Variadic version will raise error on missing arg
[ok]: ZINCRBY does not work variadic even if shares ZADD implementation
[ok]: ZCARD basics - ziplist
[ok]: ZREM removes key after last element is removed
[ok]: DEL a list - ziplist
[ok]: DEL a list - regular list
[ok]: DBSIZE
[ok]: DEL all keys
Testing Redis version 2.4.12 (00000000)
[ok]: ZREM variadic version
[ok]: ZREM variadic version -- remove elements after key deletion
[ok]: EXPIRE - set timeouts multiple times
[ok]: EXPIRE - It should be still possible to read 'x'
[ok]: Ziplist: SORT BY key
[ok]: Ziplist: SORT BY hash field
[ok]: BLPOP, BRPOP: single existing list - linkedlist
[ok]: SAVE - make sure there are all the types as values
[ok]: BLPOP, BRPOP: multiple existing lists - linkedlist
[ok]: ZRANGE basics - ziplist
[ok]: EXEC works on WATCHed key not modified
[ok]: EXEC fail on WATCHed key modified (1 key of 1 watched)
[ok]: EXEC fail on WATCHed key modified (1 key of 5 watched)
[ok]: After successful EXEC key is no longer watched
[ok]: After failed EXEC key is no longer watched
[ok]: It is possible to UNWATCH
[ok]: UNWATCH when there is nothing watched works as expected
[ok]: QUIT returns OK
[ok]: Pipelined commands after QUIT must not be executed
[ok]: Pipelined commands after QUIT that exceed read buffer size
[ok]: BLPOP, BRPOP: second list has an entry - linkedlist
[ok]: FLUSHALL is able to touch the watched keys
[ok]: ZREVRANGE basics - ziplist
[ok]: BRPOPLPUSH - linkedlist
[ok]: ZRANK/ZREVRANK basics - ziplist
[ok]: ZRANK - after deletion - ziplist
[ok]: ZINCRBY - can create a new sorted set - ziplist
[ok]: BLPOP, BRPOP: single existing list - ziplist
[ok]: FLUSHALL does not touch non affected keys
[ok]: FLUSHDB is able to touch the watched keys
[ok]: FLUSHDB does not touch non affected keys
[ok]: WATCH is able to remember the DB a key belongs to
[ok]: WATCH will consider touched keys target of EXPIRE
[ok]: ZINCRBY - increment and decrement - ziplist
[ok]: BLPOP, BRPOP: multiple existing lists - ziplist
[ok]: BLPOP, BRPOP: second list has an entry - ziplist
[ok]: BRPOPLPUSH - ziplist
[ok]: ZRANGEBYSCORE/ZREVRANGEBYSCORE/ZCOUNT basics
[ok]: BLPOP with variadic LPUSH
[ok]: ZRANGEBYSCORE with WITHSCORES
[ok]: ZRANGEBYSCORE with LIMIT
[ok]: ZRANGEBYSCORE with LIMIT and WITHSCORES
[ok]: ZRANGEBYSCORE with non-value min or max
[ok]: ZREMRANGEBYSCORE basics
[ok]: ZREMRANGEBYSCORE with non-value min or max
[ok]: ZREMRANGEBYRANK basics
[ok]: ZUNIONSTORE against non-existing key doesn't set destination - ziplist
[ok]: ZUNIONSTORE with empty set - ziplist
[ok]: ZUNIONSTORE basics - ziplist
[ok]: ZUNIONSTORE with weights - ziplist
[ok]: ZUNIONSTORE with a regular set and weights - ziplist
[ok]: ZUNIONSTORE with AGGREGATE MIN - ziplist
[ok]: ZUNIONSTORE with AGGREGATE MAX - ziplist
[ok]: ZINTERSTORE basics - ziplist
[ok]: ZINTERSTORE with weights - ziplist
[ok]: ZINTERSTORE with a regular set and weights - ziplist
[ok]: ZINTERSTORE with AGGREGATE MIN - ziplist
[ok]: SADD overflows the maximum allowed integers in an intset
[ok]: Variadic SADD
[ok]: ZINTERSTORE with AGGREGATE MAX - ziplist
[ok]: ZUNIONSTORE with +inf/-inf scores - ziplist
[ok]: ZUNIONSTORE with NaN weights ziplist
[ok]: ZINTERSTORE with +inf/-inf scores - ziplist
[ok]: ZINTERSTORE with NaN weights ziplist
[ok]: Check encoding - skiplist
[ok]: ZSET basic ZADD and score update - skiplist
[ok]: ZSET element can't be set to NaN with ZADD - skiplist
[ok]: ZSET element can't be set to NaN with ZINCRBY
[ok]: ZINCRBY calls leading to NaN result in error
[ok]: ZADD - Variadic version base case
[ok]: ZADD - Return value is the number of actually added items
[ok]: ZADD - Variadic version does not add nothing on single parsing err
[ok]: ZADD - Variadic version will raise error on missing arg
[ok]: ZINCRBY does not work variadic even if shares ZADD implementation
[ok]: ZCARD basics - skiplist
[ok]: ZREM removes key after last element is removed
[ok]: ZREM variadic version
[ok]: ZREM variadic version -- remove elements after key deletion
[ok]: ZRANGE basics - skiplist
[1/23 done]: unit/printver (1 seconds)
Testing integration/replication-2
[ok]: ZREVRANGE basics - skiplist
[ok]: ZRANK/ZREVRANK basics - skiplist
[ok]: ZRANK - after deletion - skiplist
[ok]: ZINCRBY - can create a new sorted set - skiplist
[ok]: ZINCRBY - increment and decrement - skiplist
[2/23 done]: unit/quit (1 seconds)
Testing integration/replication-3
[ok]: ZRANGEBYSCORE/ZREVRANGEBYSCORE/ZCOUNT basics
[ok]: ZRANGEBYSCORE with WITHSCORES
[ok]: ZRANGEBYSCORE with LIMIT
[ok]: ZRANGEBYSCORE with LIMIT and WITHSCORES
[ok]: ZRANGEBYSCORE with non-value min or max
[ok]: First server should have role slave after SLAVEOF
[ok]: BRPOPLPUSH replication, when blocking against empty list
[ok]: ZREMRANGEBYSCORE basics
[ok]: ZREMRANGEBYSCORE with non-value min or max
[ok]: ZREMRANGEBYRANK basics
[ok]: ZUNIONSTORE against non-existing key doesn't set destination - skiplist
[ok]: ZUNIONSTORE with empty set - skiplist
[ok]: ZUNIONSTORE basics - skiplist
[ok]: ZUNIONSTORE with weights - skiplist
[ok]: ZUNIONSTORE with a regular set and weights - skiplist
[ok]: ZUNIONSTORE with AGGREGATE MIN - skiplist
[ok]: ZUNIONSTORE with AGGREGATE MAX - skiplist
[ok]: ZINTERSTORE basics - skiplist
[ok]: ZINTERSTORE with weights - skiplist
[ok]: ZINTERSTORE with a regular set and weights - skiplist
[ok]: ZINTERSTORE with AGGREGATE MIN - skiplist
[ok]: ZINTERSTORE with AGGREGATE MAX - skiplist
[ok]: ZUNIONSTORE with +inf/-inf scores - skiplist
[ok]: ZUNIONSTORE with NaN weights skiplist
[ok]: ZINTERSTORE with +inf/-inf scores - skiplist
[ok]: ZINTERSTORE with NaN weights skiplist
[ok]: ZINTERSTORE regression with two sets, intset+hashtable
[ok]: ZUNIONSTORE regression, should not create NaN in scores
[ok]: AUTH fails when a wrong password is given
[ok]: Arbitrary command gives an error when AUTH is required
[ok]: AUTH succeeds when the right password is given
[ok]: Once AUTH succeeded we can actually send commands to the server
[ok]: BRPOPLPUSH with zero timeout should block indefinitely
[ok]: WATCH will not consider touched expired keys
[ok]: DISCARD should clear the WATCH dirty flag on the client
[ok]: DISCARD should UNWATCH all the keys
[ok]: HSET/HLEN - Big hash creation
[ok]: Is the big hash encoded with a zipmap?
[ok]: ZSCORE - ziplist
[ok]: HGET against the small hash
[ok]: ZSCORE after a DEBUG RELOAD - ziplist
[3/23 done]: unit/auth (2 seconds)
Testing integration/aof
[ok]: BRPOPLPUSH replication, list exists
[4/23 done]: unit/cas (2 seconds)
Testing unit/pubsub
[ok]: Very big payload in GET/SET
[ok]: Set encoding after DEBUG RELOAD
[ok]: SREM basics - regular set
[ok]: SREM basics - intset
[ok]: SREM with multiple arguments
[ok]: ZSET sorting stresser - ziplist
[ok]: SREM variadic version with more args needed to destroy the key
[ok]: BRPOPLPUSH with a client BLPOPing the target list
[ok]: BRPOPLPUSH with wrong source type
[ok]: Unfinished MULTI: Server should have logged an error
[ok]: PUBLISH/SUBSCRIBE basics
[ok]: PUBLISH/SUBSCRIBE with two clients
[ok]: PUBLISH/SUBSCRIBE after UNSUBSCRIBE without arguments
[ok]: SUBSCRIBE to one channel more than once
[ok]: UNSUBSCRIBE from non-subscribed channels
[ok]: PUBLISH/PSUBSCRIBE basics
[ok]: PUBLISH/PSUBSCRIBE with two clients
[ok]: PUBLISH/PSUBSCRIBE after PUNSUBSCRIBE without arguments
[ok]: PUNSUBSCRIBE from non-subscribed channels
[ok]: Mix SUBSCRIBE and PSUBSCRIBE
[ok]: HGET against the big hash
[ok]: HGET against non existing key
[ok]: HSET in update and insert mode
[ok]: HSETNX target key missing - small hash
[ok]: HSETNX target key exists - small hash
[ok]: HSETNX target key missing - big hash
[ok]: HSETNX target key exists - big hash
[ok]: HMSET wrong number of args
[ok]: HMSET - small hash
[ok]: Protocol desync regression test #1
[ok]: First server should have role slave after SLAVEOF
[ok]: First server should have role slave after SLAVEOF
[ok]: Generated sets must be encoded as hashtable
[ok]: SINTER with two sets - hashtable
[ok]: SINTERSTORE with two sets - hashtable
[ok]: HMSET - big hash
[ok]: HMGET against non existing key and fields
[ok]: HMGET against wrong type
[ok]: HMGET - small hash
[ok]: SINTERSTORE with two sets, after a DEBUG RELOAD - hashtable
[ok]: SUNION with two sets - hashtable
[ok]: Short read: Server should have logged an error
[ok]: SUNIONSTORE with two sets - hashtable
[ok]: HMGET - big hash
[ok]: SINTER against three sets - hashtable
[ok]: SINTERSTORE with three sets - hashtable
[ok]: HKEYS - small hash
[ok]: SUNION with non existing keys - hashtable
[5/23 done]: unit/pubsub (1 seconds)
Testing unit/slowlog
[ok]: SDIFF with two sets - hashtable
[ok]: SDIFF with three sets - hashtable
[ok]: SDIFFSTORE with three sets - hashtable
[ok]: Short read: Utility should confirm the AOF is not valid
[ok]: Linked list: SORT BY key
[ok]: BRPOPLPUSH with wrong destination type
[ok]: BRPOPLPUSH with multiple blocked clients
[ok]: Linked BRPOPLPUSH
[ok]: Circular BRPOPLPUSH
[ok]: Short read: Utility should be able to fix the AOF
[ok]: HKEYS - big hash
[ok]: HVALS - small hash
[ok]: Self-referential BRPOPLPUSH
[ok]: BRPOPLPUSH inside a transaction
[ok]: Linked list: SORT BY hash field
[ok]: HVALS - big hash
[ok]: HGETALL - small hash
[ok]: SLOWLOG - check that it starts with an empty log
[ok]: Fixed AOF: Server should have been started
[ok]: Fixed AOF: Keyspace should contain values that were parsable
[ok]: SLOWLOG - only logs commands taking more time than specified
[ok]: Generated sets must be encoded as intset
[ok]: SLOWLOG - max entries is correctly handled
[ok]: SLOWLOG - GET optional argument to limit output len works
[ok]: SINTER with two sets - intset
[ok]: SINTERSTORE with two sets - intset
[ok]: SINTERSTORE with two sets, after a DEBUG RELOAD - intset
[ok]: SLOWLOG - RESET subcommand works
[ok]: SUNION with two sets - intset
[ok]: SLOWLOG - logged entry sanity check
[ok]: SLOWLOG - commands with too many arguments are trimmed
[ok]: SLOWLOG - too long arguments are trimmed
[ok]: SUNIONSTORE with two sets - intset
[ok]: SINTER against three sets - intset
[ok]: SINTERSTORE with three sets - intset
[ok]: HGETALL - big hash
[ok]: HDEL and return value
[ok]: HDEL - more than a single value
[ok]: HDEL - hash becomes empty before deleting all specified fields
[ok]: HEXISTS
[ok]: Is a zipmap encoded Hash promoted on big payload?
[ok]: HINCRBY against non existing database key
[ok]: HINCRBY against non existing hash key
[ok]: HINCRBY against hash key created by hincrby itself
[ok]: SUNION with non existing keys - intset
[ok]: SDIFF with two sets - intset
[ok]: SDIFF with three sets - intset
[ok]: HINCRBY against hash key originally set with HSET
[ok]: HINCRBY over 32bit value
[ok]: HINCRBY over 32bit value with over 32bit increment
[ok]: SDIFFSTORE with three sets - intset
[ok]: SINTER against non-set should throw error
[ok]: SUNION against non-set should throw error
[ok]: SINTERSTORE against non existing keys should delete dstkey
[ok]: SUNIONSTORE against non existing keys should delete dstkey
[ok]: HINCRBY fails against hash value with spaces
[ok]: HINCRBY can detect overflows
[ok]: Hash zipmap regression test for large keys
[ok]: SPOP basics - hashtable
[ok]: SRANDMEMBER - hashtable
[ok]: SPOP basics - intset
[ok]: SRANDMEMBER - intset
[6/23 done]: unit/slowlog (2 seconds)
Testing unit/maxmemory
[ok]: SMOVE basics - from regular set to intset
[ok]: SMOVE basics - from intset to regular set
[ok]: SMOVE non existing key
[ok]: SMOVE non existing src set
[ok]: SMOVE from regular set to non existing destination set
[ok]: SMOVE from intset to non existing destination set
[ok]: SMOVE wrong src key type
[ok]: SMOVE wrong dst key type
[ok]: AOF+SPOP: Server should have been started
[ok]: AOF+SPOP: Set should have 1 member
[7/23 done]: unit/type/hash (5 seconds)
Testing unit/introspection
[ok]: BRPOPLPUSH timeout
[ok]: BLPOP: with single empty list argument
[ok]: BLPOP: with negative timeout
[ok]: BLPOP: with non-integer timeout
[ok]: Protocol desync regression test #2
[ok]: CLIENT LIST
[ok]: EXPIRE - After 6 seconds the key should no longer be here
[ok]: EXPIRE - write on expire should work
[ok]: EXPIREAT - Check for EXPIRE alike behavior
[ok]: SETEX - Set + Expire combo operation. Check for TTL
[ok]: SETEX - Check value
[ok]: SETEX - Overwrite old key
[ok]: AOF+EXPIRE: Server should have been started
[ok]: AOF+EXPIRE: List should be empty
[ok]: BLPOP: with zero timeout should block indefinitely
[ok]: BLPOP: second argument is not a list
[8/23 done]: unit/introspection (1 seconds)
[ok]: Redis should not try to convert DEL into EXPIREAT for EXPIRE -1
[ok]: BLPOP: timeout
[ok]: BLPOP: arguments are empty
[ok]: BRPOP: with single empty list argument
[ok]: BRPOP: with negative timeout
[ok]: BRPOP: with non-integer timeout
[9/23 done]: integration/aof (6 seconds)
[ok]: Protocol desync regression test #3
[ok]: FUZZ stresser with data model binary
[ok]: BRPOP: with zero timeout should block indefinitely
[ok]: BRPOP: second argument is not a list
[ok]: maxmemory - is the memory limit honoured? (policy allkeys-random)
[10/23 done]: unit/protocol (9 seconds)
[ok]: SETEX - Wait for the key to expire
[ok]: SETEX - Wrong time parameter
[ok]: PERSIST can undo an EXPIRE
[ok]: PERSIST returns 0 against non existing or non volatile keys
[11/23 done]: unit/expire (10 seconds)
[ok]: Second server should have role master at first
[ok]: SLAVEOF should start with link status "down"
[ok]: The role should immediately be changed to "slave"
[ok]: BRPOP: timeout
[ok]: BRPOP: arguments are empty
[ok]: BLPOP inside a transaction
[ok]: LPUSHX, RPUSHX - generic
[ok]: LPUSHX, RPUSHX - linkedlist
[ok]: LINSERT - linkedlist
[ok]: LPUSHX, RPUSHX - ziplist
[ok]: LINSERT - ziplist
[ok]: LPUSHX, RPUSHX convert from ziplist to list
[ok]: Sync should have transferred keys from master
[ok]: The link status should be up
[ok]: SET on the master should immediately propagate
[ok]: FLUSHALL should replicate
[ok]: maxmemory - is the memory limit honoured? (policy allkeys-lru)
[ok]: LINSERT convert from ziplist to list
[ok]: LINDEX consistency test - ziplist
[ok]: LINDEX random access - ziplist
[ok]: Check if list is still ok after a DEBUG RELOAD - ziplist
[ok]: maxmemory - is the memory limit honoured? (policy volatile-lru)
[ok]: FUZZ stresser with data model alpha
[ok]: LINDEX consistency test - linkedlist
[ok]: ziplist implementation: value encoding and backlink
[ok]: LINDEX random access - linkedlist
[ok]: maxmemory - is the memory limit honoured? (policy volatile-random)
[ok]: Check if list is still ok after a DEBUG RELOAD - linkedlist
[ok]: LLEN against non-list value error
[ok]: LLEN against non existing key
[ok]: LINDEX against non-list value error
[ok]: LINDEX against non existing key
[ok]: LPUSH against non-list value error
[ok]: RPUSH against non-list value error
[ok]: RPOPLPUSH base case - linkedlist
[ok]: RPOPLPUSH with the same list as src and dst - linkedlist
[ok]: RPOPLPUSH with linkedlist source and existing target linkedlist
[ok]: RPOPLPUSH with linkedlist source and existing target ziplist
[ok]: RPOPLPUSH base case - ziplist
[ok]: RPOPLPUSH with the same list as src and dst - ziplist
[ok]: RPOPLPUSH with ziplist source and existing target linkedlist
[ok]: RPOPLPUSH with ziplist source and existing target ziplist
[ok]: RPOPLPUSH against non existing key
[ok]: RPOPLPUSH against non list src key
[ok]: RPOPLPUSH against non list dst key
[ok]: RPOPLPUSH against non existing src key
[ok]: Basic LPOP/RPOP - linkedlist
[ok]: Basic LPOP/RPOP - ziplist
[ok]: LPOP/RPOP against non list value
[ok]: Mass RPOP/LPOP - ziplist
[ok]: maxmemory - is the memory limit honoured? (policy volatile-ttl)
[ok]: Connect multiple slaves at the same time (issue #141)
[ok]: Mass RPOP/LPOP - linkedlist
[ok]: LRANGE basics - linkedlist
[ok]: LRANGE inverted indexes - linkedlist
[ok]: LRANGE out of range indexes including the full list - linkedlist
[ok]: LRANGE out of range negative end index - linkedlist
[ok]: LRANGE basics - ziplist
[ok]: LRANGE inverted indexes - ziplist
[ok]: LRANGE out of range indexes including the full list - ziplist
[ok]: LRANGE out of range negative end index - ziplist
[ok]: LRANGE against non existing key
[ok]: LTRIM basics - linkedlist
[ok]: LTRIM out of range negative end index - linkedlist
[ok]: LTRIM basics - ziplist
[ok]: LTRIM out of range negative end index - ziplist
[ok]: LSET - linkedlist
[ok]: LSET out of range index - linkedlist
[ok]: LSET - ziplist
[ok]: LSET out of range index - ziplist
[ok]: LSET against non existing key
[ok]: LSET against non list value
[ok]: LREM remove all the occurrences - linkedlist
[ok]: LREM remove the first occurrence - linkedlist
[ok]: LREM remove non existing element - linkedlist
[ok]: LREM starting from tail with negative count - linkedlist
[ok]: LREM starting from tail with negative count (2) - linkedlist
[ok]: FUZZ stresser with data model compr
[ok]: LREM deleting objects that may be int encoded - linkedlist
[ok]: LREM remove all the occurrences - ziplist
[ok]: LREM remove the first occurrence - ziplist
[ok]: LREM remove non existing element - ziplist
[ok]: LREM starting from tail with negative count - ziplist
[ok]: LREM starting from tail with negative count (2) - ziplist
[ok]: LREM deleting objects that may be int encoded - ziplist
[ok]: BGSAVE
[ok]: SELECT an out of range DB
[ok]: Regression for bug 593 - chaining BRPOPLPUSH with other blocking cmds
[12/23 done]: unit/type/list (25 seconds)
[13/23 done]: integration/replication (25 seconds)
[ok]: Very big payload random access
[ok]: EXPIRES after a reload (snapshot + append only file)
[ok]: maxmemory - only allkeys-* should remove non-volatile keys (allkeys-random)
[ok]: LTRIM stress testing - linkedlist
[ok]: intsets implementation stress testing
[14/23 done]: unit/type/set (28 seconds)
[ok]: maxmemory - only allkeys-* should remove non-volatile keys (allkeys-lru)
[ok]: maxmemory - only allkeys-* should remove non-volatile keys (volatile-lru)
[ok]: ZRANGEBYSCORE fuzzy test, 100 ranges in 128 element sorted set - ziplist
[ok]: ZSETs skiplist implementation backlink consistency test - ziplist
[ok]: maxmemory - only allkeys-* should remove non-volatile keys (volatile-random)
[ok]: maxmemory - only allkeys-* should remove non-volatile keys (volatile-ttl)
[ok]: SET 10000 numeric keys and access all them in reverse order
[ok]: DBSIZE should be 10101 now
[ok]: INCR against non existing key
[ok]: INCR against key created by incr itself
[ok]: INCR against key originally set with SET
[ok]: INCR over 32bit value
[ok]: INCRBY over 32bit value with over 32bit increment
[ok]: INCR fails against key with spaces (no integer encoded)
[ok]: INCR fails against a key holding a list
[ok]: DECRBY over 32bit value with over 32bit increment, negative res
[ok]: SETNX target key missing
[ok]: SETNX target key exists
[ok]: SETNX against not-expired volatile key
[ok]: Big Linked list: SORT BY key
[ok]: ZSETs ZRANK augmented skip list stress testing - ziplist
[ok]: ZSCORE - skiplist
[ok]: ZSCORE after a DEBUG RELOAD - skiplist
[ok]: ZSET sorting stresser - skiplist
[ok]: maxmemory - policy volatile-lru should only remove volatile keys.
[ok]: PIPELINING stresser (also a regression for the old epoll bug)
[ok]: MUTLI / EXEC basics
[ok]: DISCARD
[ok]: Nested MULTI are not allowed
[ok]: MULTI where commands alter argc/argv
[ok]: WATCH inside MULTI is not allowed
[ok]: APPEND basics
[ok]: APPEND basics, integer encoded values
[ok]: MASTER and SLAVE consistency with expire
[ok]: LTRIM stress testing - ziplist
[ok]: maxmemory - policy volatile-random should only remove volatile keys.
[15/23 done]: unit/type/list-2 (46 seconds)
[16/23 done]: integration/replication-3 (45 seconds)
[ok]: APPEND fuzzing
[ok]: FLUSHDB
[ok]: Perform a final SAVE to leave a clean DB on disk
[17/23 done]: unit/other (48 seconds)
[ok]: Big Linked list: SORT BY hash field
[ok]: Intset: SORT BY key
[ok]: Intset: SORT BY hash field
[ok]: maxmemory - policy volatile-ttl should only remove volatile keys.
[18/23 done]: unit/maxmemory (44 seconds)
[ok]: SETNX against expired volatile key
[ok]: EXISTS
[ok]: Zero length value in key. SET/GET/EXISTS
[ok]: Commands pipelining
[ok]: Non existing command
[ok]: RENAME basic usage
[ok]: RENAME source key should no longer exist
[ok]: RENAME against already existing key
[ok]: RENAMENX basic usage
[ok]: RENAMENX against already existing key
[ok]: RENAMENX against already existing key (2)
[ok]: RENAME against non existing source key
[ok]: RENAME where source and dest key is the same
[ok]: RENAME with volatile key, should move the TTL as well
[ok]: RENAME with volatile key, should not inherit TTL of target key
[ok]: Hash table: SORT BY key
[ok]: Hash table: SORT BY hash field
[ok]: ZRANGEBYSCORE fuzzy test, 100 ranges in 100 element sorted set - skiplist
[ok]: ZSETs skiplist implementation backlink consistency test - skiplist
[ok]: MASTER and SLAVE dataset should be identical after complex ops
[ok]: ZSETs ZRANK augmented skip list stress testing - skiplist
[19/23 done]: integration/replication-2 (58 seconds)
[20/23 done]: unit/type/zset (59 seconds)
[ok]: Big Hash table: SORT BY key
[ok]: DEL all keys again (DB 0)
[ok]: DEL all keys again (DB 1)
[ok]: MOVE basic usage
[ok]: MOVE against key existing in the target DB
[ok]: SET/GET keys in different DBs
[ok]: MGET
[ok]: MGET against non existing key
[ok]: MGET against non-string key
[ok]: RANDOMKEY
[ok]: RANDOMKEY against empty DB
[ok]: RANDOMKEY regression 1
[ok]: GETSET (set new value)
[ok]: GETSET (replace old value)
[ok]: MSET base case
[ok]: MSET wrong number of args
[ok]: MSETNX with already existent key
[ok]: MSETNX with not existing keys
[ok]: STRLEN against non-existing key
[ok]: STRLEN against integer-encoded value
[ok]: STRLEN against plain string
[ok]: SETBIT against non-existing key
[ok]: SETBIT against string-encoded key
[ok]: SETBIT against integer-encoded key
[ok]: SETBIT against key with wrong type
[ok]: SETBIT with out of range bit offset
[ok]: SETBIT with non-bit argument
[ok]: Big Hash table: SORT BY hash field
[ok]: SORT GET #
[ok]: SORT GET 
[ok]: SORT GET (key and hash) with sanity check
[ok]: SORT BY key STORE
[ok]: SORT BY hash field STORE
[ok]: SORT DESC
[ok]: SORT ALPHA against integer encoded strings
[ok]: SORT sorted set
[ok]: SORT sorted set: +inf and -inf handling
[ok]: SORT regression for issue #19, sorting floats
[ok]: SORT with STORE returns zero if result is empty (github isse 224)
[ok]: SORT with STORE does not create empty lists (github issue 224)
[ok]: SORT speed, 100 element list BY key, 100 times
[ok]: SORT speed, 100 element list BY hash field, 100 times
[ok]: SORT speed, 100 element list directly, 100 times
[ok]: SORT speed, 100 element list BY , 100 times
[21/23 done]: unit/sort (66 seconds)
[ok]: SETBIT fuzzing
[ok]: GETBIT against non-existing key
[ok]: GETBIT against string-encoded key
[ok]: GETBIT against integer-encoded key
[ok]: SETRANGE against non-existing key
[ok]: SETRANGE against string-encoded key
[ok]: SETRANGE against integer-encoded key
[ok]: SETRANGE against key with wrong type
[ok]: SETRANGE with out of range offset
[ok]: GETRANGE against non-existing key
[ok]: GETRANGE against string value
[ok]: GETRANGE against integer-encoded value
[ok]: GETRANGE fuzzing
[22/23 done]: unit/basic (69 seconds)
[ok]: ziplist implementation: encoding stress testing
[23/23 done]: unit/type/list-3 (70 seconds)

                   The End

Execution time of different units:
  1 seconds - unit/printver
  1 seconds - unit/quit
  2 seconds - unit/auth
  2 seconds - unit/cas
  1 seconds - unit/pubsub
  2 seconds - unit/slowlog
  5 seconds - unit/type/hash
  1 seconds - unit/introspection
  6 seconds - integration/aof
  9 seconds - unit/protocol
  10 seconds - unit/expire
  25 seconds - unit/type/list
  25 seconds - integration/replication
  28 seconds - unit/type/set
  46 seconds - unit/type/list-2
  45 seconds - integration/replication-3
  48 seconds - unit/other
  44 seconds - unit/maxmemory
  58 seconds - integration/replication-2
  59 seconds - unit/type/zset
  66 seconds - unit/sort
  69 seconds - unit/basic
  70 seconds - unit/type/list-3

\o/ All tests passed without errors!

Cleanup: may take some time... OK
make[1]: ディレクトリ `/usr/local/src/redis-2.4.12/src' から出ます

All tests passed without errors!が表示されたら成功です。

インストール

テストも成功しましたので、インストールします。

$ make install
cd src && make install
make[1]: ディレクトリ `/usr/local/src/redis-2.4.12/src' に入ります
MAKE hiredis
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' に入ります
make[2]: `static' に対して行うべき事はありません.
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' から出ます
MAKE linenoise
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/linenoise' に入ります
make[2]: `linenoise_example' は更新済みです
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/linenoise' から出ます
MAKE hiredis
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' に入ります
make[2]: `static' に対して行うべき事はありません.
make[2]: ディレクトリ `/usr/local/src/redis-2.4.12/deps/hiredis' から出ます
    LINK redis-benchmark
    LINK redis-cli

Hint: To run 'make test' is a good idea ;)

mkdir -p /usr/local/bin
cp -pf redis-server /usr/local/bin
cp -pf redis-benchmark /usr/local/bin
cp -pf redis-cli /usr/local/bin
cp -pf redis-check-dump /usr/local/bin
cp -pf redis-check-aof /usr/local/bin
make[1]: ディレクトリ `/usr/local/src/redis-2.4.12/src' から出ます

/usr/local/bin にインストールされました。

設定

起動コマンドは「redis-server」になりますが、起動オプションを確認してみましょう。

$ redis-server --help
Usage: ./redis-server [/path/to/redis.conf]
       ./redis-server - (read config from stdin)
       ./redis-server --test-memory 

設定ファイルを読み込ませることが出来るようです。
そういえば、ソースを展開したところに、redis.conf ファイルがありました。

$ ls -la /usr/local/src/redis-2.4.12/redis.conf
-rw-rw-r--. 1 root root 21094  4月 30 19:27 2012 /usr/local/src/redis-2.4.12/redis.conf

これをコピーして設定ファイルを作りましょう。
設定ファイルの設置場所は、redis_init_script を参考にして作ります。

$ ls -la /usr/local/src/redis-2.4.12/utils/redis_init_script
-rwxrwxr-x. 1 root root 1098  4月 30 19:27 2012 /usr/local/src/redis-2.4.12/utils/redis_init_script
redis.conf 、redis_init_script によれば、
  • ポート番号 … 6379
  • PIDファイル … /var/run/redis_ポート番号.pid
  • 設定ファイル … /etc/redis/ポート番号.conf
  • デーモン化 … no
  • ログレベル … verbose
  • ログ出力 … 標準出力
  • データファイル名 … dump.rdb
  • データファイル設置場所 … ./
となっています。考えた結果、以下のような設定にしてみました。
  • ポート番号 … 6379
  • PIDファイル … /var/run/redis_ポート番号.pid
  • 設定ファイル … /etc/redis/ポート番号.conf
  • デーモン化 … yes
  • ログレベル … notice
  • ログ出力 … /var/log/redis_ポート番号.log
  • データファイル名 … dump_ポート番号.rdb
  • データファイル設置場所 … /var/lib/redis/
$ mkdir /etc/redis
$ mkdir /var/lib/redis
$ cp -rp /usr/local/src/redis-2.4.12/redis.conf /etc/redis/6379.conf
$ vi /etc/redis/6379.conf
$ diff -u /usr/local/src/redis-2.4.12/redis.conf /etc/redis/6379.conf
--- /usr/local/src/redis-2.4.12/redis.conf      2012-04-30 19:27:50.000000000 +0900
+++ /etc/redis/6379.conf        2012-05-02 19:09:06.251836917 +0900
@@ -14,11 +14,11 @@

 # By default Redis does not run as a daemon. Use 'yes' if you need it.
 # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
-daemonize no
+daemonize yes

 # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
 # default. You can specify a custom pid file location here.
-pidfile /var/run/redis.pid
+pidfile /var/run/redis_6379.pid

 # Accept connections on the specified port, default is 6379.
 # If port 0 is specified Redis will not listen on a TCP socket.
@@ -45,12 +45,12 @@
 # verbose (many rarely useful info, but not a mess like the debug level)
 # notice (moderately verbose, what you want in production probably)
 # warning (only very important / critical messages are logged)
-loglevel verbose
+loglevel notice

 # Specify the log file name. Also 'stdout' can be used to force
 # Redis to log on the standard output. Note that if you use standard
 # output for logging but daemonize, logs will be sent to /dev/null
-logfile stdout
+logfile /var/log/redis_6379.log

 # To enable logging to the system logger, just set 'syslog-enabled' to yes,
 # and optionally update the other syslog parameters to suit your needs.
@@ -94,7 +94,7 @@
 rdbcompression yes

 # The filename where to dump the DB
-dbfilename dump.rdb
+dbfilename dump_6379.rdb

 # The working directory.
 #
@@ -104,7 +104,7 @@
 # Also the Append Only File will be created inside this directory.
 #
 # Note that you must specify a directory here, not a file name.
-dir ./
+dir /var/lib/redis/

 ################################# REPLICATION #################################
スクリプトコピー
$ cp -rp /usr/local/src/redis-2.4.12/utils/redis_init_script /usr/local/bin

起動/停止

設定の参考にした redis_init_script を使って起動/停止します。

起動
$ redis_init_script start
Starting Redis server...

$ ps axuw | grep redis | grep -v grep
root      6216  0.0  0.5  39964  1448 ?        Ssl  19:10   0:00 /usr/local/bin/redis-server /etc/redis/6379.conf
停止
$ redis_init_script stop
Stopping ...
Redis stopped

$ ps axuw | grep redis | grep -v grep

できました。

OOMKiller対策 (add Saturday, August 17, 2013 02:30 PM JST)

起動後ログを見ると、以下のようなメッセージが出力されている事があります。

# WARNING overcommit_memory is set to 0! Background save may fail under low memo
ry condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.co
nf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this t
o take effect.

Linuxの初期設定は、"vm.overcommit_memory = 0"です。これを"1"に設定します。

$ sysctl vm.overcommit_memory
vm.overcommit_memory = 0

$ echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
$ tail -1 /etc/sysctl.conf
vm.overcommit_memory = 1

$ sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
vm.overcommit_memory = 1

$ sysctl vm.overcommit_memory
vm.overcommit_memory = 1

サービス登録

起動/停止が出来ました。今度はchkconfigでサービス登録します。
まず、「/etc/init.d」ディレクトリに、シンボリックリンクを追加します。

$ cd /etc/init.d/
$ ln -s /usr/local/bin/redis_init_script redis
$ ls -la /etc/init.d/redis
lrwxrwxrwx. 1 root root 32  5月  2 18:25 2012 /etc/init.d/redis -> /usr/local/bin/redis_init_script

「/usr/local/bin/redis_init_script」を修正します。

追加箇所
  • chkconfigコメントを追加
  • descriptionコメントを追加
  • processnameコメントを追加
  • /etc/init.d/functionsをインクルード
  • statusオプションを追加
$ vi /usr/local/bin/redis_init_script
$ diff -u /usr/local/src/redis-2.4.12/utils/redis_init_script /usr/local/bin/redis_init_script
--- /usr/local/src/redis-2.4.12/utils/redis_init_script 2012-04-30 19:27:50.000000000 +0900
+++ /usr/local/bin/redis_init_script    2012-05-02 18:40:58.459656974 +0900
@@ -2,6 +2,13 @@
 #
 # Simple Redis init.d script conceived to work on Linux systems
 # as it does use of the /proc filesystem.
+# chkconfig: 345 99 01
+# description: Startup script for the server of Redis
+# processname: Redis
+# Source function library.
+. /etc/init.d/functions
+
+PROG=Redis

 REDISPORT=6379
 EXEC=/usr/local/bin/redis-server
@@ -36,6 +43,9 @@
                 echo "Redis stopped"
         fi
         ;;
+    status)
+        status -p "$PIDFILE" $PROG
+        ;;
     *)
         echo "Please use start or stop as first argument"
         ;;
chkconfigで、サービスに登録します。
$ chkconfig --add redis
$ chkconfig --list redis
redis           0:off   1:off   2:off   3:on    4:on    5:on    6:off

登録できました。
serviceコマンドを使って、起動/停止してみましょう。

起動
$ service redis start
Starting Redis server...
ステータス
$ service redis status
Redis (pid  2424) を実行中...
停止
$ service redis stop
Stopping ...
Redis stopped

起動/停止できました。
これで、OS起動と同時にredisが起動されるはずです。

以上で、インストール完了です。


 amazon affiliate