前题:go环境已经配好;codis-proxy、codis-server、codis-config已开启
codis-server instance:
-
[root@lvtu codis-ha]# netstat -ntlp|grep codis
-
tcp 0 0 0.0.0.0:6389 0.0.0.0:* LISTEN 14181/./codis-serve
-
tcp 0 0 0.0.0.0:6399 0.0.0.0:* LISTEN 14185/./codis-serve
-
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 14177/./codis-serve
codis-ha安装与服务开启:
-
[root@lvtu ~]# go get github.com/ngaut/codis-ha
-
[root@lvtu ~]# cd /usr/local/codis/src/github.com/ngaut/
-
[root@lvtu ngaut]# cd codis-ha/
-
[root@lvtu codis-ha]# nohup ./codis-ha --codis-config=localhost:18087 --productName=test & //启动codis-ha
故障切换前:
kill 掉 master redis实例进程
-
[root@lvtu codis]# kill -9 14177
-
[root@lvtu codis-ha]# tail -f nohup.out
-
2016/05/14 23:05:20 servergroup.go:110: [warning] server maybe crashed {
-
"type": "master",
-
"group_id": 1,
-
"addr": "192.168.23.150:6379"
-
}
-
2016/05/14 23:05:20 servergroup.go:65: [info] try promote {
-
"type": "slave",
-
"group_id": 1,
-
"addr": "192.168.23.150:6389"
-
}
切换截图:
阅读(3387) | 评论(0) | 转发(0) |