[Chatons] Actions hier soir / cette nuit

Guillaume 'heraclide' Dondero guillaume at autre.org
Jeu 13 Déc 00:35:40 CET 2018


Désolé pour troll3, fatigue, je m'arreterai en cours et finirai un
autre soir ..

Voici le compte rendu :

# Le check :

root at troll3:~# df -h | grep lxc | awk '{ print "nice -n19 du -hs " $6 }'
root at troll3:~# nice -n19 du -hs /var/lib/lxc/lists
1,3G    /var/lib/lxc/lists
root at troll3:~# nice -n19 du -hs /var/lib/lxc/people
2,7G    /var/lib/lxc/people
root at troll3:~# nice -n19 du -hs /var/lib/lxc/liberte0
1,8G    /var/lib/lxc/liberte0
root at troll3:~# nice -n19 du -hs /var/lib/lxc/spip
790M    /var/lib/lxc/spip
root at troll3:~# nice -n19 du -hs /var/lib/lxc/spip2
632M    /var/lib/lxc/spip2
root at troll3:~# nice -n19 du -hs /var/lib/lxc/bind
6,1G    /var/lib/lxc/bind
root at troll3:~# nice -n19 du -hs /var/lib/lxc/etherpad
1,4G    /var/lib/lxc/etherpad
root at troll3:~# nice -n19 du -hs /var/lib/lxc/bugzilla
1,4G    /var/lib/lxc/bugzilla
root at troll3:~# nice -n19 du -hs /var/lib/lxc/mastodon1
888M    /var/lib/lxc/mastodon1
root at troll3:~# nice -n19 du -hs /var/lib/lxc/mail2
511M    /var/lib/lxc/mail2
root at troll3:~# nice -n19 du -hs /var/lib/lxc/proxy2
1,6G    /var/lib/lxc/proxy2
root at troll3:~# nice -n19 du -hs /var/lib/lxc/ethercalc2
1,2G    /var/lib/lxc/ethercalc2
root at troll3:~# nice -n19 du -hs /var/lib/lxc/nextcloud
16G     /var/lib/lxc/nextcloud


# actions sur le lvm

lvcreate -L20G -n lxc_bind troll3-vg
lvcreate -L5G -n lxc_bugzilla troll3-vg
lvcreate -L5G -n lxc_ethercalc2 troll3-vg
lvcreate -L5G -n lxc_etherpad troll3-vg
lvcreate -L5G -n lxc_liberte0 troll3-vg
lvcreate -L5G -n lxc_lists troll3-vg
lvcreate -L5G -n lxc_lstu troll3-vg
lvcreate -L5G -n lxc_mail2 troll3-vg
lvcreate -L5G -n lxc_mastodon1 troll3-vg
lvcreate -L30G -n lxc_nextcloud troll3-vg
lvcreate -L5G -n lxc_office troll3-vg
lvcreate -L5G -n lxc_people troll3-vg
lvcreate -L10G -n lxc_postgres troll3-vg
lvcreate -L10G -n lxc_proxy2 troll3-vg
lvcreate -L5G -n lxc_scrumblr troll3-vg
lvcreate -L5G -n lxc_sondage troll3-vg
lvcreate -L5G -n lxc_spip troll3-vg
lvcreate -L5G -n lxc_spip2 troll3-vg
lvcreate -L5G -n lxc_taiga troll3-vg
lvcreate -L5G -n lxc_www-nginx troll3-vg
lvcreate -L5G -n lxc_xmpp-1 troll3-vg

# init des filesystems

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

# montage

root at troll3:~# for c in $( lxc-ls ); do echo "mkdir -p /mnt/test/${c}
&& mount /dev/troll3-vg/lxc_${c} /mnt/test/${c}"  ; done

# backup /etc/fstab
cp /etc/fstab /etc/fstab.back

# migration

for c in $( lxc-ls ); do echo "lxc-stop --name $c && rsync -arpogvlH
--progress --delete --numeric-ids /var/lib/lxc/${c}/ /mnt/test/${c}/ &&
umount /mnt/test/${c} && umount /var/lib/lxc/${c}/ && sed
's/^\(.*lxc\/${c}.*\)$/#\1/' -i /etc/fstab && echo
\"/dev/troll3-vg/lxc_${c} /var/lib/lxc/${c} ext4 defaults 0 2\"
>> /etc/fstab && mount /var/lib/lxc/${c} && lxc-start -n ${c} -d"  ;
>> done


J'ai fait :
- bind
- bugzilla
- ethercalc2
- etherpad
- liberte0
- mail2
- proxy2 

Attention, dans le lot :
- certaines sont deja eteintes et pas filtrés par ma commande
- certaines ne sont pas sur du glusterfs mais directement dans le /var
  de troll3 et pour celle la, va falloir la jouer autrement ( ie,
  -umount +rm dir/* ) ;)

--
G. Dondero


Plus d'informations sur la liste de diffusion chatons