Ejabberd with MySQL

Hey!

I'm completely new in ejabberd, and i have some questions about all this stuffs. I have three servers with ejabberd running, and propably MySQL backend with native MySQL driver. And here is my first question. If ejabberd is using MySQL as backend, the mnesia database is still required? My configuration says, that some modules are using odbc, and some does not.

{modules,                                       
[                                              
  {mod_adhoc,    []},                           
  {mod_announce, [{access, announce}]}, % requires mod_adhoc
  {mod_caps,     []},                                      
  {mod_configure,[]}, % requires mod_adhoc                 
  {mod_ctlextra, []},                                      
  {mod_disco,    []},                                      
  %%{mod_echo,   [{host, "echo.localhost"}]},              
  {mod_irc,      []},                                      
  {mod_last_odbc,     []},                                 
  {mod_muc,      [                                         
                  %%{host, "conference.@HOST@"},           
                  {access, muc},                           
                  {access_create, muc},                    
                  {access_persistent, muc},                
                  {access_admin, muc_admin},               
                  {max_users, 500}                         
                 ]},                                       
  %%{mod_muc_log,[]},                                      
  {mod_offline_odbc,  []},                                 
  {mod_privacy_odbc,  []},                                 
  {mod_private_odbc,  []},                                 
  {mod_proxy65,  [                                         
                  {access, local},                         
                  {shaper, c2s_shaper}                     
                 ]},                                       
  {mod_pubsub,   [ % requires mod_caps                     
                  {access_createnode, pubsub_createnode},  
                  {plugins, ["default", "pep"]}            
                 ]},                                       
  {mod_roster_odbc,   []},
  %%{mod_service_log,[]},
  %%{mod_shared_roster,[]},
  {mod_stats,    []},
  {mod_time,     []},
  {mod_vcard_odbc,    []},
  {mod_clientversion, []},
  {mod_version,  []}
]}.

but when i login to the second or third node in my cluster, command ejabberdctl mnesia info says, that mnesia is running, running_db array contains all three nodes, and most copies of tables are only remote accessible. The list of files in mnesia database dir on node1 is pretty long compared with list of files on other nodes. node2 and node3 mnesia dir contains only files named DECISION_TAB.LOG LATEST.LOG schema.DAT. So, my question is, is mnesia still neccesairy? What about this diffrience in mnesia data dir files list? Another question is, if my MySQL replication works well, what if node1 fails? Will other nodes would work with no problem?

Thanks in advance for your answers.

n3ck wrote: My configuration

n3ck wrote:

My configuration says, that some modules are using odbc, and some does not.
If ejabberd is using MySQL as backend, the mnesia database is still required?

You are using SQL storage for (A), the tables that usually consume more space: roster, offline, last...
Other tables (B) consume few space and are changed frequently, so those are always stored in Mnesia.

n3ck wrote:

most copies of tables are only remote accessible.
The list of files in mnesia database dir on node1 is pretty long compared with list of files on other nodes.
node2 and node3 mnesia dir contains only files named DECISION_TAB.LOG LATEST.LOG schema.DAT.
What about this diffrience in mnesia data dir files list?

This means that node2 gets tables (A) from SQL. Gets tables (B) from the remote node1,
and keeps only a copy in RAM, not in disk.

n3ck wrote:

Another question is, if my MySQL replication works well, what if node1 fails?
Will other nodes would work with no problem?

If node2 has a table remote-only and can't connect to node1, then the table can't be read.
You don't want this to happen.

Interesting page: http://dev.esl.eu/blog/2009/12/11/ejabberd-cluster-database-configuration/

Thanks for your reply, i have

Thanks for your reply, i have one main question: if it's possible to disable mnesia totaly, and use only mysql for all data-storage purposes?

I guess that session synchronizing and other cluster-like stuffs are independent of either mnesia and MySQL? My nodes after short network switch restart are not syncing anymore and i don't know why after one connection error stoped trying?

No

n3ck wrote:

if it's possible to disable mnesia totaly, and use only mysql for all data-storage purposes?

Not possible.

Can u tell me then, how can i

Can u tell me then, how can i rerun mnesia replication? If mnesia:start(). in erlang console would be enough? I just want to cluster to work. What for is the command like this

erl -sname ejabberd -mnesia dir "'/var/lib/ejabberd/'" -mnesia extra_db_nodes "['ejabberd@some-host']" -s mnesia

in every tutorial it is said, that you have to execute this kind of command, but they say nothing about why and about parameters.

And one more question: how can i achieve autoreconnect after few-minutes network crash?

Thanks in advance!

Syndicate content