-
Hi! We have an ejabberd cluster running with a few external modules, installed with I already have something in mind but the are a few things that are a bit unclear. My starting point is the upgrade guide for ejabberd here, since the situation is similar to upgrading the ejabberd version: https://docs.ejabberd.im/admin/upgrade/ Questions to "Soft upgrade process":S.1. Before running Questions to "Module update process":M.1. I tried installing the module on another ejabberd instance and replace the beam files on the destination server but I guess |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That long procedure is not needed in your case, as you only modified a few erlang modules to fix bugs that don't require module restart to take effect right (no mnesia or ets changes, no changes to records/tuples/internal state). Instead of "soft upgrade procedure", you probably can use "module upgrade process".
You are right. During the time (few seconds) that passes between step "run leave_cluster on node B" and "stop old node B", some clients may modify the node B database (modify roster, receive offline messages, etc). And later the step "run join_cluster on node B, passing node A as parameter" is destructive: this step will delete the content of mnesia tables in node B, and then will copy the contents from node A. Consequently, changes were done to node B database that are not synchronized with node A and are deleted. There is a new command "evacuate_kindly" in git that allows you to kick clients and rooms, then you can run leave_cluster being sure that there are not clients around modifying the database.
Right. Content of a mnesia table is synchronized with other nodes immediately.
This is undesirable, both when using method A and B described later. Maybe the code keeps running because there are processes still running based on it?
You are right. There are two methods to use new modules in ejabberd: A) When ejabberd is compiled from source code, it is possible to copy more modules source code to src/ and let ejabberd compile them. In that case, the update procedure is:
B) On the other hand, it is possible to add a new module to ejabberd-modules and install with "module_install". In that case, the update procedure is:
In your case, as you already have the module compiled (using B in a development machine), you can use method A in the production server, going directly to the steps Copy + Check + Update
The B method restarts the module, that is stop+start, that is remove hooks and add them a few moments later, so there are a few moments that the hook of that module was not registered in ejabberd, and consequently it is not called. The A method acts at a lower level: it tells erlang to modify the binary code of the module, so the functions get replaced (I imagine that atomically). In your case that's what you want. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! This is really detailed and helpful! |
Beta Was this translation helpful? Give feedback.
That long procedure is not needed in your case, as you only modified a few erlang modules to fix bugs that don't require module restart to take effect right (no mnesia or ets changes, no changes to records/tuples/internal state). Instead of "soft upgrade procedure", you probably can use "module upgrade process".
You are right.
During the time (few seconds) that passes between step "run leave_cluster on node B" and "stop old node B", some clients may modify the node B databas…