在网上找了很多codis的集群安装方法,看起来都是大同小异,本人结合了大多种方法完成了一套自己使用的codis的集群安装,可以供大家学习使用,如果有什么问题或者不懂的地方欢迎指正
1.集群规划:
三台机器:192.168.0.207 192.168.0.213 192.168.0.214 确保每台都有zookper 注意,下面有一部分crxy93 96 97 分别对应207 213 214
codis-dashboard 192.168.0.207 改服务器服务器需要部署的东西
codis-fe 192.168.0.207
codis-ha 192.168.0.207 192.168.0.207
codis-proxy1 codis-proxy2 codis-proxy3 如果codis-proxy1 codis_group1_M(6379)挂了 会自动切换到下面节点上后面的也是
codis_group1_M(6379) codis_group2_M(6379) codis_group3_M(6379)
codis_group3_S(6380) codis_group1_S(6380) codis_group2_S(6380)
下面的图是整个集群的工作流程
2.目录规划: mkdir -p 创建目录
日志目录: /codisapp/logs/codis
配置文件目录: /codisapp/conf/codis
pid文件目录: /codisapp/run/codis
相关启动脚本目录: /codisapp/sh/codis
codis-server数据目录: /codisapp/dbdat/redis_data_6379 /codisapp/dbdat/redis_data_6380
3 集群基础环境安装:(具体视本地环境调整) 注意!下面步骤三台需要同时安装!
(1)安装jdk1.7
tar -zxvf jdk-7u71-linux-x64.tar.gz
将java环境变量添加至/etc/profile下
export JAVA_HOME=/usr/local/jdk
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
配置完成输入source /etc/profile 命令使其生效、之后在输入java -version 查看jdk是否生效
(2)安装zookeeper(保证奇数个节点,其他视具体情况)
(2.1)上传zookeeper至/usr/local/ 下并解压: tar -zxvf zookeeper-3.4.6.tar.gz
(2.2)重命名 mv zookeeper-3.4.6 zookeeper
(2.3)把conf/zoo_sample.cfg重命名为conf/zoo.cfg
(2.4) vi zoo.cfg
a、修改 dataDir=/usr/local/zookeeper/data
b、添加:
server.1=cdh205:2888:3888
server.2=cdh213:2888:3888
server.3=cdh214:2888:3888
c、创建data文件夹: mkdir zookeeper/data
d、echo 1 >data/myid
(2.5) 把zookeeper复制到cdh213 cdh214上去
scp -rq zookeeper/ cdh213:/usr/local/
scp -rq zookeeper/ cdh214:/usr/local/
(2.6) 修改myid:
cdh213 : echo 2 >zookeeper/data/myid
cdh214 : echo 3 >zookeeper/data/myid
(3)编译codis: 下载到/usr/local目录下
3.1)codis版本:3.0.3 版本 https://github.com/CodisLabs/codis/archive/3.0.3.zip
(3.2) go使用版本:go1.5.2.linux-amd64.tar.gz https://golang.org/doc/install?download=go1.5.2.linux-amd64.tar.gz
(3.3) 安装编译环境前的一些依赖安装(三台主机上执行)
yum install -y gcc make gcc-c++ automake lrzsz openssl-devel zlib-* bzip2-* readline* zlib-* bzip2-* git
yum install -y nmap unzip wget lsof xz net-tools mercurial
(3.4)修改:
vi /etc/sysctl.conf
vm.overcommit_memory = 1
sysctl vm.overcommit_memory=1
手工执行:echo never > /sys/kernel/mm/transparent_hugepage/enabled
并加到:/etc/rc.local中
(4)安装go环境:
tar -zxvf /usr/local/go1.5.2.linux-amd64.tar.gz
创建工作路径:
mkdir /root/gopkg
修改 /etc/profile文件
vi /etc/profile
#profile文件修改如下,注意这里是添加环境变量,视具体情况而定
export GOROOT=/usr/local/go
export GOPATH=/root/gopkg
export PATH=$GOROOT/bin:$PATH
使环境变量生效: source /etc/profile
查看go版本:
[root@mvxl2579 tmp]# go version
go version go1.5.2 linux/amd64
(5)配置dns解析:
vi /etc/resolv.conf
nameserver 10.16.0.100
nameserver 10.16.15.110
nameserver 114.114.114.114
(6)goderp安装:
(6.1)创建指定目录
mkdir -p $GOPATH/src/github.com/tools
cd $GOPATH/src/github.com/tools
(6.2)
go get -u github.com/tools/godep
[root@mvxl2579 tools]# cd godep
[root@mvxl2579 godep]# go install ./ ---该命令会将 godep 生成到 $GOPATH/bin 下
将$GOPATH/bin加到/etc/profile中:
vi /etc/profile
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
source /etc/profile
[root@mvxl2579 godep]# which godep
/root/gopkg/bin/godep
[root@mvxl2579 godep]# godep version
godep v72 (linux/amd64/go1.5.2)
(7)解压codis包
unzip /usr/local/codis-3.0.3.zip
创建目录
mkdir -p /root/gopkg/src/github.com/CodisLabs
将解压的包复制在指定目录
cp -r /usr/local/codis-3.0.3 /root/gopkg/src/github.com/CodisLabs/codis
进入到改目录下
cd /root/gopkg/src/github.com/CodisLabs/codis
(7.1)执行make(这里一定要注意,回去google上下载一些包,使用FQ软件,下载 ,如果没报错就不需要FQ。)
执行全部指令后,会在 bin 文件夹内生成
codis-admin
codis-dashboard
codis-fe
codis-ha
codis-proxy
codis-server
六个可执行文件.另外, bin/assets 文件夹是 codis-dashboard http 服务需要的前端资源, 需要和codis-dashboard 放置在同一文件夹下。
[root@mvxl2579 codis]# cd bin
[root@mvxl2579 bin]# ls -ltr
total 71156
-rwxr-xr-x 1 root root 6311067 May 31 09:02 codis-server
-rw-r--r-- 1 root root 96 May 31 09:02 version
-rwxr-xr-x 1 root root 18415720 May 31 09:10 codis-dashboard
-rwxr-xr-x 1 root root 11056192 May 31 09:10 codis-proxy
-rwxr-xr-x 1 root root 17600776 May 31 09:10 codis-admin
-rwxr-xr-x 1 root root 9957704 May 31 09:10 codis-ha
-rwxr-xr-x 1 root root 9498560 May 31 09:10 codis-fe
drwxr-xr-x 4 root root 4096 May 31 09:10 assets
(7.1)下面的mkdir 需三台机器都执行
mkdir /codisapp/svr/codis
mkdir -p /codisapp/conf/codis
mkdir -p /codisapp/logs/codis
mkdir -p /codisapp/sh/codis
mkdir -p /codisapp/run/codis/
mkdir -p /codisapp/dbdat/redis_data_6379
mkdir -p /codisapp/dbdat/redis_data_6380
cp -r /root/gopkg/src/github.com/CodisLabs/codis/bin /codisapp/svr/codis/
由于codis 本身只有codis-server,没有redis-cli,需要把redis 2.8.21 安装包里面的几个程序 redis-benchmark redis-check-aof redis-check-dump redis-cli
copy到/codisapp/svr/codis/bin
(7.2)进入到redis目录下将四个文件拷贝到bin目录三个机器都要执行
[root@mvxl2579 redis-2.8.21]# cd /root/gopkg/src/github.com/CodisLabs/codis/extern/redis-2.8.21
[root@mvxl2579 redis-2.8.21]# cp redis-benchmark /codisapp/svr/codis/bin
[root@mvxl2579 redis-2.8.21]# cp redis-check-aof /codisapp/svr/codis/bin
[root@mvxl2579 redis-2.8.21]# cp redis-check-dump /codisapp/svr/codis/bin
[root@mvxl2579 redis-2.8.21]# cp redis-cli /codisapp/svr/codis/bin
[root@mvxl2579 redis-2.8.21]# cd /root/gopkg/src/github.com/CodisLabs/codis/extern/redis-2.8.21/src
(7.3)codis copy 到其他机器:
[root@mvxl2579 redis-2.8.21]# scp -r /codisapp/svr/codis/bin 192.168.0.213:/codisapp/svr/codis/
[root@mvxl2579 redis-2.8.21]# scp -r /codisapp/svr/codis/bin 192.168.0.214:/codisapp/svr/codis/
3.配置各个组件:
(1)配置 Codis 的Redis
配置文件 : /codisapp/conf/codis/redis6379.conf 里面设置密码: xxxxx ---这里也可以不设置密码
(2)考虑性能,主库关闭aof和rdp,从库只开启aof:
cd /root/gopkg/src/github.com/CodisLabs/codis/extern/redis-2.8.21/
cp redis.conf /codisapp/conf/codis/redis6379.conf
cp redis.conf /codisapp/conf/codis/redis6380.conf
(3)将redis6379.conf更改以下参数(主库):
[root@mvxl2579 redis-2.8.21]# vi /codisapp/conf/codis/redis6379.conf (这里使用查找的方式逐个修改各个参数,不要复制粘贴,密码可以不用设置)
daemonize yes
pidfile /codisapp/run/codis/redis6379.pid
port 6379
timeout 86400
tcp-keepalive 60
loglevel notice
logfile /codisapp/logs/codis/redis6379.log
databases 16
save ""
#save 900 1 ----关闭aof
#save 300 10
#save 60 10000
stop-writes-on-bgsave-error no
rdbcompression yes
dbfilename dump6379.rdb
dir /codisapp/dbdat/redis_data_6379
masterauth "xxxxx"
slave-serve-stale-data yes
repl-disable-tcp-nodelay no
slave-priority 100
requirepass "xxxxx"
maxmemory 10gb
maxmemory-policy allkeys-lru
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite yes
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 0 0 0
client-output-buffer-limit pubsub 0 0 0
hz 10
aof-rewrite-incremental-fsync yes
repl-backlog-size 33554432
(3)将redis6380.conf更改以下参数(从库):
[root@mvxl2579 redis-2.8.21]# vi /codisapp/conf/codis/redis6380.conf (这里使用查找的方式逐个修改各个参数,不要复制粘贴,密码可以不用设置)
daemonize yes
pidfile /codisapp/run/codis/redis6380.pid
port 6380
timeout 86400
tcp-keepalive 60
loglevel notice
logfile /codisapp/logs/codis/redis6380.log
databases 16
save ""
#save 900 1 ----关闭aof
#save 300 10
#save 60 10000
stop-writes-on-bgsave-error no
rdbcompression yes
dbfilename dump6379.rdb
dir /codisapp/dbdat/redis_data_6380
masterauth "xxxxx"
slave-serve-stale-data yes
repl-disable-tcp-nodelay no
slave-priority 100
requirepass "xxxxx"
maxmemory 10gb
maxmemory-policy allkeys-lru
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite yes
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 0 0 0
client-output-buffer-limit pubsub 0 0 0
hz 10
aof-rewrite-incremental-fsync yes
repl-backlog-size 33554432
(4)做完之后将修改好的东西拷贝到其他两台电脑
[root@mvxl2579 redis-2.8.21]# cd /codisapp/conf/codis
[root@mvxl2579 redis-2.8.21]# scp -p * 192.168.0.96:/codisapp/conf/codis
[root@mvxl2579 redis-2.8.21]# scp -p * 192.168.0.97:/codisapp/conf/codis
(5)生成dashboard配置文件 下面的配置文件ip根据自己的IP进行设置
[root@mvxl2579 redis-2.8.21]# /codisapp/svr/codis/bin/codis-dashboard --default-config | tee /codisapp/conf/codis/dashboard.toml
[root@mvxl2579 redis-2.8.21]# vi /codisapp/conf/codis/dashboard.toml
##################################################
# #
# Codis-Dashboard #
# #
##################################################
# Set Coordinator, only accept "zookeeper" & "etcd"
coordinator_name = "zookeeper"
#这里的zookeeper设置根据实际情况写,不要照抄
coordinator_addr = "192.168.0.93:2181,192.168.0.94:2181,192.168.0.95:2181,192.168.0.96:2181,192.168.0.97:2181"
# Set Codis Product {Name/Auth}.
product_name = "hls_prod"
product_auth = ""
# Set bind address for admin(rpc), tcp only.
admin_addr = "192.168.0.93:18080"
(6) 生成codis-proxy配置文件
[root@mvxl2579 redis-2.8.21]# /codisapp/svr/codis/bin/codis-proxy --default-config | tee /codisapp/conf/codis/proxy.toml
[root@mvxl2579 redis-2.8.21]# vi /codisapp/conf/codis/proxy.toml
##################################################
# #
# Codis-Proxy #
# #
##################################################
# Set Codis Product {Name/Auth}.
product_name = "hls_prod"
product_auth = ""
# Set bind address for admin(rpc), tcp only.
admin_addr = "0.0.0.0:11080"
# Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
proto_type = "tcp4"
proxy_addr = "0.0.0.0:19000"
# Set jodis address & session timeout.
#这里的zookeeper设置根据实际情况写,不要照抄
jodis_addr = "192.168.0.93:2181,192.168.0.94:2181,192.168.0.95:2181,192.168.0.96:2181,192.168.0.97:2181"
jodis_timeout = 10
# Proxy will ping-pong backend redis periodly to keep-alive
backend_ping_period = 5
# If there is no request from client for a long time, the connection will be droped. Set 0 to disable.
session_max_timeout = 1800
# Buffer size for each client connection.
session_max_bufsize = 131072
# Number of buffered requests for each client connection.
# Make sure this is higher than the max number of requests for each pipeline request, or your client may be blocked.
session_max_pipeline = 1024
# Set period between keep alives. Set 0 to disable.
session_keepalive_period = 60
(7)生成codis-fe配置文件
生成配置文件:
配置文件 codis.json 可以手动编辑,也可以通过 codis-admin 从外部存储中拉取:
/codisapp/svr/codis/bin/codis-admin --dashboard-list --zookeeper=127.0.0.1:2181 | tee /codisapp/conf/codis/codis.json
(8)编写dashboard启动和停止脚本:
vi /codisapp/sh/codis/start_codis_dashboard.sh
#!/bin/sh
CODIS_HOME=/codisapp/svr/codis
nohup $CODIS_HOME/bin/codis-dashboard --ncpu=4 --config= is/dashboard.toml --log=/codisapp/logs/codis/dashboard.log --log-level=WARN &
vi /codisapp/sh/codis/stop_codis_dashboard.sh
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.93:18080 --shutdown
(9)编写codis_proxy启停脚本
vi /codisapp/sh/codis/start_codis_proxy.sh
#!/bin/sh
CODIS_HOME=/codisapp/svr/codis
# start codis-proxy
nohup $CODIS_HOME/bin/codis-proxy --ncpu=4 --config=/codisapp/conf/codis/proxy.toml --log=/codisapp/logs/codis/proxy.log --log-level=WARN &
sleep 3s
# set codis-proxy online
$CODIS_HOME/bin/codis-admin --dashboard=192.168.0.93:18080 --create-proxy -x 192.168.0.93:11080
vi /codisapp/sh/codis/stop_codis_proxy.sh
/codisapp/svr/codis/bin/codis-admin --proxy=192.168.0.93:11080 --auth="xxxxx" --shutdown
(10)编写codis_fe启停脚本
vi /codisapp/sh/codis/start_codis_fe.sh
#!/bin/sh
CODIS_HOME=/codisapp/svr/codis
nohup $CODIS_HOME/bin/codis-fe --ncpu=4 --log=/codisapp/logs/codis/fe.log --log-level=WARN --dashboard-list=/codisapp/conf/codis/codis.json --listen=192.168.0.93:8080 &
vi /codisapp/sh/codis/stop_codis_fe.sh
ps -ef|grep codis-fe|grep -v grep|awk '{print $2}'|xargs kill
(11)编写coids_ha启停脚本
vi /codisapp/sh/codis/start_codis_ha.sh
#!/bin/sh
CODIS_HOME=/codisapp/svr/codis
nohup $CODIS_HOME/bin/codis-ha --log=/codisapp/logs/codis/ha.log --log-level=WARN --dashboard=192.168.0.93:18080 &
vi /codisapp/sh/codis/stop_codis_ha.sh
ps -ef|grep codis-ha|grep -v grep|awk '{print $2}'|xargs kill
(12) 拷贝配置文件到其他两台机器上
scp /codisapp/conf/codis/dashboard.toml 192.168.0.213:/codisapp/conf/codis/dashboard.toml
scp /codisapp/conf/codis/dashboard.toml 192.168.0.214:/codisapp/conf/codis/dashboard.toml
scp /codisapp/conf/codis/proxy.toml 192.168.0.213:/codisapp/conf/codis/proxy.toml
scp /codisapp/conf/codis/proxy.toml 192.168.0.214:/codisapp/conf/codis/proxy.toml
scp /codisapp/conf/codis/codis.json 192.168.0.213:/codisapp/conf/codis/codis.json
scp /codisapp/conf/codis/codis.json 192.168.0. 214:/codisapp/conf/codis/codis.json
(13)将启动脚本拷贝到其他两台主机上。
scp -rq /codisapp/sh/codis crxy96:/codisapp/sh/codis
scp -rq /codisapp/sh/codis crxy96:/codisapp/sh/codis
并修改其中对应的 dashboard 地址 和 addr地址
比如说: crxy96上的
vi /codisapp/sh/codis/start_codis_proxy.sh
#!/bin/sh
CODIS_HOME=/codisapp/svr/codis
# start codis-proxy
nohup $CODIS_HOME/bin/codis-proxy --ncpu=4 --config=/codisapp/conf/codis/proxy.toml --log=/codisapp/logs/codis/proxy.log --log-level=WARN &
sleep 3s
# set codis-proxy online
#注意这里的--dashboard=192.168.0.93:18080 只能有一个 --create-proxy -x 192.168.0.93:11080 这里的地址要改成crxy96的地址,即192.168.0.96:11080
$CODIS_HOME/bin/codis-admin --dashboard=192.168.0.93:18080 --create-proxy -x 192.168.0.93:11080
依次类推,修改完成所有的脚本
4.启动各个组件
(1)启动redis实例 (3台机器都要启动)
/codisapp/svr/codis/bin/codis-server /codisapp/conf/codis/redis6379.conf &
/codisapp/svr/codis/bin/codis-server /codisapp/conf/codis/redis6380.conf &
(2)启动dashboard (只启动crxy93的一台)
sh /codisapp/sh/codis/start_codis_dashboard.sh
(3)启动codis-proxy (3台机器都要启动)
sh /codisapp/sh/codis/start_codis_proxy.sh
(4)启动codis-fe (只启动crxy93的一台)
sh /codisapp/sh/codis/start_codis_fe.sh
(5)启动codis-ha (启动crxy93和crxy96两台)
sh /codisapp/sh/codis/start_codis_ha.sh
(6)打开浏览器 输入http://192.168.0.93:8080/ 看是否出现codis主页
(7)查看codis-proxy个数(只启动192.168.0.207的一台))
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.93:18080 --proxy-status
[ ] proxy-1 [T] cdf5409122a19af4bb9870d713210a06 [A] 192.168.0.93:11080 [P] 192.168.0.93:19000
[ ] proxy-2 [T] cf039a1b796ac2f4f90069a909ca23e5 [A] 192.168.0.96:11080 [P] 192.168.0.96:19000
[ ] proxy-3 [T] 0d6d305a5885d4e093a97d69612220f7 [A] 192.168.0.97:11080 [P] 192.168.0.97:19000
5.配置codis实例
(1)添加组(service-group)
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --create-group --gid=1
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --create-group --gid=2
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --create-group --gid=3
(2)向组中添加coids-proxy实例
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --group-add --gid=1 --addr=192.168.0.207:6379
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --group-add --gid=1 --addr=192.168.0.214:6380
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --group-add --gid=2 --addr=192.168.0.213:6379
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --group-add --gid=2 --addr=192.168.0.207:6380
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --group-add --gid=3 --addr=192.168.0.214:6379
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --group-add --gid=3 --addr=192.168.0.213:6380
(3)master-slave同步
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --sync-action --create --addr=192.168.0.214:6380
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --sync-action --create --addr=192.168.0.213:6380
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --sync-action --create --addr=192.168.0.207:6380
(4)划分slot
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --slot-action --create-range --beg=0 --end=300 --gid=1
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --slot-action --create-range --beg=301 --end=601 --gid=2
/codisapp/svr/codis/bin/codis-admin --dashboard=192.168.0.207:18080 --slot-action --create-range --beg=602 --end=1023 --gid=3
6.验证安装是否成功
(1)进入zookeeper查看proxy在线状态,应为在线("state": "online",):
[zk: localhost:2181(CONNECTED) 11] get /codis3/hls_prod/proxy
{
"addr": "192.168.0.97:19000",
"start_at": "2016-09-25 05:05:38.456353266 -0700 PDT",
"state": "online",
"token": "0d6d305a5885d4e093a97d69612220f7"
}
cZxid = 0x3b0000007f
ctime = Sun Sep 25 05:05:27 PDT 2016
mZxid = 0x3b0000007f
mtime = Sun Sep 25 05:05:27 PDT 2016
pZxid = 0x3b0000007f
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x45760f36a420010
dataLength = 167
numChildren = 0
[zk: localhost:2181(CONNECTED) 12] get /codis3/hls_prod/proxy
{
"addr": "192.168.0.93:19000",
"start_at": "2016-09-25 05:04:55.527947055 -0700 PDT",
"state": "online",
"token": "cdf5409122a19af4bb9870d713210a06"
}
cZxid = 0x3b00000077
ctime = Sun Sep 25 05:04:58 PDT 2016
mZxid = 0x3b00000077
mtime = Sun Sep 25 05:04:58 PDT 2016
pZxid = 0x3b00000077
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x45760f36a42000e
dataLength = 167
numChildren = 0
[zk: localhost:2181(CONNECTED) 13] get /codis3/hls_prod/proxy
{
"addr": "192.168.0.96:19000",
"start_at": "2016-09-25 05:05:08.832832827 -0700 PDT",
"state": "online",
"token": "cf039a1b796ac2f4f90069a909ca23e5"
}
cZxid = 0x3b0000007b
ctime = Sun Sep 25 05:05:11 PDT 2016
mZxid = 0x3b0000007b
mtime = Sun Sep 25 05:05:11 PDT 2016
pZxid = 0x3b0000007b
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x45760f36a42000f
dataLength = 167
numChildren = 0
(2)在crxy93上启动redis-cli 6379,设置一个键值对,观察其在 crxy97 6380端口上是否能取到,如下操作
crxy93:
[root@crxy93 bin]# /codisapp/svr/codis/bin/redis-cli -c -p 6379
127.0.0.1:6379> set cuijiahao 1
OK
127.0.0.1:6379> get cuijiahao
"1"
crxy97:
[root@crxy97 bin]# /codisapp/svr/codis/bin/redis-cli -c -p 6380
127.0.0.1:6380> get cuijiahao
"1"
如果显示证明codis集群安装成功~可以使用~