<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://agora.nasqueron.org/index.php?action=history&amp;feed=atom&amp;title=Documentation_ZFS</id>
	<title>Documentation ZFS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://agora.nasqueron.org/index.php?action=history&amp;feed=atom&amp;title=Documentation_ZFS"/>
	<link rel="alternate" type="text/html" href="https://agora.nasqueron.org/index.php?title=Documentation_ZFS&amp;action=history"/>
	<updated>2026-05-01T15:55:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0-alpha</generator>
	<entry>
		<id>https://agora.nasqueron.org/index.php?title=Documentation_ZFS&amp;diff=2181&amp;oldid=prev</id>
		<title>Ptdradmin: Created page with &quot;= Guide Complet : Déploiement de MariaDB avec ZFS sur db-B-001 = Last updated: Friday, November 28, 2025  == Introduction == Ce guide complet explique comment configurer MariaDB avec InnoDB sur un serveur FreeBSD utilisant ZFS pour le stockage, en montant spécifiquement les datasets &#039;&#039;mysql-innodb-data&#039;&#039; et &#039;&#039;mysql-innodb-logs&#039;&#039; en dehors du répertoire &#039;&#039;/var/db/mysql&#039;&#039;.  == Prérequis == * Serveur FreeBSD 14.3 avec ZFS et MariaDB 10.11.15 installés * Pool ZFS &#039;&#039;arco...&quot;</title>
		<link rel="alternate" type="text/html" href="https://agora.nasqueron.org/index.php?title=Documentation_ZFS&amp;diff=2181&amp;oldid=prev"/>
		<updated>2025-11-28T17:20:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Guide Complet : Déploiement de MariaDB avec ZFS sur db-B-001 = Last updated: Friday, November 28, 2025  == Introduction == Ce guide complet explique comment configurer MariaDB avec InnoDB sur un serveur FreeBSD utilisant ZFS pour le stockage, en montant spécifiquement les datasets &amp;#039;&amp;#039;mysql-innodb-data&amp;#039;&amp;#039; et &amp;#039;&amp;#039;mysql-innodb-logs&amp;#039;&amp;#039; en dehors du répertoire &amp;#039;&amp;#039;/var/db/mysql&amp;#039;&amp;#039;.  == Prérequis == * Serveur FreeBSD 14.3 avec ZFS et MariaDB 10.11.15 installés * Pool ZFS &amp;#039;&amp;#039;arco...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Guide Complet : Déploiement de MariaDB avec ZFS sur db-B-001 =&lt;br /&gt;
Last updated: Friday, November 28, 2025&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce guide complet explique comment configurer MariaDB avec InnoDB sur un serveur FreeBSD utilisant ZFS pour le stockage, en montant spécifiquement les datasets &amp;#039;&amp;#039;mysql-innodb-data&amp;#039;&amp;#039; et &amp;#039;&amp;#039;mysql-innodb-logs&amp;#039;&amp;#039; en dehors du répertoire &amp;#039;&amp;#039;/var/db/mysql&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Prérequis ==&lt;br /&gt;
* Serveur FreeBSD 14.3 avec ZFS et MariaDB 10.11.15 installés&lt;br /&gt;
* Pool ZFS &amp;#039;&amp;#039;arcology&amp;#039;&amp;#039; opérationnel avec espace disponible&lt;br /&gt;
* Accès root ou sudo&lt;br /&gt;
* Connaissances de base en administration système et ZFS&lt;br /&gt;
&lt;br /&gt;
== Architecture Cible ==&lt;br /&gt;
* Datasets ZFS dédiés pour les données et logs InnoDB&lt;br /&gt;
* Points de montage personnalisés : &amp;#039;&amp;#039;/mysql-innodb-data&amp;#039;&amp;#039; et &amp;#039;&amp;#039;/mysql-innodb-logs&amp;#039;&amp;#039;&lt;br /&gt;
* Configuration optimisée pour les performances&lt;br /&gt;
* Système de sauvegarde via snapshots ZFS&lt;br /&gt;
&lt;br /&gt;
== Fichiers de Configuration MariaDB ==&lt;br /&gt;
Sur FreeBSD avec MariaDB :&lt;br /&gt;
* **Fichier principal de configuration** : &amp;#039;&amp;#039;/usr/local/etc/mysql/my.cnf&amp;#039;&amp;#039;&lt;br /&gt;
* Fichiers complémentaires :&lt;br /&gt;
  * &amp;#039;&amp;#039;/usr/local/etc/my.cnf&amp;#039;&amp;#039; (lien symbolique vers le fichier principal)&lt;br /&gt;
  * &amp;#039;&amp;#039;/usr/local/etc/mysql/conf.d/server.cnf&amp;#039;&amp;#039; (configuration spécifique)&lt;br /&gt;
