33800 Docs

← Retour

Proposition : Page RAIDZ + Migration GitLab + Cleanup

Date : 08/01/2026 Status : VALIDÉ

Réponses utilisateur


Contexte Actuel

GitLab (CRITIQUE)

VM GitLab : /dev/sda1 = 48G, 91% utilise (41G)
├── /var/opt/gitlab/backups     = 20G  ← PROBLEME
├── /var/opt/gitlab/git-data    = 1.6G (repos)
├── /opt (gitlab omnibus)       = 4.1G
└── /usr                        = 6.3G

Risque : Disque presque plein, backups locaux prennent 50% de l'espace.

Proxmox1 - stock_1to

stock_1to          : 846G disponibles
└── dev-stack      : 55G utilises (7%)

Opportunite : 800G+ disponibles pour GitLab.

Pools ZFS sur PVE

stock_8to   : 7.14T dispo, 1.14G utilise (RAIDZ1 - 3x4To)
stock_36to  : 14.2T dispo, 17.9T utilise (RAIDZ2 - 5x12To)

1. Page Dashboard RAIDZ

Nouvelle page : raidz.html

Contenu propose :

Section par pool

┌─────────────────────────────────────────────────────────────┐
│ stock_8to (RAIDZ1)                                    [OK]  │
│ 3x Seagate 4To | Tolerance: 1 panne | Scrub: 2026-01-05    │
├─────────────────────────────────────────────────────────────┤
│ Utilisation: ████░░░░░░░░░░░░░░░░ 1.14G / 7.14T (0.02%)    │
├─────────────────────────────────────────────────────────────┤
│ Dossiers racine:                                            │
│ 📁 33800-stack     1.1G    Services web, docker, scripts    │
│ 📁 backups         12M     Backups manuels                  │
│ 📁 vm-images       45M     Images VM/ISO                    │
│ 📁 windows_backup  128K    Backup Windows                   │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│ stock_36to (RAIDZ2)                                   [OK]  │
│ 5x HGST 12To | Tolerance: 2 pannes | Scrub: 2026-01-03     │
├─────────────────────────────────────────────────────────────┤
│ Utilisation: ████████████░░░░░░░░ 17.9T / 32.1T (56%)      │
├─────────────────────────────────────────────────────────────┤
│ Dossiers racine:                                            │
│ 📁 data/films        8.2T   Films et series                 │
│ 📁 data/games        4.1T   Jeux PC                         │
│ 📁 data/backup-stock8  1.1G Rsync stock_8to                 │
│ 📁 data/backup-proxmox1 55G Rsync proxmox1/stock_1to        │
│ 📁 data/dump         2.3T   Exports divers                  │
│ 📁 data/OLDBU        1.8T   Anciens backups                 │
│ 📁 data/nginx        245M   Logs nginx                      │
│ ...                                                         │
└─────────────────────────────────────────────────────────────┘

Infos collectees (collect.sh)

# Taille premiers dossiers
du -sh /stock_8to/* 2>/dev/null
du -sh /stock_36to/data/* 2>/dev/null

# Infos RAIDZ
zpool status stock_8to stock_36to
zpool list -o name,size,alloc,free,health

2. Migration GitLab vers stock_1to

Objectif

Deplacer les donnees GitLab (repos + uploads) vers stock_1to sur Proxmox1, liberant le disque VM.

Architecture cible

Proxmox1 (192.168.1.155)
└── stock_1to (ZFS local, 900G)
    ├── dev-stack/         55G   (existant)
    └── gitlab-data/       ~2G   (NOUVEAU)
        ├── repositories/
        ├── uploads/
        ├── shared/
        └── backups/       → ICI les backups (plus sur VM)

Avantages

  1. Espace : 800G+ disponibles au lieu de 4G
  2. Performance : ZFS local sur Proxmox1
  3. Backup unifie : stock_1to → stock_36to (rsync existant)
  4. Plus de cron GitLab : backup inclus dans rsync 1to

Etapes migration

# 1. Sur Proxmox1 : creer dataset
zfs create stock_1to/gitlab-data

# 2. Sur GitLab : arreter services
sudo gitlab-ctl stop

# 3. Rsync donnees vers stock_1to
rsync -avP /var/opt/gitlab/git-data/ proxmox1:/stock_1to/gitlab-data/git-data/
rsync -avP /var/opt/gitlab/gitlab-rails/shared/ proxmox1:/stock_1to/gitlab-data/shared/

# 4. Monter NFS sur GitLab VM
# /etc/fstab:
192.168.1.155:/stock_1to/gitlab-data /var/opt/gitlab/git-data nfs defaults 0 0

# 5. Configurer gitlab.rb
git_data_dirs({ "default" => { "path" => "/var/opt/gitlab/git-data" } })
gitlab_rails['shared_path'] = '/var/opt/gitlab/shared'
gitlab_rails['backup_path'] = '/var/opt/gitlab/backups'

# 6. Reconfigurer et demarrer
sudo gitlab-ctl reconfigure
sudo gitlab-ctl start

3. Modification Crons

Avant

Cron Schedule Action
rsync_stock1to 0 * * * * (horaire) stock_1to → stock_36to
gitlab_backup 0 */6 * * * (6h) gitlab-backup create

