Redis集群方案,Codis安装测试

时间:2020-12-06 06:34:27

本文原文连接: http://blog.csdn.net/freewebsys/article/details/44100919 转载请注明出处!

1,关于豌豆荚开源的Codis

Codis是豌豆荚使用Go和C语言开发、以代理的方式实现的一个Redis分布式集群解决方案,且完全兼容Twemproxy。Twemproxy对于上一层的应用来说, 连接Codis Proxy(Redis代理服务)和连接原生的Redis服务器没有明显的区别,上一层应用能够像使用单机的 Redis一样对待。Codis底层会处理请求的转发、不停机的数据迁移等工作, 所有底层的一切处理, 对于客户端来说是透明的。总之,可以简单的认为后台连接的是一个内存无限大的Redis服务。Codis遵循MIT开源协议发布,更多关于Codis的信息请登录其在GitHub的主页查看。

Codis 是一个分布式 Redis 解决方案, 对于上层的应用来说, 连接到 Codis Proxy 和连接原生的 Redis Server 没有明显的区别 (不支持的命令列表), 上层应用可以像使用单机的 Redis 一样使用, Codis 底层会处理请求的转发, 不停机的数据迁移等工作, 所有后边的一切事情, 对于前面的客户端来说是透明的, 可以简单的认为后边连接的是一个内存无限大的 Redis 服务.

Codis 由四部分组成:

Codis Proxy (codis-proxy) 
Codis Manager (codis-config) 
Codis Redis (codis-server) 
ZooKeeper

架构图: 
Redis集群方案,Codis安装测试

项目地址: 
https://github.com/wandoulabs/codis 
中文说明文档: 
https://github.com/wandoulabs/codis/blob/master/doc/tutorial_zh.md 
Redis 开源集群方案: 
http://www.infoq.com/cn/news/2014/11/open-source-redis-cache 
Redis 3.0 rc4已经发布了,也是一种方案可以研究下,线上系统不建议使用。

2,安装Codis&配置

参考文档: 
https://github.com/wandoulabs/codis/blob/master/doc/tutorial_zh.md#build-codis-proxy–codis-config 
首先按照golang,下载地址:https://golang.org/dl/,最新的1.4.2版本。 
如果被墙使用golang中国下载http://golangtc.com/download

<code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">cd /usr/loca/ wget https://storage<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.googleapis</span><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.com</span>/golang/go1<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.4</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.2</span><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.linux</span>-amd64<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.tar</span><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.gz</span> tar -zxvf go1<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.4</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.2</span><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.linux</span>-amd64<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.tar</span><span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.gz</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul>

设置环境变量,vi /etc/profile

<code class="hljs sql has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">#<span class="hljs-operator" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">set</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span> & codis environment GOROOT=/usr/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">local</span>/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span> PATH=$PATH:$GOROOT/bin GOPATH=/usr/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">local</span>/codis</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul>

下载codis

<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">cd /usr/<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">local</span> git clone <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">https</span>://github.com/wandoulabs/codis.git <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#将codis的pkg包拷贝到$GOPATH目录。</span> mkdir -p /usr/<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">local</span>/codis/src/github.com/wandoulabs/codis cp /usr/<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">local</span>/codis/pkg/ /usr/<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">local</span>/codis/cmd/ /usr/<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">local</span>/codis/src/github.com/wandoulabs/codis -R</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>

安装codis,需要下载依赖包。比较慢,依赖

