Giter Club home page Giter Club logo

Comments (5)

otoolep avatar otoolep commented on May 17, 2024

When you say "change the leader" you mean the cluster elects a new leader, right? I just want to be sure.

If I understand this issue, it's basically the same as wanting redirects, right? If we had that, this wouldn't be an issue, correct?

from rqlite.

otoolep avatar otoolep commented on May 17, 2024

The cluster now has basic leader redirection, though I have not performed extensive testing. I just checked that curl -L .... is redirected to the leader node. Let me know how it goes.

from rqlite.

dessalines avatar dessalines commented on May 17, 2024

When you say "change the leader" you mean the cluster elects a new leader, right? I just want to be sure.

Yep that's correct.

I just did some testing and it looks like things are okay! I set up the 3 node example, took down node.1(the first leader). And the outputs look good.

Node 3 was arbitarily chosen as the new leader when I did this:

curl localhost:4002/raft?pretty
{
    "leader": "1d4e168",
    "name": "7d2502e",
    "peers": {
        "1b2bcd5": {
            "name": "1b2bcd5",
            "connectionString": "http://localhost:4001"
        },
        "1d4e168": {
            "name": "1d4e168",
            "connectionString": "http://localhost:4003"
        }
    },
    "state": "follower"
}
 curl localhost:4003/raft?pretty
{
    "leader": "1d4e168",
    "name": "1d4e168",
    "peers": {
        "1b2bcd5": {
            "name": "1b2bcd5",
            "connectionString": "http://localhost:4001"
        },
        "7d2502e": {
            "name": "7d2502e",
            "connectionString": "http://localhost:4002"
        }
    },
    "state": "leader"

One minor issue though, it doesn't look like the -L parameter works with the raft endpoint. Node 3 is the leader in my case, but the raft endpoint for node 2 still shows node 2's data.

curl -L localhost:4002/raft?pretty
{
    "leader": "1d4e168",
    "name": "7d2502e",
    "peers": {
        "1b2bcd5": {
            "name": "1b2bcd5",
            "connectionString": "http://localhost:4001"
        },
        "1d4e168": {
            "name": "1d4e168",
            "connectionString": "http://localhost:4003"
        }
    },
    "state": "follower"

IMO, this doesn't really matter because the same node's raft endpoint tells you enough data anyway.

Looking back over my first post in this thread, I'm seeing that I made an error and that rqlite is actually doing the leader reselection perfectly.

You can close this out if you like. Remember to add the -L page to your Readme. Thanks a ton man, this stuff is pretty exciting for me.

from rqlite.

otoolep avatar otoolep commented on May 17, 2024

Let me look into the issue you mentioned above, but that is a good idea about adding -L to the README.

from rqlite.

otoolep avatar otoolep commented on May 17, 2024

Ok, yeah, I only put leader redirection in place for the write endpoint. If you want stats, diags, etc, you need to go out and hit each node individually. Let me know if this is an issue.

from rqlite.

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.