Optional HTTP Headers: Requires Master
When running in a clustered environment there are times when you only want an operation to happen on the current leader node. A client can fetch information in an eventually consistent fashion by communicating with the servers. The TCP client included with the multi-node version does this.
Over HTTP the
RequiresMaster header tells the node that it is not allowed to serve a read or forward a write request. If the node is the leader everything works as normal, if it isn't it responds with a
307 temporary redirect to the leader.
Run the below on the master:
Run the following on any other node: