Code Monkey home page Code Monkey logo

Comments (5)

tidwall avatar tidwall commented on May 19, 2024

Hi Aaron, The RAFTPEERS command will return a list of the peers and their status.

127.0.0.1:7481> raftpeers
1) "127.0.0.1:7481"
2) "Leader"
3) "127.0.0.1:7482"
4) "Follower"
5) "127.0.0.1:7483"
6) "Follower"

This is useful if you want to look for failures or log leadership changes, such as for cluster diagnostics.

Even with a sane cluster with all nodes running 100%, there will occasionally be leadership changes. As long as your client connection follows the -TRY <addr> responses and updates the leader, you should be good.

from summitdb.

thisisaaronland avatar thisisaaronland commented on May 19, 2024

Thanks!

I now appear to be bumping up against the "What is redigo actually returning..." problem similar to an issue I filed for Tile-38.

I tried the OUTPUT json trick but it doesn't appear that SummitDB knows about this? Thoughts?

https://github.com/thisisaaronland/go-artisanal-integers/compare/peers

./bin/int -engine summitdb -dsn 'redis://localhost:7482'
2017/03/27 20:19:26 [[49 50 55 46 48 46 48 46 49 58 55 52 56 49] [73 110 118 97 108 105 100] [49 50 55 46 48 46 48 46 49 58 55 52 56 50] [70 111 108 108 111 119 101 114] [49 50 55 46 48 46 48 46 49 58 55 52 56 51] [76 101 97 100 101 114]]

from summitdb.

tidwall avatar tidwall commented on May 19, 2024

That's an array of bulk strings. The redis.Strings(conn.Do("RAFTPEERS")) should work.

from summitdb.

thisisaaronland avatar thisisaaronland commented on May 19, 2024

Bingo, thanks! One day I will figure out redigo responses...

./bin/int -engine summitdb -dsn 'redis://localhost:7482'
2017/03/27 20:49:28 127.0.0.1:7481
2017/03/27 20:49:28 Invalid
2017/03/27 20:49:28 127.0.0.1:7482
2017/03/27 20:49:28 Follower
2017/03/27 20:49:28 127.0.0.1:7483
2017/03/27 20:49:28 Leader
summitdb told me to try redis://127.0.0.1:7483 instead, so here we go...

from summitdb.

tidwall avatar tidwall commented on May 19, 2024

I agree. Redigo can take a little getting use to.

from summitdb.

Related Issues (20)

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.