Apres

Cron Schedule Action
rsync_stock1to 0 */6 * * * (6h) stock_1to → stock_36to (inclut gitlab)
gitlab_backup SUPPRIME Plus necessaire

Modifications

# Sur Proxmox1 : /etc/cron.d/rsync-stock1to-backup
# AVANT: 0 * * * * root /usr/local/bin/rsync-stock1to-to-stock36.sh
# APRES:
0 */6 * * * root /usr/local/bin/rsync-stock1to-to-stock36.sh

# Sur GitLab : supprimer cron backup
sudo rm /etc/cron.d/gitlab-backup
# ou commenter dans /etc/gitlab/gitlab.rb:
# gitlab_rails['backup_keep_time'] = ...

4. Cleanup Proxmox1

Espace actuel

/dev/mapper/pve-root : 94G, 46G utilises (51%)
stock_1to            : 900G, 55G utilises (7%)

Actions de nettoyage

# 1. Nettoyer apt
sudo apt clean
sudo apt autoremove

# 2. Logs systemd (garder 7 jours)
sudo journalctl --vacuum-time=7d

# 3. Anciens kernels
sudo apt remove --purge $(dpkg -l 'linux-*' | awk '/^ii/{print $2}' | grep -v $(uname -r | cut -d- -f1,2))

# 4. Verifier gros fichiers
du -sh /var/log/* | sort -rh | head -10
du -sh /home/*/* | sort -rh | head -10

5. Inventaire Logs a Collecter

Logs identifies

Machine Fichier Description
PVE /var/log/rsync-stock8-backup.log Rsync 8to
PVE /var/log/monitoring-33800.log Collect.sh output
PVE /var/log/pve-firewall.log Firewall Proxmox
Proxmox1 /var/log/rsync-stock1to-backup.log Rsync 1to
nginx /var/log/nginx/access.log Acces global
nginx /var/log/nginx/error.log Erreurs global
nginx /var/log/nginx/dashboard.*.log Logs dashboard
GitLab journalctl gitlab-runsvdir Services GitLab
prod-portainer Docker logs Containers PROD

Rotation proposee

# /etc/cron.daily/cleanup-monitoring-logs
find /stock_8to/33800-stack/monitoring/downloads/logs/ -type f -mtime +31 -delete

6. Repo GitLab pour Configs Nginx

Nouveau repo : nginx-configs

gitlab.33800.../gouroubleu/nginx-configs
├── sites-available/
│   ├── dashboard.33800.nowhere84.com.conf
│   ├── gitlab.33800.nowhere84.com.conf
│   ├── portainer.33800.nowhere84.com.conf
│   └── ...
├── snippets/
│   ├── ssl-params.conf
│   ├── proxy-params.conf
│   └── security-headers.conf
└── README.md

Workflow

  1. Modifier config dans le repo
  2. Push vers GitLab
  3. Webhook ou cron pull sur nginx
  4. nginx -t && systemctl reload nginx

7. Resume des Taches

Priorite 1 - Critique (GitLab plein)

Priorite 2 - Dashboard

Priorite 3 - Logs/Configs

Priorite 4 - Cleanup


Questions (RÉSOLUES)

  1. Monter GitLab data en NFS depuis Proxmox1 ou via reseau 10G (speed) ?10G (10.10.10.x)
  2. Faut-il un script de deploy automatique pour nginx-configs ?Oui
  3. Inclure les logs Docker dans la collecte ?Oui