&lt;br /&gt;
== Étapes de Déploiement ==&lt;br /&gt;
&lt;br /&gt;
=== Phase 1 : Préparation de l&amp;#039;Environnement ===&lt;br /&gt;
==== 1.1 Vérification des versions ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql --version&lt;br /&gt;
zpool list&lt;br /&gt;
zfs list&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Création des datasets ZFS ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Création avec points de montage personnalisés&lt;br /&gt;
sudo zfs create -o mountpoint=/mysql-innodb-data arcology/mysql-innodb-data&lt;br /&gt;
sudo zfs create -o mountpoint=/mysql-innodb-logs arcology/mysql-innodb-logs&lt;br /&gt;
&lt;br /&gt;
# Configuration des propriétés&lt;br /&gt;
sudo zfs set recordsize=16K arcology/mysql-innodb-data&lt;br /&gt;
sudo zfs set recordsize=128K arcology/mysql-innodb-logs&lt;br /&gt;
sudo zfs set primarycache=metadata arcology/mysql-innodb-data&lt;br /&gt;
sudo zfs set primarycache=metadata arcology/mysql-innodb-logs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Phase 2 : Configuration des Permissions ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo chown -R mysql:mysql /mysql-innodb-data&lt;br /&gt;
sudo chown -R mysql:mysql /mysql-innodb-logs&lt;br /&gt;
sudo chmod -R 750 /mysql-innodb-data&lt;br /&gt;
sudo chmod -R 750 /mysql-innodb-logs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Phase 3 : Migration des Données ===&lt;br /&gt;
==== 3.1 Arrêt du service MariaDB ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo service mysql-server stop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Déplacement des fichiers ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mv /var/db/mysql/ibdata1 /mysql-innodb-data/&lt;br /&gt;
sudo mv /var/db/mysql/ib_logfile* /mysql-innodb-logs/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Création des liens symboliques ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ln -s /mysql-innodb-data/ibdata1 /var/db/mysql/ibdata1&lt;br /&gt;
sudo ln -s /mysql-innodb-logs/ib_logfile* /var/db/mysql/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Phase 4 : Configuration de MariaDB ===&lt;br /&gt;
==== 4.1 Modification du fichier principal ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nano /usr/local/etc/mysql/my.cnf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ajouter/modifier dans le fichier principal :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[mysqld]&lt;br /&gt;
datadir = /var/db/mysql&lt;br /&gt;
innodb_data_home_dir = /mysql-innodb-data&lt;br /&gt;
innodb_log_group_home_dir = /mysql-innodb-logs&lt;br /&gt;
innodb_data_file_path = ibdata1:10M:autoextend&lt;br /&gt;
skip-innodb_doublewrite&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 4.2 Vérification de la configuration ====&lt;br /&gt;
Pour vérifier que le bon fichier est utilisé :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql --print-defaults&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 4.3 Structure des fichiers de configuration ====&lt;br /&gt;
* &amp;#039;&amp;#039;/usr/local/etc/my.cnf&amp;#039;&amp;#039; → Lien symbolique vers &amp;#039;&amp;#039;/usr/local/etc/mysql/my.cnf&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;/usr/local/etc/mysql/my.cnf&amp;#039;&amp;#039; → **Fichier principal de configuration**&lt;br /&gt;
* &amp;#039;&amp;#039;/usr/local/etc/mysql/conf.d/&amp;#039;&amp;#039; → Répertoire pour les configurations modulaires&lt;br /&gt;
&lt;br /&gt;
=== Phase 5 : Optimisation ===&lt;br /&gt;
==== 5.1 Activation de la compression ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zfs set compression=lz4 arcology/mysql-innodb-data&lt;br /&gt;
sudo zfs set compression=lz4 arcology/mysql-innodb-logs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 5.2 Autres optimisations ZFS ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Désactivation du cache flush si matériel approprié&lt;br /&gt;
sudo zfs set zfs_nocacheflush=1 arcology&lt;br /&gt;
&lt;br /&gt;
# Configuration de l&amp;#039;ARC pour métadonnées seulement&lt;br /&gt;
sudo zfs set primarycache=metadata arcology&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Phase 6 : Redémarrage et Vérification ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo service mysql-server start&lt;br /&gt;
sudo tail -n 20 /var/db/mysql/windriver.err&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vérification SQL :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SHOW VARIABLES LIKE &amp;#039;innodb_data_home_dir&amp;#039;;&lt;br /&gt;
SHOW VARIABLES LIKE &amp;#039;innodb_log_group_home_dir&amp;#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Phase 7 : Sauvegarde et Restauration ===&lt;br /&gt;
==== 7.1 Création de snapshots ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zfs snapshot arcology/mysql-innodb-data@$(date +%Y%m%d)&lt;br /&gt;
sudo zfs snapshot arcology/mysql-innodb-logs@$(date +%Y%m%d)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 7.2 Procédure de restauration ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Arrêter MariaDB avant restauration&lt;br /&gt;
sudo service mysql-server stop&lt;br /&gt;
&lt;br /&gt;
# Restauration&lt;br /&gt;
sudo zfs rollback arcology/mysql-innodb-data@20231128&lt;br /&gt;
sudo zfs rollback arcology/mysql-innodb-logs@20231128&lt;br /&gt;
&lt;br /&gt;
# Redémarrer MariaDB&lt;br /&gt;
sudo service mysql-server start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bonnes Pratiques pour la Configuration ==&lt;br /&gt;
1. **Toujours modifier le fichier principal** : &amp;#039;&amp;#039;/usr/local/etc/mysql/my.cnf&amp;#039;&amp;#039;&lt;br /&gt;
2. Pour des configurations spécifiques, créer des fichiers dans &amp;#039;&amp;#039;/usr/local/etc/mysql/conf.d/&amp;#039;&amp;#039;&lt;br /&gt;
3. Vérifier la syntaxe après modification :&lt;br /&gt;
   &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   sudo mysqld --verbose --help 2&amp;gt;/dev/null | head&lt;br /&gt;
   &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
