mon: support leader election configuration
Right now, monitor election is handled by selecting the monitor with the lowest IP that can reach enough peers. This works fine when all monitors are the same, but as users start setting up multi-site systems they'll want to avoid an off-site monitor being the leader (with the corresponding increase in traffic). We should support users setting a priority list or something.
A more involved follow-on might involve restricting the set of monitors that the other daemons will try and connect to.
#1 Updated by Kefu Chai almost 3 years ago
with the corresponding increase in traffic
we have two sorts of traffic here
- traffic between monitors, like paxos messages, forwarded pg stat updates, osd failure reports and their replies
- traffic between monitors and their clients, subscription/updates (osdmap,monmap), cluster log, and osd failure reports, pg stat updates.
the leader monitor is always involved in the first case. in the second case, it depends on the client. as MonClient picks a random monitor when it connects to the cluster. if it picks a "closer" monitor, it will gets a faster link for the second type of traffic.
but by moving the leader monitor to where the other lives does not necessarily fix both issues: some peons could still be far away from the their clients.
maybe a better approach is to enable the MonClient to have preference to the closer monitors? if we can utilize the priority and weight in SRV1 when picking random monitor in MonClient, may it will be a more flexible approach?