----- premier serveur ----------

root@serv1: groupadd mysql
root@serv1: useradd -g mysql mysql
root@serv1: cd /usr/local
root@serv1: wget https://launchpad.net/galera/2.x/23.2.2rc1/+download/galera-23.2.2rc1-amd64.deb  --no-check-certificate
root@serv1: dpkg -i galera-23.2.2rc1-amd64.deb
root@serv1: wget http://downloads.mariadb.org/f/mariadb-galera-5.5.25/kvm-tarbake-jaunty-x86/mariadb-5.5.25.tar.gz/from/http:/mirror3.layerjet.com/mariadb
root@serv1: nano /etc/apt/sources.list
Créer ces lignes:
deb http://ftp.debian.org/debian squeeze main contrib
deb http://security.debian.org squeeze/updates main contrib
deb-src http://ftp.debian.org/debian squeeze main contrib
deb-src  http://security.debian.org squeeze/updates main contrib

root@serv1: apt-get update
root@serv1: apt-get build-dep mysql-server
root@serv1: apt-get install cmake
root@serv1: tar -zxvf mariadb
root@serv1: ln -s mariadb-5.5.25 mysql
root@serv1: cd mysql
root@serv1: BUILD/autorun.sh
root@serv1: cmake -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=1
root@serv1: make
root@serv1: make install
root@serv1: chown -R mysql .
root@serv1: chgrp -R mysql .
root@serv1: chmod +x scripts/mysql_install_db
root@serv1: mkdir /var/lib/mysql
root@serv1: chown -R mysql:mysql /var/lib/mysql
root@serv1: nano /etc/mysql/my.cnf
ajouter ou modifier: 

	#bind-address=127.0.0.1
	wsrep_provider=/usr/lib/galera
	wsrep_cluster_address=gcomm://
	wsrep_sst_method=rsync_wan
	binlog_format=ROW
	default_storage_engine=InnoDB
	innodb_autoinc_lock_mode=2
	innodb_locks_unsafe_for_binlog=1
	innodb_flush_log_at_trx_commit=2

root@serv1: su mysql
mysql@serv1: scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql
mysql@serv1: exit
root@serv1: chown -R root .
root@serv1: chown -R mysql data
root@serv1: cp scripts/mysqld_safe /etc/init.d/mysql
root@serv1: chmod +x /etc/init.d/mysql
root@serv1: mkdir /usr/share/mysql
root@serv1: cp -R /usr/local/mysql/share/english /usr/share/mysql/english

dans /etc/init.d/garb et /etc/init.d/mysql mettre les headers corrects

### BEGIN INIT INFO
# Provides: mariadb
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mariadb initscript
# Description: This is the Mariadb Init script.
#
### END INIT INFO

### BEGIN INIT INFO
# Provides: garb
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: garb initscript
# Description: This is the garb Init script.
#
### END INIT INFO

root@serv1: insserv /etc/init.d/mysql

Démarrer le serveur puis:

root@serv1: /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
root@serv1: /usr/local/mysql/bin/mysqladmin -u root -h kooka1f password 'new-password'

ou:

root@serv1: /usr/local/mysql/bin/mysql_secure_installation

------- Deuxième serveur ------
idem que le premier serveur avec:
wsrep_cluster_address=gcomm://10.0.0.1 ip ou DNS du premier serveur