<code class="hljs asciidoc has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">#安装编译工具 yum groupinstall "Development Tools" #执行编译测试脚本,编译go和reids。 sh /usr/local/codis/bootstrap.sh go build -o bin/codis-proxy ./cmd/proxy go build -o bin/codis-config ./cmd/cconfig make -j4 -C extern/redis-2.8.13/ make[1]: Entering directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13'</span> cd src && make all make[2]: Entering directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/src'</span> rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof <span class="hljs-strong" style="box-sizing: border-box;">*.o *</span>.gcda <span class="hljs-strong" style="box-sizing: border-box;">*.gcno *</span>.gcov redis.info lcov-html (cd ../deps && make distclean) make[3]: Entering directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps'</span> (cd hiredis && make clean) > /dev/null || true (cd linenoise && make clean) > /dev/null || true (cd lua && make clean) > /dev/null || true (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true (rm -f .make-<span class="hljs-strong" style="box-sizing: border-box;">*) make[3]: Leaving directory `/usr/local/codis/extern/redis-2.8.13/deps' (rm -f .make-*</span>) echo STD=-std=c99 -pedantic >> .make-settings echo WARN=-Wall >> .make-settings echo OPT=-O2 >> .make-settings echo MALLOC=jemalloc >> .make-settings echo CFLAGS= >> .make-settings echo LDFLAGS= >> .make-settings echo REDIS<span class="hljs-emphasis" style="box-sizing: border-box;">_CFLAGS= >> .make-settings echo REDIS_</span>LDFLAGS= >> .make-settings echo PREV<span class="hljs-emphasis" style="box-sizing: border-box;">_FINAL_</span>CFLAGS=-std=c99 -pedantic -Wall -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE<span class="hljs-emphasis" style="box-sizing: border-box;">_JEMALLOC -I../deps/jemalloc/include >> .make-settings echo PREV_</span>FINAL<span class="hljs-emphasis" style="box-sizing: border-box;">_LDFLAGS= -g -ggdb -rdynamic >> .make-settings (cd ../deps && make hiredis linenoise lua jemalloc) make[3]: Entering directory `/usr/local/codis/extern/redis-2.8.13/deps' (cd hiredis && make clean) > /dev/null || true (cd linenoise && make clean) > /dev/null || true (cd lua && make clean) > /dev/null || true (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true (rm -f .make-*) (echo "" > .make-cflags) (echo "" > .make-ldflags) MAKE hiredis cd hiredis && make static MAKE linenoise cd linenoise && make make[4]: Entering directory `/usr/local/codis/extern/redis-2.8.13/deps/linenoise' cc -Wall -Os -g -c linenoise.c MAKE lua cd lua/src && make all CFLAGS="-O2 -Wall -DLUA_</span>ANSI " MYLDFLAGS="" make[4]: Entering directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/hiredis'</span> cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c make[4]: Entering directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/lua/src'</span> cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lapi.o lapi.c MAKE jemalloc cd jemalloc && ./configure --with-jemalloc-prefix=je_</span> --enable-cc-silence CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS="" cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb hiredis.c make[4]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/linenoise'</span> cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb sds.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lcode.o lcode.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb async.c cc -O2 -Wall -DLUA_</span>ANSI -c -o ldebug.o ldebug.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o ldo.o ldo.c cc -O2 -Wall -DLUA_</span>ANSI -c -o ldump.o ldump.c ar rcs libhiredis.a net.o hiredis.o sds.o async.o make[4]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/hiredis'</span> cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lfunc.o lfunc.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lgc.o lgc.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o llex.o llex.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lmem.o lmem.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lobject.o lobject.c checking for xsltproc... /usr/bin/xsltproc checking for gcc... gcc cc -O2 -Wall -DLUA_</span>ANSI -c -o lopcodes.o lopcodes.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lparser.o lparser.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lstate.o lstate.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lstring.o lstring.c checking whether the C compiler works... cc -O2 -Wall -DLUA_</span>ANSI -c -o ltable.o ltable.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o ltm.o ltm.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lundump.o lundump.c yes checking for C compiler default output file name... a.out checking for suffix of executables... cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lvm.o lvm.c </span>cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lzio.o lzio.c checking whether we are cross compiling... cc -O2 -Wall -DLUA_</span>ANSI -c -o strbuf.o strbuf.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lauxlib.o lauxlib.c no checking for suffix of object files... cc -O2 -Wall -DLUA_</span>ANSI -c -o lbaselib.o lbaselib.c o checking whether we are using the GNU C compiler... cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o ldblib.o ldblib.c yes checking whether gcc accepts -g... cc -O2 -Wall -DLUA_</span>ANSI -c -o liolib.o liolib.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lmathlib.o lmathlib.c yes checking for gcc option to accept ISO C89... cc -O2 -Wall -DLUA_</span>ANSI -c -o loslib.o loslib.c none needed checking how to run the C preprocessor... cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o ltablib.o ltablib.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lstrlib.o lstrlib.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o loadlib.o loadlib.c cc -O2 -Wall -DLUA_</span>ANSI -c -o linit.o linit.c gcc -E cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lua_</span>cjson.o lua<span class="hljs-emphasis" style="box-sizing: border-box;">_cjson.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lua<span class="hljs-emphasis" style="box-sizing: border-box;">_struct.o lua_</span>struct.c checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o lua_</span>cmsgpack.o lua<span class="hljs-emphasis" style="box-sizing: border-box;">_cmsgpack.c cc -O2 -Wall -DLUA_</span>ANSI -c -o lua.o lua.c lua<span class="hljs-emphasis" style="box-sizing: border-box;">_cmsgpack.c: In function ‘table_</span>is<span class="hljs-emphasis" style="box-sizing: border-box;">_an_</span>array’: lua<span class="hljs-emphasis" style="box-sizing: border-box;">_cmsgpack.c:370:21: warning: variable ‘max’ set but not used [-Wunused-but-set-variable] long count = 0, max = 0, idx = 0; ^ cc -O2 -Wall -DLUA_</span>ANSI -c -o luac.o luac.c cc -O2 -Wall -DLUA<span class="hljs-emphasis" style="box-sizing: border-box;">_ANSI -c -o print.o print.c ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o strbuf.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o lua_</span>cjson.o lua<span class="hljs-emphasis" style="box-sizing: border-box;">_struct.o lua_</span>cmsgpack.o # DLL needs all object files ranlib liblua.a cc -o lua lua.o liblua.a -lm cc -o luac luac.o print.o liblua.a -lm yes make[4]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/lua/src'</span> 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 whether byte ordering is bigendian... no checking size of void <span class="hljs-strong" style="box-sizing: border-box;">*... 8 checking size of int... 4 checking size of long... 8 checking size of intmax_t... 8 checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking whether pause instruction is compilable... yes checking whether SSE2 intrinsics is compilable... yes checking for ar... ar checking whether __attribute__ syntax is compilable... yes checking whether compiler supports -fvisibility=hidden... yes checking whether compiler supports -Werror... yes checking whether tls_model attribute is compilable... no checking for a BSD-compatible install... /usr/bin/install -c checking for ranlib... ranlib checking for ld... /usr/bin/ld checking for autoconf... /usr/bin/autoconf checking for memalign... yes checking for valloc... yes checking configured backtracing method... N/A checking for sbrk... yes checking whether utrace(2) is compilable... no checking whether valgrind is compilable... no 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 for _malloc_thread_cleanup... no checking for _pthread_mutex_init_calloc_cb... no checking for TLS... yes checking whether a program using ffsl is compilable... yes checking whether atomic(9) is compilable... no checking whether Darwin OSAtomic*</span>() is compilable... no checking whether to force 32-bit _<span class="hljs-emphasis" style="box-sizing: border-box;">_sync_</span>{add,sub}<span class="hljs-emphasis" style="box-sizing: border-box;">_and_</span>fetch()... no checking whether to force 64-bit _<span class="hljs-emphasis" style="box-sizing: border-box;">_sync_</span>{add,sub}<span class="hljs-emphasis" style="box-sizing: border-box;">_and_</span>fetch()... no checking whether Darwin OSSpin*() is compilable... no checking for stdbool.h that conforms to C99... yes checking for <span class="hljs-emphasis" style="box-sizing: border-box;">_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_</span>macros.h config.status: creating include/jemalloc/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_protos.h config.status: creating include/jemalloc/internal/jemalloc_</span>internal.h config.status: creating test/test.sh config.status: creating test/include/test/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_test.h config.status: creating config.stamp config.status: creating bin/jemalloc.sh config.status: creating include/jemalloc/jemalloc_</span>defs.h config.status: creating include/jemalloc/internal/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_internal_</span>defs.h config.status: creating test/include/test/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_test_</span>defs.h config.status: executing include/jemalloc/internal/private<span class="hljs-emphasis" style="box-sizing: border-box;">_namespace.h commands config.status: executing include/jemalloc/internal/private_</span>unnamespace.h commands config.status: executing include/jemalloc/internal/public<span class="hljs-emphasis" style="box-sizing: border-box;">_symbols.txt commands config.status: executing include/jemalloc/internal/public_</span>namespace.h commands config.status: executing include/jemalloc/internal/public<span class="hljs-emphasis" style="box-sizing: border-box;">_unnamespace.h commands config.status: executing include/jemalloc/internal/size_</span>classes.h commands config.status: executing include/jemalloc/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_protos_</span>jet.h commands config.status: executing include/jemalloc/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_rename.h commands config.status: executing include/jemalloc/jemalloc_</span>mangle.h commands config.status: executing include/jemalloc/jemalloc<span class="hljs-emphasis" style="box-sizing: border-box;">_mangle_</span>jet.h commands <span class="hljs-header" style="box-sizing: border-box;">config.status: executing include/jemalloc/jemalloc.h commands ===============================================================================</span> jemalloc version : 3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340 library revision : 1 CC : gcc CPPFLAGS : -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT CFLAGS : -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -fvisibility=hidden LDFLAGS : EXTRA_</span>LDFLAGS : LIBS : -lpthread RPATH<span class="hljs-emphasis" style="box-sizing: border-box;">_EXTRA : </span>XSLTPROC : /usr/bin/xsltproc XSLROOT : 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<span class="hljs-emphasis" style="box-sizing: border-box;">_srcroot : /usr/local/codis/extern/redis-2.8.13/deps/jemalloc/ objroot : abs_</span>objroot : /usr/local/codis/extern/redis-2.8.13/deps/jemalloc/ JEMALLOC<span class="hljs-emphasis" style="box-sizing: border-box;">_PREFIX : je_</span> JEMALLOC<span class="hljs-emphasis" style="box-sizing: border-box;">_PRIVATE_</span>NAMESPACE <span class="hljs-code" style="box-sizing: border-box;"> : je_</span> install<span class="hljs-emphasis" style="box-sizing: border-box;">_suffix : autogen : 0 experimental : 1 cc-silence : 1 debug : 0 code-coverage : 0 stats : 1 prof : 0 prof-libunwind : 0 prof-libgcc : 0 prof-gcc : 0 tcache : 1 fill : 1 utrace : 0 valgrind : 0 xmalloc : 0 mremap : 0 munmap : 0 dss : 0 lazy_</span>lock : 0 <span class="hljs-header" style="box-sizing: border-box;">tls : 1 ===============================================================================</span> cd jemalloc && make CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS="" lib/libjemalloc.a make[4]: Entering directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/jemalloc'</span> gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/jemalloc.o src/jemalloc.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/arena.o src/arena.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/atomic.o src/atomic.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/base.o src/base.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/bitmap.o src/bitmap.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/chunk.o src/chunk.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/chunk_</span>dss.o src/chunk<span class="hljs-emphasis" style="box-sizing: border-box;">_dss.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/chunk<span class="hljs-emphasis" style="box-sizing: border-box;">_mmap.o src/chunk_</span>mmap.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/ckh.o src/ckh.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/ctl.o src/ctl.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/extent.o src/extent.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/hash.o src/hash.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/huge.o src/huge.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/mb.o src/mb.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/mutex.o src/mutex.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/prof.o src/prof.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/quarantine.o src/quarantine.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/rtree.o src/rtree.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/stats.o src/stats.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/tcache.o src/tcache.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D<span class="hljs-emphasis" style="box-sizing: border-box;">_GNU_</span>SOURCE -D<span class="hljs-emphasis" style="box-sizing: border-box;">_REENTRANT -Iinclude -Iinclude -o src/util.o src/util.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_</span>GNU<span class="hljs-emphasis" style="box-sizing: border-box;">_SOURCE -D_</span>REENTRANT -Iinclude -Iinclude -o src/tsd.o src/tsd.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<span class="hljs-emphasis" style="box-sizing: border-box;">_dss.o src/chunk_</span>mmap.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/quarantine.o src/rtree.o src/stats.o src/tcache.o src/util.o src/tsd.o make[4]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps/jemalloc'</span> make[3]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/deps'</span> <span class="hljs-code" style="box-sizing: border-box;"> CC adlist.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC ae.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC anet.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC dict.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC redis.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC sds.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC zmalloc.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC lzf_c.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC lzf_d.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC pqsort.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC zipmap.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC sha1.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC ziplist.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC release.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC networking.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC util.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC object.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC db.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC replication.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC rdb.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC t_string.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC t_list.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC t_set.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC t_zset.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC t_hash.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC config.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC aof.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC pubsub.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC multi.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC debug.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC sort.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC intset.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC syncio.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC migrate.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC endianconv.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC slowlog.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC scripting.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC bio.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC rio.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC rand.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC memtest.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC crc64.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC crc32.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC bitops.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC sentinel.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC notify.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC setproctitle.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC hyperloglog.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC latency.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC sparkline.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC slots.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC redis-cli.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC redis-benchmark.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC redis-check-dump.o</span> <span class="hljs-code" style="box-sizing: border-box;"> CC redis-check-aof.o</span> <span class="hljs-code" style="box-sizing: border-box;"> LINK redis-benchmark</span> <span class="hljs-code" style="box-sizing: border-box;"> LINK redis-check-aof</span> <span class="hljs-code" style="box-sizing: border-box;"> LINK redis-server</span> <span class="hljs-code" style="box-sizing: border-box;"> LINK redis-check-dump</span> <span class="hljs-code" style="box-sizing: border-box;"> LINK redis-cli</span> <span class="hljs-code" style="box-sizing: border-box;"> INSTALL redis-sentinel</span> Hint: To run <span class="hljs-emphasis" style="box-sizing: border-box;">'make test'</span> is a good idea ;) make[2]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13/src'</span> make[1]: Leaving directory <span class="hljs-smartquote" style="box-sizing: border-box;">`/usr/local/codis/extern/redis-2.8.13'</span> go test ./pkg/... ./cmd/... -race ? <span class="hljs-emphasis" style="box-sizing: border-box;">_/usr/local/codis/pkg/env [no test files] ok _</span>/usr/local/codis/pkg/models 2.253s ok <span class="hljs-emphasis" style="box-sizing: border-box;">_/usr/local/codis/pkg/proxy/cachepool 0.009s ? _</span>/usr/local/codis/pkg/proxy/group [no test files] ok <span class="hljs-emphasis" style="box-sizing: border-box;">_/usr/local/codis/pkg/proxy/parser 0.018s ? _</span>/usr/local/codis/pkg/proxy/redisconn [no test files] ? <span class="hljs-emphasis" style="box-sizing: border-box;">_/usr/local/codis/pkg/proxy/redispool [no test files] ok _</span>/usr/local/codis/pkg/proxy/router 17.146s ? <span class="hljs-emphasis" style="box-sizing: border-box;">_/usr/local/codis/pkg/proxy/router/topology [no test files] ok _</span>/usr/local/codis/pkg/utils 0.012s ok <span class="hljs-emphasis" style="box-sizing: border-box;">_/usr/local/codis/cmd/cconfig 0.019s ? _</span>/usr/local/codis/cmd/proxy [no test files]</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li><li style="box-sizing: border-box; padding: 0px 5px;">27</li><li style="box-sizing: border-box; padding: 0px 5px;">28</li><li style="box-sizing: border-box; padding: 0px 5px;">29</li><li style="box-sizing: border-box; padding: 0px 5px;">30</li><li style="box-sizing: border-box; padding: 0px 5px;">31</li><li style="box-sizing: border-box; padding: 0px 5px;">32</li><li style="box-sizing: border-box; padding: 0px 5px;">33</li><li style="box-sizing: border-box; padding: 0px 5px;">34</li><li style="box-sizing: border-box; padding: 0px 5px;">35</li><li style="box-sizing: border-box; padding: 0px 5px;">36</li><li style="box-sizing: border-box; padding: 0px 5px;">37</li><li style="box-sizing: border-box; padding: 0px 5px;">38</li><li style="box-sizing: border-box; padding: 0px 5px;">39</li><li style="box-sizing: border-box; padding: 0px 5px;">40</li><li style="box-sizing: border-box; padding: 0px 5px;">41</li><li style="box-sizing: border-box; padding: 0px 5px;">42</li><li style="box-sizing: border-box; padding: 0px 5px;">43</li><li style="box-sizing: border-box; padding: 0px 5px;">44</li><li style="box-sizing: border-box; padding: 0px 5px;">45</li><li style="box-sizing: border-box; padding: 0px 5px;">46</li><li style="box-sizing: border-box; padding: 0px 5px;">47</li><li style="box-sizing: border-box; padding: 0px 5px;">48</li><li style="box-sizing: border-box; padding: 0px 5px;">49</li><li style="box-sizing: border-box; padding: 0px 5px;">50</li><li style="box-sizing: border-box; padding: 0px 5px;">51</li><li style="box-sizing: border-box; padding: 0px 5px;">52</li><li style="box-sizing: border-box; padding: 0px 5px;">53</li><li style="box-sizing: border-box; padding: 0px 5px;">54</li><li style="box-sizing: border-box; padding: 0px 5px;">55</li><li style="box-sizing: border-box; padding: 0px 5px;">56</li><li style="box-sizing: border-box; padding: 0px 5px;">57</li><li style="box-sizing: border-box; padding: 0px 5px;">58</li><li style="box-sizing: border-box; padding: 0px 5px;">59</li><li style="box-sizing: border-box; padding: 0px 5px;">60</li><li style="box-sizing: border-box; padding: 0px 5px;">61</li><li style="box-sizing: border-box; padding: 0px 5px;">62</li><li style="box-sizing: border-box; padding: 0px 5px;">63</li><li style="box-sizing: border-box; padding: 0px 5px;">64</li><li style="box-sizing: border-box; padding: 0px 5px;">65</li><li style="box-sizing: border-box; padding: 0px 5px;">66</li><li style="box-sizing: border-box; padding: 0px 5px;">67</li><li style="box-sizing: border-box; padding: 0px 5px;">68</li><li style="box-sizing: border-box; padding: 0px 5px;">69</li><li style="box-sizing: border-box; padding: 0px 5px;">70</li><li style="box-sizing: border-box; padding: 0px 5px;">71</li><li style="box-sizing: border-box; padding: 0px 5px;">72</li><li style="box-sizing: border-box; padding: 0px 5px;">73</li><li style="box-sizing: border-box; padding: 0px 5px;">74</li><li style="box-sizing: border-box; padding: 0px 5px;">75</li><li style="box-sizing: border-box; padding: 0px 5px;">76</li><li style="box-sizing: border-box; padding: 0px 5px;">77</li><li style="box-sizing: border-box; padding: 0px 5px;">78</li><li style="box-sizing: border-box; padding: 0px 5px;">79</li><li style="box-sizing: border-box; padding: 0px 5px;">80</li><li style="box-sizing: border-box; padding: 0px 5px;">81</li><li style="box-sizing: border-box; padding: 0px 5px;">82</li><li style="box-sizing: border-box; padding: 0px 5px;">83</li><li style="box-sizing: border-box; padding: 0px 5px;">84</li><li style="box-sizing: border-box; padding: 0px 5px;">85</li><li style="box-sizing: border-box; padding: 0px 5px;">86</li><li style="box-sizing: border-box; padding: 0px 5px;">87</li><li style="box-sizing: border-box; padding: 0px 5px;">88</li><li style="box-sizing: border-box; padding: 0px 5px;">89</li><li style="box-sizing: border-box; padding: 0px 5px;">90</li><li style="box-sizing: border-box; padding: 0px 5px;">91</li><li style="box-sizing: border-box; padding: 0px 5px;">92</li><li style="box-sizing: border-box; padding: 0px 5px;">93</li><li style="box-sizing: border-box; padding: 0px 5px;">94</li><li style="box-sizing: border-box; padding: 0px 5px;">95</li><li style="box-sizing: border-box; padding: 0px 5px;">96</li><li style="box-sizing: border-box; padding: 0px 5px;">97</li><li style="box-sizing: border-box; padding: 0px 5px;">98</li><li style="box-sizing: border-box; padding: 0px 5px;">99</li><li style="box-sizing: border-box; padding: 0px 5px;">100</li><li style="box-sizing: border-box; padding: 0px 5px;">101</li><li style="box-sizing: border-box; padding: 0px 5px;">102</li><li style="box-sizing: border-box; padding: 0px 5px;">103</li><li style="box-sizing: border-box; padding: 0px 5px;">104</li><li style="box-sizing: border-box; padding: 0px 5px;">105</li><li style="box-sizing: border-box; padding: 0px 5px;">106</li><li style="box-sizing: border-box; padding: 0px 5px;">107</li><li style="box-sizing: border-box; padding: 0px 5px;">108</li><li style="box-sizing: border-box; padding: 0px 5px;">109</li><li style="box-sizing: border-box; padding: 0px 5px;">110</li><li style="box-sizing: border-box; padding: 0px 5px;">111</li><li style="box-sizing: border-box; padding: 0px 5px;">112</li><li style="box-sizing: border-box; padding: 0px 5px;">113</li><li style="box-sizing: border-box; padding: 0px 5px;">114</li><li style="box-sizing: border-box; padding: 0px 5px;">115</li><li style="box-sizing: border-box; padding: 0px 5px;">116</li><li style="box-sizing: border-box; padding: 0px 5px;">117</li><li style="box-sizing: border-box; padding: 0px 5px;">118</li><li style="box-sizing: border-box; padding: 0px 5px;">119</li><li style="box-sizing: border-box; padding: 0px 5px;">120</li><li style="box-sizing: border-box; padding: 0px 5px;">121</li><li style="box-sizing: border-box; padding: 0px 5px;">122</li><li style="box-sizing: border-box; padding: 0px 5px;">123</li><li style="box-sizing: border-box; padding: 0px 5px;">124</li><li style="box-sizing: border-box; padding: 0px 5px;">125</li><li style="box-sizing: border-box; padding: 0px 5px;">126</li><li style="box-sizing: border-box; padding: 0px 5px;">127</li><li style="box-sizing: border-box; padding: 0px 5px;">128</li><li style="box-sizing: border-box; padding: 0px 5px;">129</li><li style="box-sizing: border-box; padding: 0px 5px;">130</li><li style="box-sizing: border-box; padding: 0px 5px;">131</li><li style="box-sizing: border-box; padding: 0px 5px;">132</li><li style="box-sizing: border-box; padding: 0px 5px;">133</li><li style="box-sizing: border-box; padding: 0px 5px;">134</li><li style="box-sizing: border-box; padding: 0px 5px;">135</li><li style="box-sizing: border-box; padding: 0px 5px;">136</li><li style="box-sizing: border-box; padding: 0px 5px;">137</li><li style="box-sizing: border-box; padding: 0px 5px;">138</li><li style="box-sizing: border-box; padding: 0px 5px;">139</li><li style="box-sizing: border-box; padding: 0px 5px;">140</li><li style="box-sizing: border-box; padding: 0px 5px;">141</li><li style="box-sizing: border-box; padding: 0px 5px;">142</li><li style="box-sizing: border-box; padding: 0px 5px;">143</li><li style="box-sizing: border-box; padding: 0px 5px;">144</li><li style="box-sizing: border-box; padding: 0px 5px;">145</li><li style="box-sizing: border-box; padding: 0px 5px;">146</li><li style="box-sizing: border-box; padding: 0px 5px;">147</li><li style="box-sizing: border-box; padding: 0px 5px;">148</li><li style="box-sizing: border-box; padding: 0px 5px;">149</li><li style="box-sizing: border-box; padding: 0px 5px;">150</li><li style="box-sizing: border-box; padding: 0px 5px;">151</li><li style="box-sizing: border-box; padding: 0px 5px;">152</li><li style="box-sizing: border-box; padding: 0px 5px;">153</li><li style="box-sizing: border-box; padding: 0px 5px;">154</li><li style="box-sizing: border-box; padding: 0px 5px;">155</li><li style="box-sizing: border-box; padding: 0px 5px;">156</li><li style="box-sizing: border-box; padding: 0px 5px;">157</li><li style="box-sizing: border-box; padding: 0px 5px;">158</li><li style="box-sizing: border-box; padding: 0px 5px;">159</li><li style="box-sizing: border-box; padding: 0px 5px;">160</li><li style="box-sizing: border-box; padding: 0px 5px;">161</li><li style="box-sizing: border-box; padding: 0px 5px;">162</li><li style="box-sizing: border-box; padding: 0px 5px;">163</li><li style="box-sizing: border-box; padding: 0px 5px;">164</li><li style="box-sizing: border-box; padding: 0px 5px;">165</li><li style="box-sizing: border-box; padding: 0px 5px;">166</li><li style="box-sizing: border-box; padding: 0px 5px;">167</li><li style="box-sizing: border-box; padding: 0px 5px;">168</li><li style="box-sizing: border-box; padding: 0px 5px;">169</li><li style="box-sizing: border-box; padding: 0px 5px;">170</li><li style="box-sizing: border-box; padding: 0px 5px;">171</li><li style="box-sizing: border-box; padding: 0px 5px;">172</li><li style="box-sizing: border-box; padding: 0px 5px;">173</li><li style="box-sizing: border-box; padding: 0px 5px;">174</li><li style="box-sizing: border-box; padding: 0px 5px;">175</li><li style="box-sizing: border-box; padding: 0px 5px;">176</li><li style="box-sizing: border-box; padding: 0px 5px;">177</li><li style="box-sizing: border-box; padding: 0px 5px;">178</li><li style="box-sizing: border-box; padding: 0px 5px;">179</li><li style="box-sizing: border-box; padding: 0px 5px;">180</li><li style="box-sizing: border-box; padding: 0px 5px;">181</li><li style="box-sizing: border-box; padding: 0px 5px;">182</li><li style="box-sizing: border-box; padding: 0px 5px;">183</li><li style="box-sizing: border-box; padding: 0px 5px;">184</li><li style="box-sizing: border-box; padding: 0px 5px;">185</li><li style="box-sizing: border-box; padding: 0px 5px;">186</li><li style="box-sizing: border-box; padding: 0px 5px;">187</li><li style="box-sizing: border-box; padding: 0px 5px;">188</li><li style="box-sizing: border-box; padding: 0px 5px;">189</li><li style="box-sizing: border-box; padding: 0px 5px;">190</li><li style="box-sizing: border-box; padding: 0px 5px;">191</li><li style="box-sizing: border-box; padding: 0px 5px;">192</li><li style="box-sizing: border-box; padding: 0px 5px;">193</li><li style="box-sizing: border-box; padding: 0px 5px;">194</li><li style="box-sizing: border-box; padding: 0px 5px;">195</li><li style="box-sizing: border-box; padding: 0px 5px;">196</li><li style="box-sizing: border-box; padding: 0px 5px;">197</li><li style="box-sizing: border-box; padding: 0px 5px;">198</li><li style="box-sizing: border-box; padding: 0px 5px;">199</li><li style="box-sizing: border-box; padding: 0px 5px;">200</li><li style="box-sizing: border-box; padding: 0px 5px;">201</li><li style="box-sizing: border-box; padding: 0px 5px;">202</li><li style="box-sizing: border-box; padding: 0px 5px;">203</li><li style="box-sizing: border-box; padding: 0px 5px;">204</li><li style="box-sizing: border-box; padding: 0px 5px;">205</li><li style="box-sizing: border-box; padding: 0px 5px;">206</li><li style="box-sizing: border-box; padding: 0px 5px;">207</li><li style="box-sizing: border-box; padding: 0px 5px;">208</li><li style="box-sizing: border-box; padding: 0px 5px;">209</li><li style="box-sizing: border-box; padding: 0px 5px;">210</li><li style="box-sizing: border-box; padding: 0px 5px;">211</li><li style="box-sizing: border-box; padding: 0px 5px;">212</li><li style="box-sizing: border-box; padding: 0px 5px;">213</li><li style="box-sizing: border-box; padding: 0px 5px;">214</li><li style="box-sizing: border-box; padding: 0px 5px;">215</li><li style="box-sizing: border-box; padding: 0px 5px;">216</li><li style="box-sizing: border-box; padding: 0px 5px;">217</li><li style="box-sizing: border-box; padding: 0px 5px;">218</li><li style="box-sizing: border-box; padding: 0px 5px;">219</li><li style="box-sizing: border-box; padding: 0px 5px;">220</li><li style="box-sizing: border-box; padding: 0px 5px;">221</li><li style="box-sizing: border-box; padding: 0px 5px;">222</li><li style="box-sizing: border-box; padding: 0px 5px;">223</li><li style="box-sizing: border-box; padding: 0px 5px;">224</li><li style="box-sizing: border-box; padding: 0px 5px;">225</li><li style="box-sizing: border-box; padding: 0px 5px;">226</li><li style="box-sizing: border-box; padding: 0px 5px;">227</li><li style="box-sizing: border-box; padding: 0px 5px;">228</li><li style="box-sizing: border-box; padding: 0px 5px;">229</li><li style="box-sizing: border-box; padding: 0px 5px;">230</li><li style="box-sizing: border-box; padding: 0px 5px;">231</li><li style="box-sizing: border-box; padding: 0px 5px;">232</li><li style="box-sizing: border-box; padding: 0px 5px;">233</li><li style="box-sizing: border-box; padding: 0px 5px;">234</li><li style="box-sizing: border-box; padding: 0px 5px;">235</li><li style="box-sizing: border-box; padding: 0px 5px;">236</li><li style="box-sizing: border-box; padding: 0px 5px;">237</li><li style="box-sizing: border-box; padding: 0px 5px;">238</li><li style="box-sizing: border-box; padding: 0px 5px;">239</li><li style="box-sizing: border-box; padding: 0px 5px;">240</li><li style="box-sizing: border-box; padding: 0px 5px;">241</li><li style="box-sizing: border-box; padding: 0px 5px;">242</li><li style="box-sizing: border-box; padding: 0px 5px;">243</li><li style="box-sizing: border-box; padding: 0px 5px;">244</li><li style="box-sizing: border-box; padding: 0px 5px;">245</li><li style="box-sizing: border-box; padding: 0px 5px;">246</li><li style="box-sizing: border-box; padding: 0px 5px;">247</li><li style="box-sizing: border-box; padding: 0px 5px;">248</li><li style="box-sizing: border-box; padding: 0px 5px;">249</li><li style="box-sizing: border-box; padding: 0px 5px;">250</li><li style="box-sizing: border-box; padding: 0px 5px;">251</li><li style="box-sizing: border-box; padding: 0px 5px;">252</li><li style="box-sizing: border-box; padding: 0px 5px;">253</li><li style="box-sizing: border-box; padding: 0px 5px;">254</li><li style="box-sizing: border-box; padding: 0px 5px;">255</li><li style="box-sizing: border-box; padding: 0px 5px;">256</li><li style="box-sizing: border-box; padding: 0px 5px;">257</li><li style="box-sizing: border-box; padding: 0px 5px;">258</li><li style="box-sizing: border-box; padding: 0px 5px;">259</li><li style="box-sizing: border-box; padding: 0px 5px;">260</li><li style="box-sizing: border-box; padding: 0px 5px;">261</li><li style="box-sizing: border-box; padding: 0px 5px;">262</li><li style="box-sizing: border-box; padding: 0px 5px;">263</li><li style="box-sizing: border-box; padding: 0px 5px;">264</li><li style="box-sizing: border-box; padding: 0px 5px;">265</li><li style="box-sizing: border-box; padding: 0px 5px;">266</li><li style="box-sizing: border-box; padding: 0px 5px;">267</li><li style="box-sizing: border-box; padding: 0px 5px;">268</li><li style="box-sizing: border-box; padding: 0px 5px;">269</li><li style="box-sizing: border-box; padding: 0px 5px;">270</li><li style="box-sizing: border-box; padding: 0px 5px;">271</li><li style="box-sizing: border-box; padding: 0px 5px;">272</li><li style="box-sizing: border-box; padding: 0px 5px;">273</li><li style="box-sizing: border-box; padding: 0px 5px;">274</li><li style="box-sizing: border-box; padding: 0px 5px;">275</li><li style="box-sizing: border-box; padding: 0px 5px;">276</li><li style="box-sizing: border-box; padding: 0px 5px;">277</li><li style="box-sizing: border-box; padding: 0px 5px;">278</li><li style="box-sizing: border-box; padding: 0px 5px;">279</li><li style="box-sizing: border-box; padding: 0px 5px;">280</li><li style="box-sizing: border-box; padding: 0px 5px;">281</li><li style="box-sizing: border-box; padding: 0px 5px;">282</li><li style="box-sizing: border-box; padding: 0px 5px;">283</li><li style="box-sizing: border-box; padding: 0px 5px;">284</li><li style="box-sizing: border-box; padding: 0px 5px;">285</li><li style="box-sizing: border-box; padding: 0px 5px;">286</li><li style="box-sizing: border-box; padding: 0px 5px;">287</li><li style="box-sizing: border-box; padding: 0px 5px;">288</li><li style="box-sizing: border-box; padding: 0px 5px;">289</li><li style="box-sizing: border-box; padding: 0px 5px;">290</li><li style="box-sizing: border-box; padding: 0px 5px;">291</li><li style="box-sizing: border-box; padding: 0px 5px;">292</li><li style="box-sizing: border-box; padding: 0px 5px;">293</li><li style="box-sizing: border-box; padding: 0px 5px;">294</li><li style="box-sizing: border-box; padding: 0px 5px;">295</li><li style="box-sizing: border-box; padding: 0px 5px;">296</li><li style="box-sizing: border-box; padding: 0px 5px;">297</li><li style="box-sizing: border-box; padding: 0px 5px;">298</li><li style="box-sizing: border-box; padding: 0px 5px;">299</li><li style="box-sizing: border-box; padding: 0px 5px;">300</li><li style="box-sizing: border-box; padding: 0px 5px;">301</li><li style="box-sizing: border-box; padding: 0px 5px;">302</li><li style="box-sizing: border-box; padding: 0px 5px;">303</li><li style="box-sizing: border-box; padding: 0px 5px;">304</li><li style="box-sizing: border-box; padding: 0px 5px;">305</li><li style="box-sizing: border-box; padding: 0px 5px;">306</li><li style="box-sizing: border-box; padding: 0px 5px;">307</li><li style="box-sizing: border-box; padding: 0px 5px;">308</li><li style="box-sizing: border-box; padding: 0px 5px;">309</li><li style="box-sizing: border-box; padding: 0px 5px;">310</li><li style="box-sizing: border-box; padding: 0px 5px;">311</li><li style="box-sizing: border-box; padding: 0px 5px;">312</li><li style="box-sizing: border-box; padding: 0px 5px;">313</li><li style="box-sizing: border-box; padding: 0px 5px;">314</li><li style="box-sizing: border-box; padding: 0px 5px;">315</li><li style="box-sizing: border-box; padding: 0px 5px;">316</li><li style="box-sizing: border-box; padding: 0px 5px;">317</li><li style="box-sizing: border-box; padding: 0px 5px;">318</li><li style="box-sizing: border-box; padding: 0px 5px;">319</li><li style="box-sizing: border-box; padding: 0px 5px;">320</li><li style="box-sizing: border-box; padding: 0px 5px;">321</li><li style="box-sizing: border-box; padding: 0px 5px;">322</li><li style="box-sizing: border-box; padding: 0px 5px;">323</li><li style="box-sizing: border-box; padding: 0px 5px;">324</li><li style="box-sizing: border-box; padding: 0px 5px;">325</li><li style="box-sizing: border-box; padding: 0px 5px;">326</li><li style="box-sizing: border-box; padding: 0px 5px;">327</li><li style="box-sizing: border-box; padding: 0px 5px;">328</li><li style="box-sizing: border-box; padding: 0px 5px;">329</li><li style="box-sizing: border-box; padding: 0px 5px;">330</li><li style="box-sizing: border-box; padding: 0px 5px;">331</li><li style="box-sizing: border-box; padding: 0px 5px;">332</li><li style="box-sizing: border-box; padding: 0px 5px;">333</li><li style="box-sizing: border-box; padding: 0px 5px;">334</li><li style="box-sizing: border-box; padding: 0px 5px;">335</li><li style="box-sizing: border-box; padding: 0px 5px;">336</li><li style="box-sizing: border-box; padding: 0px 5px;">337</li><li style="box-sizing: border-box; padding: 0px 5px;">338</li><li style="box-sizing: border-box; padding: 0px 5px;">339</li><li style="box-sizing: border-box; padding: 0px 5px;">340</li><li style="box-sizing: border-box; padding: 0px 5px;">341</li><li style="box-sizing: border-box; padding: 0px 5px;">342</li><li style="box-sizing: border-box; padding: 0px 5px;">343</li><li style="box-sizing: border-box; padding: 0px 5px;">344</li><li style="box-sizing: border-box; padding: 0px 5px;">345</li><li style="box-sizing: border-box; padding: 0px 5px;">346</li><li style="box-sizing: border-box; padding: 0px 5px;">347</li><li style="box-sizing: border-box; padding: 0px 5px;">348</li><li style="box-sizing: border-box; padding: 0px 5px;">349</li><li style="box-sizing: border-box; padding: 0px 5px;">350</li></ul>