4. Après modification, toujours redémarrer le service :&lt;br /&gt;
   &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   sudo service mysql-server restart&lt;br /&gt;
   &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Résolution des Problèmes Courants ==&lt;br /&gt;
=== Problème : MariaDB ne démarre pas ===&lt;br /&gt;
* Vérifier les permissions :&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  ls -la /mysql-innodb-data&lt;br /&gt;
  ls -la /var/db/mysql/&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Consulter les logs :&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  sudo tail -n 50 /var/db/mysql/windriver.err&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Vérifier la syntaxe du fichier de configuration :&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  sudo mysql --print-defaults&lt;br /&gt;
  sudo mysqld --verbose --help 2&amp;gt;/dev/null | head&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problème : Performances dégradées ===&lt;br /&gt;
* Vérifier la fragmentation :&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  zfs get fragmentation arcology/mysql-innodb-data&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Surveiller l&amp;#039;utilisation mémoire :&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  top&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Ajuster &amp;#039;&amp;#039;recordsize&amp;#039;&amp;#039; si nécessaire (16K pour OLTP, 128K pour les logs)&lt;br /&gt;
&lt;br /&gt;
== Commandes Utiles ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Action&lt;br /&gt;
! Commande&lt;br /&gt;
|-&lt;br /&gt;
| Vérifier l&amp;#039;état du pool ZFS&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;zpool status arcology&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Lister les datasets&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;zfs list -t all&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Vérifier les points de montage&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;df -h | grep mysql&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Voir les propriétés d&amp;#039;un dataset&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;zfs get all arcology/mysql-innodb-data&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Prendre un snapshot daté&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo zfs snapshot arcology/mysql-innodb-data@$(date +%Y%m%d_%H%M)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Voir les snapshots existants&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;zfs list -t snapshot&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Vérifier le fichier de configuration utilisé&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;mysql --print-defaults&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Vérifier la syntaxe de configuration&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;sudo mysqld --verbose --help 2&amp;gt;/dev/null | head&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Annexes ==&lt;br /&gt;
=== Configuration Avancée ZFS ===&lt;br /&gt;
Pour les environnements de production, considérer :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Séparation des logs ZIL sur SSD&lt;br /&gt;
sudo zpool add arcology log /dev/ada2&lt;br /&gt;
&lt;br /&gt;
# Configuration L2ARC pour cache supplémentaire&lt;br /&gt;
sudo zpool add arcology cache /dev/ada3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Exemple de Script de Sauvegarde ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# Sauvegarde quotidienne des datasets MariaDB&lt;br /&gt;
POOL=&amp;quot;arcology&amp;quot;&lt;br /&gt;
DATE=$(date +%Y%m%d_%H%M)&lt;br /&gt;
&lt;br /&gt;
# Verrouillage des tables&lt;br /&gt;
mysql -e &amp;quot;FLUSH TABLES WITH READ LOCK; SYSTEM zfs snapshot $POOL/mysql-innodb-data@db_backup_$DATE; SYSTEM zfs snapshot $POOL/mysql-innodb-logs@db_backup_$DATE; UNLOCK TABLES;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vérification de la Configuration ===&lt;br /&gt;
Pour voir tous les paramètres actifs :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SHOW VARIABLES;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour voir les paramètres InnoDB spécifiques :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SHOW VARIABLES LIKE &amp;#039;innodb%&amp;#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ptdradmin</name></author>
	</entry>
</feed>