In Erlang, what is the best way to upgrade a distributed system?

If I have several web servers written in Erlang (load balancing) mode, and Mnesia is used for a backend database, what is the best way to upgrade the entire system to a newer version?

+6
erlang mnesia
source share
2 answers

Although Erlang supports hot-loading code, this is not what you need to use. In your case, it’s easier to remove one of the time nodes from the load balancer, restart it by running the new code, and return it back to the load balancer.

Removing nodes is what you should be prepared to do if you want to upgrade to new Erlang / OTP updates on your live system.

But the real problem that may arise for you is those problems that come from mesesia. I think you should ask a new question with the specifics of what mnesia needs to do. If there are no schema / table changes, and you just want to delete one node and add it later. Or if you are actually entering new tables or new columns in the tables. Mnesia does provide the ability to add and remove nodes using table replicas, and also unambiguously supports multiple table definitions using mnesia:transform_table/3,4 .

+4
source share

If you are just updating the code, I wrote an article on erlang release using fab . With this setting, you can download in real time without restarting the nodes. However, database conversion must be performed from a single node, run separately from the release update.

+1
source share

All Articles