安装测试成功,就可以配置了。 
编译后的二进制文件在/usr/local/codis/bin目录下面。 
启动codis之前需要安装zookeeper。 
下载地址:http://zookeeper.apache.org/releases.html#download 
安装目录/usr/local/zookeeper

<code class="hljs perl has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">mkdir</span> /usr/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">local</span>/zookeeper/logs</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>

vi /usr/local/zookeeper/conf/zoo.cfg配置文件

<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">tickTime=<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2000</span> clientPort=<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2181</span> dataDir=<span class="hljs-regexp" style="color: rgb(0, 136, 0); box-sizing: border-box;">/usr/local</span><span class="hljs-regexp" style="color: rgb(0, 136, 0); box-sizing: border-box;">/zookeeper/data</span> dataLogDir=<span class="hljs-regexp" style="color: rgb(0, 136, 0); box-sizing: border-box;">/usr/local</span><span class="hljs-regexp" style="color: rgb(0, 136, 0); box-sizing: border-box;">/zookeeper/logs</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul>

启动zookeeper

<code class="hljs lua has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">sh /usr/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">local</span>/zookeeper/bin/zkServer.sh start</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>

启动Codis服务,之前必须启动zookeeper,sample目录有简单的集群配置。 
startall.sh脚本会同时将redis启动。

