[Chatons] Actions hier soir / cette nuit

Guillaume 'heraclide' Dondero guillaume at autre.org
Mer 12 Déc 10:30:28 CET 2018


Bonjour,

Voici avec un peu de retard le compte rendu des actions réalisées hier soir/cette nuit :


# Le check :

root at troll4:~# df -h | grep lxc | awk '{ print "nice -n19 du -hs " $6 }'
nice -n19 du -hs /var/lib/lxc/dns
nice -n19 du -hs /var/lib/lxc/mail
nice -n19 du -hs /var/lib/lxc/ldap
nice -n19 du -hs /var/lib/lxc/mysql
nice -n19 du -hs /var/lib/lxc/drupal_dev
nice -n19 du -hs /var/lib/lxc/spip_dev
nice -n19 du -hs /var/lib/lxc/adherents
nice -n19 du -hs /var/lib/lxc/www
root at troll4:~# nice -n19 du -hs /var/lib/lxc/dns
1,3G    /var/lib/lxc/dns
root at troll4:~# nice -n19 du -hs /var/lib/lxc/mail
1,2G    /var/lib/lxc/mail
root at troll4:~# nice -n19 du -hs /var/lib/lxc/ldap
456M    /var/lib/lxc/ldap
root at troll4:~# nice -n19 du -hs /var/lib/lxc/mysql
35G     /var/lib/lxc/mysql
root at troll4:~# nice -n19 du -hs /var/lib/lxc/drupal_dev
6,0G    /var/lib/lxc/drupal_dev
root at troll4:~# nice -n19 du -hs /var/lib/lxc/spip_dev
1,4G    /var/lib/lxc/spip_dev
root at troll4:~# nice -n19 du -hs /var/lib/lxc/adherents
6,1G    /var/lib/lxc/adherents
root at troll4:~# nice -n19 du -hs /var/lib/lxc/www
16G     /var/lib/lxc/www


# actions sur le lvm

lvcreate -L10G -n lxc_drupal_dev troll4-vg
lvcreate -L10G -n lxc_drupal_dev troll4-vg
lvcreate -L10G -n lxc_adherents troll4-vg
lvcreate -L5G -n lxc_spip_dev troll4-vg
lvcreate -L5G -n lxc_xmpp2 troll4-vg

lvresize -L 5G /dev/troll4-vg/lxc_dns
lvresize -L 5G /dev/troll4-vg/lxc_mail

lvremove /dev/troll4-vg/lxc_people
lvremove /dev/troll4-vg/lxc_drupal
lvremove /dev/troll4-vg/lxc_lists
lvremove /dev/troll4-vg/lxc_bugzilla

# init des filesystems

root at troll4:~# for c in $(ls /dev/troll4-vg/lxc_*); do mkfs.ext4 $c ; done

/dev/troll4-vg/lxc_dns contient un système de fichiers ext4
        dernier montage sur /var/lib/lxc/dns le Fri Dec  2 14:36:37 2016

/dev/troll4-vg/lxc_ldap contient un système de fichiers ext4
        dernier montage sur /var/lib/lxc/ldap le Fri Dec  2 14:36:36 2016

/dev/troll4-vg/lxc_mail contient un système de fichiers ext4
        dernier montage sur /var/lib/lxc/mail le Fri Dec  2 14:36:37 2016

/dev/troll4-vg/lxc_mysql contient un système de fichiers ext4
        dernier montage sur /var/lib/lxc/mysql le Fri Dec  2 14:36:36 2016

/dev/troll4-vg/lxc_www contient un système de fichiers ext4
        dernier montage sur /var/lib/lxc/www le Tue Dec 11 14:44:34 2018



# montage

root at troll4:~# for c in $( lxc-ls ); do echo "mkdir /mnt/test/${c} && mount /dev/troll4-vg/lxc_${c} /mnt/test/${c}"  ; done
mkdir /mnt/test/adherents && mount /dev/troll4-vg/lxc_adherents /mnt/test/adherents
mkdir /mnt/test/dns && mount /dev/troll4-vg/lxc_dns /mnt/test/dns
mkdir /mnt/test/drupal_dev && mount /dev/troll4-vg/lxc_drupal_dev /mnt/test/drupal_dev
mkdir /mnt/test/ldap && mount /dev/troll4-vg/lxc_ldap /mnt/test/ldap
mkdir /mnt/test/mail && mount /dev/troll4-vg/lxc_mail /mnt/test/mail
mkdir /mnt/test/mysql && mount /dev/troll4-vg/lxc_mysql /mnt/test/mysql
mkdir /mnt/test/spip_dev && mount /dev/troll4-vg/lxc_spip_dev /mnt/test/spip_dev
mkdir /mnt/test/www && mount /dev/troll4-vg/lxc_www /mnt/test/www
mkdir /mnt/test/xmpp-2 && mount /dev/troll4-vg/lxc_xmpp-2 /mnt/test/xmpp-2


# synchro des datas

root at troll4:~# for c in $( lxc-ls ); do echo "lxc-stop --name $c ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/${c}/ /mnt/test/${c}/"  ; done
lxc-stop --name adherents ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/adherents/ /mnt/test/adherents/
lxc-stop --name dns ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/dns/ /mnt/test/dns/
lxc-stop --name drupal_dev ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/drupal_dev/ /mnt/test/drupal_dev/
lxc-stop --name ldap ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/ldap/ /mnt/test/ldap/
lxc-stop --name mail ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/mail/ /mnt/test/mail/
lxc-stop --name mysql ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/mysql/ /mnt/test/mysql/
lxc-stop --name spip_dev ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/spip_dev/ /mnt/test/spip_dev/
lxc-stop --name www ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/www/ /mnt/test/www/
lxc-stop --name xmpp-2 ; rsync -arpogvlH --progress --delete --numeric-ids /var/lib/lxc/xmpp-2/ /mnt/test/xmpp-2/



# umount des volumes glusterfs lxc_*

# edition fstab

# start des containers


A note que le rsync du lxc_www etait tellement long qu'à deux heures du matin, je suis parti me coucher et Nicolas/_dino_ a relancé le containeur ce matin ..


Je ferais les memes types d'actions ce soir sur troll3


-- 
G. Dondero


Plus d'informations sur la liste de diffusion chatons