Even though Erlang supports hot code-loading, it is not something one must use. In your case, it seems easier to remove one node a time from the load-balancer, restart it running the new code and put it back in the load-balancer.
Taking down nodes is also something you must be prepared to do if you will want to hot-upgrade to new Erlang/OTP releases in your live system.
But the real issue that can bubble up for you are those concerns that come from mnesia. I think you should ask a new question with the specifics in what want mnesia to do. If there are no schema/table-changes, and you just want to take one node down and add it later. Or if you actually are introducing new tables or new columns in tables. Mnesia does provide the ability to add and remove nodes with table replicas, and it also rather uniquely supports multiple table definions through mnesia:transform_table/3,4.
如果您只是进行代码升级,我写了一篇关于 erlang 使用 fab 进行发布。 通过此设置,您可以进行实时代码加载,而无需重新启动节点。 不过,数据库的转换应该从单个节点完成,与版本升级分开触发。
If you're just doing code upgrades, I wrote a an article about erlang release handling with fab. With this setup, you can do real-time code loading without having to restart nodes. Transforming the database, though, should be done from a single node, triggered separately from the release upgrade.
发布评论
评论(2)
尽管 Erlang 支持热代码加载,但这并不是必须使用的东西。 在您的情况下,一次从负载平衡器中删除一个节点,重新启动它运行新代码并将其放回负载平衡器中似乎更容易。
如果您想在实时系统中热升级到新的 Erlang/OTP 版本,则必须准备好拆除节点。
但真正可能给你带来的问题是那些来自健忘症的担忧。 我认为你应该问一个新问题,具体说明记忆症想要做什么。 如果没有架构/表更改,并且您只想删除一个节点并稍后添加它。 或者,如果您实际上要在表中引入新表或新列。 Mnesia 确实提供了通过表副本添加和删除节点的功能,并且它还通过
mnesia:transform_table/3,4
独特地支持多个表定义。Even though Erlang supports hot code-loading, it is not something one must use. In your case, it seems easier to remove one node a time from the load-balancer, restart it running the new code and put it back in the load-balancer.
Taking down nodes is also something you must be prepared to do if you will want to hot-upgrade to new Erlang/OTP releases in your live system.
But the real issue that can bubble up for you are those concerns that come from mnesia. I think you should ask a new question with the specifics in what want mnesia to do. If there are no schema/table-changes, and you just want to take one node down and add it later. Or if you actually are introducing new tables or new columns in tables. Mnesia does provide the ability to add and remove nodes with table replicas, and it also rather uniquely supports multiple table definions through
mnesia:transform_table/3,4
.如果您只是进行代码升级,我写了一篇关于 erlang 使用 fab 进行发布。 通过此设置,您可以进行实时代码加载,而无需重新启动节点。 不过,数据库的转换应该从单个节点完成,与版本升级分开触发。
If you're just doing code upgrades, I wrote a an article about erlang release handling with fab. With this setup, you can do real-time code loading without having to restart nodes. Transforming the database, though, should be done from a single node, triggered separately from the release upgrade.