Notes: The project is deprecated after codis 3.0
Please use new version of codis
Usage:
go get github.com/ngaut/codis-ha
cd codis-ha
go build
codis-ha --codis-config=localhost:18087 --productName=test
Simple HA tool for codis(https://github.com/wandoulabs/codis)
Notes: The project is deprecated after codis 3.0
Please use new version of codis
Usage:
go get github.com/ngaut/codis-ha
cd codis-ha
go build
codis-ha --codis-config=localhost:18087 --productName=test
use codis-ha,after master shutdown,slave not promote master?
我想redis添加密码验证,怎么使用codis-ha?怎么更改代码?
../../wandoulabs/codis/pkg/models/server_group.go:220: undefined: utils.SlaveNoOne
../../wandoulabs/codis/pkg/models/server_group.go:323: undefined: utils.SlaveOf
谁有打包好的codis-ha可以给我一个。。。我下载不了,万分感谢!
var ( _ AliveChecker = &redisChecker{} )
redischecker.go中这个定义的作用是什么呢?我看在acf中是返回一个实例的啊
go get github.com/ngaut/codis-ha
go: missing Git command. See http://golang.org/s/gogetcmd
package github.com/ngaut/codis-ha: exec: "git": executable file not found in $PATH
安装了codis集群,并用了codis-ha。
可以实现主从切换,但是切换后,在codis-proxy访问原master中的数据,报错:
“Error: Server closed the connection”
这样虽然切换了主从,但是对外应用来说,有一部分数据无法读写。
请问是什么问题呢?
func getSlave(master *models.Server) (*models.Server, error) {
var group models.ServerGroup
err := callHttp(&group, genUrl(*apiServer, "/api/server_group/", master.GroupId), "GET", nil)
if err != nil {
return nil, errors.Trace(err)
}
for _, s := range group.Servers {
if s.Type == models.SERVER_TYPE_SLAVE {
return &s, nil
}
}
return nil, errors.Errorf("can not find any slave in this group: %v", group)
}
If the master has more slaves, we must choose the best one which has the most up-to-date data with master, not just the first one.
I think we can use Role command to get the slave's replication offset, and elect the best one which has the biggest offset.
[root@iZj6c2oby5qekmk90n76jfZ_10.139.96.2 /data/programs]# echo $GOPATH
/data/programs/codis
[root@iZj6c2oby5qekmk90n76jfZ_10.139.96.2 /data/programs]#
[root@iZj6c2oby5qekmk90n76jfZ_10.139.96.2 /data/programs]# mkdir -p codis
[root@iZj6c2oby5qekmk90n76jfZ_10.139.96.2 /data/programs]# go get github.com/ngaut/codis-ha
# github.com/ngaut/codis-ha
codis/src/github.com/ngaut/codis-ha/servergroup.go:10: undefined: models.ServerGroup
codis/src/github.com/ngaut/codis-ha/servergroup.go:11: undefined: models.ServerGroup
codis/src/github.com/ngaut/codis-ha/servergroup.go:39: undefined: models.Server
codis/src/github.com/ngaut/codis-ha/servergroup.go:55: undefined: models.Server
codis/src/github.com/ngaut/codis-ha/servergroup.go:82: undefined: models.Server
codis/src/github.com/ngaut/codis-ha/servergroup.go:90: undefined: models.Server
codis/src/github.com/ngaut/codis-ha/servergroup.go:90: undefined: models.ServerGroup
codis/src/github.com/ngaut/codis-ha/servergroup.go:123: undefined: models.Server
codis/src/github.com/ngaut/codis-ha/servergroup.go:123: undefined: models.ServerGroup
codis/src/github.com/ngaut/codis-ha/servergroup.go:11: too many errors
[root@iZj6c2oby5qekmk90n76jfZ_10.139.96.2 /data/programs]#
mmc@debian:~$ go get github.com/ngaut/codis-ha
golang/3rdLibs/src/github.com/ngaut/codis-ha/servergroup.go:36: cannot use s (type models.Server) as type *models.Server in return argument
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.