<code class="hljs sql has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;"># sh /usr/local/codis/sample/startall.sh sleep 3s _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.8.13 (6e3095dc/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6381 | `-._ `._ / _.-' | PID: 1259 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [1259] 06 Mar 09:55:30.852 # Server started, Redis version 2.8.13 [1259] 06 Mar 09:55:30.853 # WARNING overcommit_memory is <span class="hljs-operator" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">set</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>! Background save may fail under low memory condition. <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">To</span> fix this issue <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">add</span> <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'vm.overcommit_memory = 1'</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> /etc/sysctl.conf <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">and</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">then</span> reboot <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">or</span> run the command <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'sysctl vm.overcommit_memory=1'</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> this <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> take effect. [<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1259</span>] <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> Mar <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30.853</span> * The server <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">is</span> now ready <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> accept connections <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">on</span> port <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6381</span> _._ _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">``</span>__ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">''</span>-._ _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">``</span> <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`. `</span>_. <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">''</span>-._ Redis <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2.8</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.13</span> (<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6e3095</span>dc/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>) <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">64</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">bit</span> .-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">``</span> .-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">``</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`. `</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">``</span>\/ _.,_ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">''</span>-._ ( <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|'</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">` _.-'| Port: 6382 | `</span>-._ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`._ / _.-' | PID: 1260 `</span>-._ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-._ `</span>-./ _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">' _.-'</span> |<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-._`</span>-._ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-.__.-' _.-'_.-'| | `</span>-._<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-._ _.-'_.-' | http://redis.io `</span>-._ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-._`</span>-.__.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'_.-'</span> _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">' |`-._`-._ `-.__.-'</span> _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'_.-'</span>| | <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-._`</span>-._ _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'_.-'</span> | <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-._ `</span>-._<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-.__.-'_.-' _.-' `</span>-._ <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">`-.__.-' _.-' `</span>-._ _.-<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">' `-.__.-'</span> [<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1260</span>] <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> Mar <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30.846</span> # Server started, Redis version <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2.8</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.13</span> [<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1260</span>] <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> Mar <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30.846</span> # WARNING overcommit_memory <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">is</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">set</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>! Background save may fail under low memory condition. <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">To</span> fix this issue <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">add</span> <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'vm.overcommit_memory = 1'</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> /etc/sysctl.conf <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">and</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">then</span> reboot <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">or</span> run the command <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'sysctl vm.overcommit_memory=1'</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> this <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> take effect. [<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1260</span>] <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> Mar <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30.846</span> * The server <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">is</span> now ready <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> accept connections <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">on</span> port <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6382</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">add</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">with</span> a master(localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6381</span>), Notice: <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">do</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">not</span> use localhost <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">when</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">in</span> produciton <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">add</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">with</span> a master(localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6382</span>), Notice: <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">do</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">not</span> use localhost <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">when</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">in</span> produciton slots initializing... <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">add</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">with</span> a master(localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6381</span>), Notice: <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">do</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">not</span> use localhost <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">when</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">in</span> produciton { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">add</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">with</span> a master(localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6382</span>), Notice: <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">do</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">not</span> use localhost <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">when</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">in</span> produciton { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } slots initializing... { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } done <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">set</span> slot ranges <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> server groups... { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } done shut down proxy_1... { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } done <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">start</span> new proxy... done sleep <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">3</span>s nohup: appending <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">output</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> ‘nohup.out’ <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">33</span> main.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">98</span>: [info] dump file path: /usr/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">local</span>/codis/bin <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">33</span> main.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">106</span>: [info] running <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">on</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.0</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.0</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.0</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">19000</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">33</span> helper.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">312</span>: [info] &{proxyId:proxy_1 productName:test zkAddr:localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2181</span> f:<nil> netTimeout:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span> proto:tcp} <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">33</span> router.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">628</span>: [info] <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">start</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">with</span> configuration: &{proxyId:proxy_1 productName:test zkAddr:localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2181</span> f:<nil> netTimeout:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span> proto:tcp} <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">33</span> router.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">652</span>: [info] proxy_info:{Id:proxy_1 Addr:<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">19000</span> LastEvent: LastEventTs:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> State:offline Description: DebugVarAddr:<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11000</span>} <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">09</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">55</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">34</span> router.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">615</span>: [fatal] zk: could <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">not</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">connect</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> a server <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">51</span> main.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">98</span>: [info] dump file path: /usr/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">local</span>/codis/bin <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">51</span> main.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">106</span>: [info] running <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">on</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.0</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.0</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">.0</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">19000</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">51</span> helper.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">312</span>: [info] &{proxyId:proxy_1 productName:test zkAddr:localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2181</span> f:<nil> netTimeout:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span> proto:tcp} <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">51</span> router.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">628</span>: [info] <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">start</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">with</span> configuration: &{proxyId:proxy_1 productName:test zkAddr:localhost:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2181</span> f:<nil> netTimeout:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span> proto:tcp} <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">51</span> router.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">652</span>: [info] proxy_info:{Id:proxy_1 Addr:<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">19000</span> LastEvent: LastEventTs:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> State:offline Description: DebugVarAddr:<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11000</span>} <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">03</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">06</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">51</span> router.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">go</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">600</span>: [warning] proxy_1 wait <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> be online <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">set</span> proxy_1 online { <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"msg"</span>: <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"OK"</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"ret"</span>: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span> } done</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li><li style="box-sizing: border-box; padding: 0px 5px;">27</li><li style="box-sizing: border-box; padding: 0px 5px;">28</li><li style="box-sizing: border-box; padding: 0px 5px;">29</li><li style="box-sizing: border-box; padding: 0px 5px;">30</li><li style="box-sizing: border-box; padding: 0px 5px;">31</li><li style="box-sizing: border-box; padding: 0px 5px;">32</li><li style="box-sizing: border-box; padding: 0px 5px;">33</li><li style="box-sizing: border-box; padding: 0px 5px;">34</li><li style="box-sizing: border-box; padding: 0px 5px;">35</li><li style="box-sizing: border-box; padding: 0px 5px;">36</li><li style="box-sizing: border-box; padding: 0px 5px;">37</li><li style="box-sizing: border-box; padding: 0px 5px;">38</li><li style="box-sizing: border-box; padding: 0px 5px;">39</li><li style="box-sizing: border-box; padding: 0px 5px;">40</li><li style="box-sizing: border-box; padding: 0px 5px;">41</li><li style="box-sizing: border-box; padding: 0px 5px;">42</li><li style="box-sizing: border-box; padding: 0px 5px;">43</li><li style="box-sizing: border-box; padding: 0px 5px;">44</li><li style="box-sizing: border-box; padding: 0px 5px;">45</li><li style="box-sizing: border-box; padding: 0px 5px;">46</li><li style="box-sizing: border-box; padding: 0px 5px;">47</li><li style="box-sizing: border-box; padding: 0px 5px;">48</li><li style="box-sizing: border-box; padding: 0px 5px;">49</li><li style="box-sizing: border-box; padding: 0px 5px;">50</li><li style="box-sizing: border-box; padding: 0px 5px;">51</li><li style="box-sizing: border-box; padding: 0px 5px;">52</li><li style="box-sizing: border-box; padding: 0px 5px;">53</li><li style="box-sizing: border-box; padding: 0px 5px;">54</li><li style="box-sizing: border-box; padding: 0px 5px;">55</li><li style="box-sizing: border-box; padding: 0px 5px;">56</li><li style="box-sizing: border-box; padding: 0px 5px;">57</li><li style="box-sizing: border-box; padding: 0px 5px;">58</li><li style="box-sizing: border-box; padding: 0px 5px;">59</li><li style="box-sizing: border-box; padding: 0px 5px;">60</li><li style="box-sizing: border-box; padding: 0px 5px;">61</li><li style="box-sizing: border-box; padding: 0px 5px;">62</li><li style="box-sizing: border-box; padding: 0px 5px;">63</li><li style="box-sizing: border-box; padding: 0px 5px;">64</li><li style="box-sizing: border-box; padding: 0px 5px;">65</li><li style="box-sizing: border-box; padding: 0px 5px;">66</li><li style="box-sizing: border-box; padding: 0px 5px;">67</li><li style="box-sizing: border-box; padding: 0px 5px;">68</li><li style="box-sizing: border-box; padding: 0px 5px;">69</li><li style="box-sizing: border-box; padding: 0px 5px;">70</li><li style="box-sizing: border-box; padding: 0px 5px;">71</li><li style="box-sizing: border-box; padding: 0px 5px;">72</li><li style="box-sizing: border-box; padding: 0px 5px;">73</li><li style="box-sizing: border-box; padding: 0px 5px;">74</li><li style="box-sizing: border-box; padding: 0px 5px;">75</li><li style="box-sizing: border-box; padding: 0px 5px;">76</li><li style="box-sizing: border-box; padding: 0px 5px;">77</li><li style="box-sizing: border-box; padding: 0px 5px;">78</li><li style="box-sizing: border-box; padding: 0px 5px;">79</li><li style="box-sizing: border-box; padding: 0px 5px;">80</li><li style="box-sizing: border-box; padding: 0px 5px;">81</li><li style="box-sizing: border-box; padding: 0px 5px;">82</li><li style="box-sizing: border-box; padding: 0px 5px;">83</li><li style="box-sizing: border-box; padding: 0px 5px;">84</li><li style="box-sizing: border-box; padding: 0px 5px;">85</li><li style="box-sizing: border-box; padding: 0px 5px;">86</li><li style="box-sizing: border-box; padding: 0px 5px;">87</li><li style="box-sizing: border-box; padding: 0px 5px;">88</li><li style="box-sizing: border-box; padding: 0px 5px;">89</li><li style="box-sizing: border-box; padding: 0px 5px;">90</li><li style="box-sizing: border-box; padding: 0px 5px;">91</li><li style="box-sizing: border-box; padding: 0px 5px;">92</li><li style="box-sizing: border-box; padding: 0px 5px;">93</li><li style="box-sizing: border-box; padding: 0px 5px;">94</li><li style="box-sizing: border-box; padding: 0px 5px;">95</li><li style="box-sizing: border-box; padding: 0px 5px;">96</li><li style="box-sizing: border-box; padding: 0px 5px;">97</li><li style="box-sizing: border-box; padding: 0px 5px;">98</li><li style="box-sizing: border-box; padding: 0px 5px;">99</li><li style="box-sizing: border-box; padding: 0px 5px;">100</li><li style="box-sizing: border-box; padding: 0px 5px;">101</li></ul>

