[ejabberd] Changing hostname on Debian with 2.1.5 (was: Debian Migration from 2.0.1 to 2.1.5 (lenny => squeeze))

Konstantin Khomoutov flatworm at users.sourceforge.net
Mon May 2 18:22:21 MSD 2011


On Sun, May 01, 2011 at 07:14:28PM +0200, Marc Haber wrote:

> On Sun, May 01, 2011 at 10:13:02AM +0200, Marc Haber wrote:
> > I am currently trying to migrate my personal ejabberd from a host
> > running Debian lenny to a different host running Debian squeeze. So I
> > have to face the challenges of (a) changing the host name in the
> > mnesia stuff and (b) doing the actual upgrade.
> 
> I have divided the problem into its two parts. The update from Debian
> lenny to Debian squeeze was done with the old hostname and was done
> fine. This left me with reaming the host.
> 
> I changed the hostname to the new value and proceeded to use the
> "Change Computer Hostname" procedure from the Ejabberd Guide.
> 
> This failed already in step one:
> cucaracha:/var/lib/ejabberd# ejabberdctl --node ejabber at nechayev start
> Failed RPC connection to the node ejabber at nechayev: nodedown
> cucaracha:/var/lib/ejabberd#
> 
> The procedure does not outline on which host one is supposed to do
> this procedure. I guess that the procedure is to be done with the new
> host name already in effect, otherwise the --node $OLDNODENAME
> wouldn't make sense, would it?
> 
> What am I doing wrong?

Hi, Marc!

(I maintain ejabberd in Debian, so I'm probably the right person to talk
to about this issue.)

The problem is two-fold.

The first thing to consider is that the ejabberdctl script in the Debian
package differs from that of upstream: in Debian, start/stop/restart
actions are carried out by the rc-script /etc/init.d/ejabberd which calls
two "back-end" scripts -- /usr/sbin/ejabberd which is used to start an
instance of ejabberd and /usr/sbin/ejabberdctl which is used to control
that running instance.
The ejabberdctl script from upstream performs both of these tasks.

I think the closest thing to replace
# ejabberdctl --node ejabberd at oldnode start
is changing the ERLANG_NODE variable in the /etc/default/ejabberd
file to read "ejabberd at oldnode" and then start it using 
# /etc/init.d/ejabberd start
or even
# /etc/init.d/ejabberd live
to easily see if it was able to start OK.

The second thing is converting the backup file.
This can be done as described in points 6-8 in the "Change Computer
Hostname" section of the official guide.

Alternatively, the conversion can be done as described in README.Debian,
but the command for conversion will be different:
ejabberd_admin:mnesia_change_nodename
instead of
mnesia_convert:change_node_name
(the meaning and ordering of the arguments is be the same).

In any case, the Debian package's README file has to be updated.
I would be grateful if you would summarise the results of your quest
here so I would have a clearer idea about what exactly to write there.



More information about the ejabberd mailing list