Cluster Configuration

So PerformOnAnyNode() is a bit of a misnomer here … what it is saying is “send the write to any node” that node will forward it to the master (believe I said ^^^). Keep in mind a few things here…

  1. That node can only forward to the master if it knows who the master is (there are some edge conditions where this may not be true!)

  2. It will forward to the node it believes to be master which is handled via gossip. There are some edge conditions where this may take a few seconds to get updated in failure conditions etc

  3. By writing to any node and then forcing the forward it will necessarily be more latent than directly writing to the master on the average case. Its received by Node A (slave) who then forwards to Node B (master) who responds to Noda A (slave) who responds to the client.

  4. PerformOnAnyNode tends to be used more for reading than writing

All the machines know each other via gossiping configuration

The Gossip seed is for example
192.168.2.4:2114,192.168.2.4:3114

When I deactivate PerformOnAnyNode the write and read operations fail

Could we stop beating around the bush here ? Instead of telling me what not to do, could we start with I should do ?

For now all nodes know the master (According to the config they know each other)

I don’t wish to force this option, but it was forced on me, as it is the only one that works so far, with the vanilla config that is shared at the end of this email

Getting to your point, How do I write to the master directly ? Through discovery discover instead of tcp: ? Then again, I could not find a way to make it work in my case. So maybe a little practical help ?

Best

Omar

“For now all nodes know the master (According to the config they know each other)”

Master is a transient role a node plays. It can (and does) change over time.

“Getting to your point, How do I write to the master directly ? Through discovery discover instead of tcp: ? Then again, I could not find a way to make it work in my case. So maybe a little practical help ?”

Writes you want to PerformOnMasterOnly not run on any node which is default IIRC (with the PerformOnAnyNode they will forward writes) … The reason there are two options here is that for a connection that is only reading/subscribing PerformOnAnyNode is perfectly valid and and lessen load off the master.
PerformOnMasterOnly()
Require the master to serve all write and read requests (Default).
PerformOnAnyNode()
Allow for writes to be forwarded and read requests to be served locally if the current node is not master.

Or this is available via connection string instead of the builder https://eventstore.org/docs/dotnet-api/connecting-to-a-server/index.html

Thanks a bunch Greg

I sound like the guy who did not read the documentation because… well you know what I mean

To my defense I got stuck on the gossiping and discovery which I would love to get to work

Hopefully I get it to work by this year’s end.

Best regards

Omar

Try bring up a simple subscription to stream/all/etc (subscribetostreamfrom) then make a steady writer (say 2 events/second)…

Now start pulling some cables! you should see how it works pretty quickly :slight_smile: