Ejabberd-Cluster Database Configuration
ESL Developer Blog - - December 11, 2009In a recent post to the ejabberd mailinglist Jesse Thompson shared his insights on hof to configure the mnesia-database dependencies and storage locations in an ejabberd cluster that has more than one node.
I formated his inforamtion and put them here, since I found them to be rather insightful.
He makes a few basic inferences and then walks the list of database tables to show what has to be done to conform to this simple set of rules:
Inference #1:
If the master is RAM&disc, then the slave should be:
- RAM&disc: If you want it available when slave starts up alone
- RAMcopy: If you don’t
Inference #2:
If the master is RAMcopy, then the slave should be:
- RAM copy (instead of Remote Copy): So that the feature works on the slave when the master is down.
- Remote copy: If the feature only works if the master is up.
Inference #3:
If the master is DiscOnly, then the slave should be:
- Remote copy: If the feature only works if the master is up.
- There is a possible synchronization problem if we try to set the slave to DiscOnly (needs to be confirmed)
- Consider changing both master and slave to RAM&disc
These rules boil down to the following configuration for the locations of the mnesia tables of a “normal” ejabberd install:
| Table Name | Master | Slave |
|---|---|---|
| acl | RAM and disc copy | RAM and disc copy |
| caps_feature | RAM copy | RAM copy |
| config | RAM and disc copy | RAM and disc copy |
| disco_publish | Disc only copy | Remote copy |
| http_bind | RAM copy | RAM copy |
| http_poll | RAM copy | RAM copy |
| iq_response | RAM copy | RAM copy |
| last_activity | Disc only copy | Remote copy |
| local_config | RAM and disc copy | RAM and disc copy |
| motd | Disc only copy | Remote copy |
| motd_users | Disc only copy | Remote copy |
| muc_online_room | RAM copy | Remote copy |
| muc_registered | Disc only copy | Remote copy |
| muc_room | Disc only copy | Remote copy |
| offline_msg | Disc only copy | Disc only copy |
| privacy | Disc only copy | Disc only copy |
| private_storage | Disc only copy | Remote copy |
| pubsub_node | Disc only copy | Remote copy |
| roster | RAM and disc copy | RAM and disc copy |
| route | RAM copy | RAM copy |
| s2s | RAM copy | RAM copy |
| schema | RAM and disc copy | RAM and disc copy |
| session | RAM copy | RAM copy |
| user_caps | RAM and disc copy | RAM and disc copy |
| user_caps_resources | RAM and disc copy | RAM and disc copy |
| vcard | Disc only copy | Remote copy |
| vcard_search | Disc only copy | Remote copy |
Jesse makes some more comments on his descisions in his mailinglist post but the essence of it is:
- avoid remote copies if you want your service to run without the master
- keep stuff in RAM, or at least RAM and disc
- if you have big databases (like offline_msg), store them on disc only, so they don’t eat up your RAM
Thanks for the advice and the allowance to post this here, Jesse!
Categories: Blogs ESL Developer Blog
Comments
No comments so far, you could be the first.Add comment
Erlang on Twitter
» ingojaeckel (ingo jaeckel): Even more awesome, free Erlang resources http://t.co/blGINLJd
» DiTeam (Тимурка): @multybuq @ukhin руби хороший вариант :) можно даже без rails..попробуй erlang еще :)
» michelir5 (Micheli Gelatinous): @pharkmillups Still seeing it. I might just have to manually install it. The version of Erlang required by Riak is not current version in HB
» Angry_Lawyer (Tony Aldridge): @rvirding @saghul If Erlang kills you, does a supervisor automatically create a replacement of you?
» rvirding (Robert Virding): Softly I hope. RT @saghul: Slowly making progress… erlang is killing me.
» jsvd (João Duarte): RT @FrancescoC: Woot! RT @valdo404: Practical Erlang Programming at #QConLondon I want to go there
» saghul (Saúl Ibarra Corretgé): Slowly making progress… erlang is killing me.
» dlsspy (Dustin Sallings): @IbnFirnas heh. The erlang parts are still solid. The currently active alerting box is arm5, failed over from a pc that died one day.
» quercialwji2 (Quercia Quinn): @MikeSmooth_ABCs http://t.co/pPiIpTCx
» levicole (Levi Kennedy): @pharkmillups the homebrew version of erlang is the most recent version, and riak requires R14B I think.
Statistics
Number of aggregated posts: 10456
Number of comments: 1445
Most recent article: February 06, 2012
Latest comments
» simple smile on Scale means Skills: Very informative article. Pretty sure people would love to go to that place for shopping. Specially to those who are…
» simplesmile on 27 January 2012: Erlang Solutions embarks on an Erlang Embedded KTP: Your article will make the world better. Thanks again and good luck to you in your life. See you next time.simplesmile
» tandblekning easewhite on 08 February 2012: Erlang Express 3-day Course in San Francisco on 8 February: ncomprehensible to me now, but in general, the usefulness and significance is overwhelmingtandblekning easewhite