Git Product home page Git Product logo

codis-ha's Introduction

Notes: The project is deprecated after codis 3.0

Please use new version of codis

Build Status

Usage:

go get github.com/ngaut/codis-ha

cd codis-ha

go build

codis-ha --codis-config=localhost:18087 --productName=test

codis-ha's People

Contributors

ngaut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codis-ha's Issues

这是什么问题

github.com/wandoulabs/codis/pkg/models

../../wandoulabs/codis/pkg/models/server_group.go:220: undefined: utils.SlaveNoOne
../../wandoulabs/codis/pkg/models/server_group.go:323: undefined: utils.SlaveOf

codis-ha切换主从后无法取数

安装了codis集群,并用了codis-ha。
可以实现主从切换,但是切换后,在codis-proxy访问原master中的数据,报错:
“Error: Server closed the connection”
这样虽然切换了主从,但是对外应用来说,有一部分数据无法读写。
请问是什么问题呢?

elect a best slave for promotion?

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.

安装问题

安装不成功,请问怎么解决? Google 也没有找到解决办法。

    [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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.