[erlang-questions] Multi-node setup: Adding nodes with mnesia and gproc?

Oliver Korpilla Oliver.Korpilla@REDACTED
Fri May 27 15:04:58 CEST 2016


Hello, Ulf.

And how about gproc? (You're the author, right? Love its feature set!)

Thank you,
Oliver
 

Gesendet: Freitag, 27. Mai 2016 um 14:32 Uhr
Von: "Ulf Wiger" <ulf.wiger@REDACTED>
An: "Oliver Korpilla" <Oliver.Korpilla@REDACTED>
Cc: "erlang questions" <erlang-questions@REDACTED>
Betreff: Re: [erlang-questions] Multi-node setup: Adding nodes with mnesia and gproc?
> On 27 May 2016, at 14:06, Oliver Korpilla <Oliver.Korpilla@REDACTED> wrote:
>
> Hello.
>
> We are trying to build a setup that will scale in an OpenStack cloud. Currently I as developer only know that the orchestrator will bring up additional instances as needed.
>
> I restructured my application in such a way that I have a central node that does not scale and provides services to all other nodes. It comes up first. Then at least one worker node is started which only starts one kind of worker, but possibly a lot of them - on demand.
>
> Me and my coworkers are new to the Erlang world and experimented a bit with gproc and mnesia when it comes to multi-node. The model we would be looking for is that a worker instance comes up and then gets access to all gproc global names and properties and also to the DB tables. So far our examples only worked if we connected the nodes first and then started gproc.
>
> Can gproc and mnesia accomodate nodes that were added to the cluster after they were started? Is anything special necessary?

With mnesia, you can start the new nodes with the mnesia environment variable {extra_db_nodes, [CentralNode]}, where you could obviously add more nodes to the list. This will make mnesia fetch the schema from one of those nodes and make all tables available (remember, you don’t have to have a local copy of a table for it to be accessible). With this setting, mnesia will also automatically connect as it starts.

Basically, you will always have to either manually connect, or instruct some application to do so via configuration. Using mnesia as indicated above is one way to do it.

BR,
Ulf W



More information about the erlang-questions mailing list