启动之后就可以看到zookeeper里面的数据了。

<code class="hljs sql has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">[zk: localhost:2181(CONNECTED) 8] ls /zk/codis/db_test [migrate_manager, fence, migrate_tasks, <span class="hljs-operator" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">LOCK</span>, slots, actions, servers, proxy]</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul>

3,管理界面显示

启动之后就可以访问admin页面了。 
Redis集群方案,Codis安装测试 
数据迁移界面 
Redis集群方案,Codis安装测试 
整个桶结构 
Redis集群方案,Codis安装测试

4,总结

Codis可以完美的解决Redis集群问题,在目前Redis 3.0版本还不是很稳定的情况下,是非常不错的解决方案。支持数据扩展。 
但是并不是所有的redis命令都支持。

如果你使用以下命令:

<code class="hljs sql has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background: transparent;">KEYS, MOVE, OBJECT, <span class="hljs-operator" style="box-sizing: border-box;">RENAME, RENAMENX, SORT, SCAN, BITOP,MSETNX, BLPOP, BRPOP, BRPOPLPUSH, PSUBSCRIBE,PUBLISH, PUNSUBSCRIBE, SUBSCRIBE, UNSUBSCRIBE, DISCARD, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">EXEC</span>, MULTI, UNWATCH, WATCH, SCRIPT <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">EXISTS</span>, SCRIPT FLUSH, SCRIPT KILL, SCRIPT <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">LOAD</span>, AUTH, ECHO, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">SELECT</span>, BGREWRITEAOF, BGSAVE, CLIENT KILL, CLIENT LIST, CONFIG <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">GET</span>, CONFIG <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">SET</span>, CONFIG RESETSTAT, DBSIZE, DEBUG OBJECT, DEBUG SEGFAULT, FLUSHALL, FLUSHDB, INFO, LASTSAVE, MONITOR, SAVE, SHUTDOWN, SLAVEOF, SLOWLOG, SYNC, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">TIME</span></span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>

是无法直接迁移到 Codis 上的. 你需要修改你的代码, 用其他的方式实现.