[Gluster-users] [EXT] Move a volume to a new server
Stefan Solbrig
stefan.solbrig at ur.de
Tue Jan 18 10:42:30 UTC 2022
Hi,
Do you want to replace a server (and the new server takes over the old server's hostname and IP address) or do you want to move the bricks to a different host (with different hostname and/or IP address)?
If it's the latter, you will probably also have to edit the files in /var/lib/glusterfs.
I use the commands below to do a failover (moving a brick from a defunct host to a new host).
(In addidtion to what Strahli Niklov wrote before...)
#-----------8<-----
gluster v add-brick gvol sever-02-gl:/gl/brickname force
# Order is important!
# if brick is removed before other brick is added, it will lead to duplicate files.
gluster v remove-brick gvol server-01-gl:/gl/brickname force
# not strictly necessary, but a good idea
gluster v rebalance gvol fix-layout start
#----------->8-------
If you use it on a replicated volume, better test it before on a toy model. I only tested it in a distributed-only volume. I'm still not sure if this is meant to work (or even supported). The order is very important. If you remove the brick before adding the new one, and clients keep writing, you might end up with different files of the same name on different bricks.
best wishes,
Stefan
> Am 18.01.2022 um 09:15 schrieb Diego Zuccato <diego.zuccato at unibo.it>:
>
> Tks. I'll do it. Worst case: I'll have to create a new volume and move files from the old bricks to it. The safety is what I like most in Gluster.
> The 'funny' thing is that a replica server is planned but not yet operative :(
>
> Il 17/01/2022 18:24, Strahil Nikolov ha scritto:
>> Verify that you can install the same version of gluster.
>> If not, plan to update to a version that is available to both old and new servers' OS.
>> Once you migrate (check all release notes in advance) to a common version, you can do something like this:
>> - Install the gluster software on the new host
>> - Setup the firewall to match the old server
>> - Stop the gluster volumes and any geo-rep sessions
>> - Shutdown glusterd service
>> - Umount the bricks
>> - Disable LVM LVs/VGs that host your bricks (if you share the same VG with other software, you will have to use vgsplit)
>> - Remove the multipath devices (multipath -f)
>> - Remove the block devices that are part of those multipath devices
>> - Backup /etc/glusterfs
>> - Backup /var/lib/glusterd
>> - Unmap the LUNs
>> - Present the LUNs on the new host
>> - Verify that the multipath devices are there
>> - Rescan the LVM stack (pvscan --cache, vgscan lvscan)
>> - Activate the VGs/LVs
>> - Mount the bricks and ensure mounting on boot (autofs, systemd's '.mount/.automount' units, fstab)
>> - restore /etc/glusterfs & /var/lib/glusterd
>> - Start the glusterd service
>> - Start the volumes
>> - Mount via FUSE to verify the situation
>> - Start the geo-replications (if any)
>> Note, if you use VDO - disable the volume on the old system and backup the config (/etc/vdoconf.yml) -> restore on the new host.
>> Check your tuned profile and if needed transfer the configuration file on the new system and activate it.
>> I might have missed something (like custom entries in /etc/hosts) , so do a short test on test system in advance.
>> Edit: You didn't mention your FS type, so I assume XFS .
>> Best Regards,
>> Strahil Nikolov
>> On Mon, Jan 17, 2022 at 13:15, Diego Zuccato
>> <diego.zuccato at unibo.it> wrote:
>> Hello all.
>> I have a Gluster volume that I'd need to move to a different server.
>> The volume is 4x10TB bricks accessed via FC (different LUNs) on an old
>> CX3-80.
>> I have no extra space to create a copy of all the data, so I'd need to
>> hide the LUNs from the old server and make 'em visible to the new
>> ("move
>> the disks"), w/o copying data.
>> Can I just do something like this?
>> - stop volume
>> - umount bricks
>> - copy volume state files to new server (which ones?)
>> - map LUNs to new server
>> - mount bricks on new server (maintaining the same path they had on old
>> server)
>> - start glusterd on new server
>> - start volume
>> Tks!
>> -- Diego Zuccato
>> DIFA - Dip. di Fisica e Astronomia
>> Servizi Informatici
>> Alma Mater Studiorum - Università di Bologna
>> V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
>> tel.: +39 051 20 95786
>> ________
>> Community Meeting Calendar:
>> Schedule -
>> Every 2nd and 4th Tuesday at 14:30 IST / 09:00 UTC
>> Bridge: https://meet.google.com/cpu-eiue-hvk
>> <https://meet.google.com/cpu-eiue-hvk>
>> Gluster-users mailing list
>> Gluster-users at gluster.org <mailto:Gluster-users at gluster.org>
>> https://lists.gluster.org/mailman/listinfo/gluster-users
>> <https://lists.gluster.org/mailman/listinfo/gluster-users>
>
> --
> Diego Zuccato
> DIFA - Dip. di Fisica e Astronomia
> Servizi Informatici
> Alma Mater Studiorum - Università di Bologna
> V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
> tel.: +39 051 20 95786
> ________
>
>
>
> Community Meeting Calendar:
>
> Schedule -
> Every 2nd and 4th Tuesday at 14:30 IST / 09:00 UTC
> Bridge: https://meet.google.com/cpu-eiue-hvk
> Gluster-users mailing list
> Gluster-users at gluster.org
> https://lists.gluster.org/mailman/listinfo/gluster-users
More information about the Gluster-users
mailing list