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"
- }