Project

General

Profile

Support #335

Updated by Daniel Curtis almost 11 years ago

While increasing availability of the web services provided, I have created a jail for compiling and installing Percona package, with . Once ssh access has been enabled, log in and install the percona client and server: 
 <pre> 
 ssh db.example.com 
 su  
 pkg install percona55-server percona55-client xtrabackup 
 </pre> 

 Currently there is no Galera in the ports tree, however I did manage to find a script that creates an entry in the ports tree. First update the ports tree: 
 <pre> 
 portsnap fetch 
 portsnap extract 
 </pre> 

 And resolve some dependencies for building wsrep: 
 <pre> 
 pkg install bash bison gcc48 libexecinfo lsof sudo rsync openssl boost-libs cmake flex libcheck scons autoconf automake gmake help2man libtool bzr subversion libevent 
 </pre> 

 Because @/bin/bash@ is often used as interpreter for scripts, you should link bash to that path: 
 <pre> 
 sudo ln -s /usr/local/bin/bash /bin/bash 
 </pre> 

 Galera is written with the modern version of C++ standard, and its code is not fully compatible with default g++ 4.2.1 compiler. You should have at least g++ 4.7, but g++ 4.8 is highly recommended. Also, you should specify version of libstdc++ library, which is used for program execution through LD_LIBRARY_PATH environment variable. You should assign the following environment variables. 
 <pre> 
 bash 
 LD_LIBRARY_PATH=/usr/local/lib/gcc48 
 CC=gcc48 
 CXX=g++48 
 export LD_LIBRARY_PATH CC CXX 
 </pre> 

 It is recommended to add them to your login shell script (@.shrc, .cshrc, .bashrc@).  

 Download and compile Percona wsrep 5.5:  
 <pre> 
 mkdir /usr/local/src 
 cd /usr/local/src 
 wget http://www.percona.com/redir/downloads/Percona-XtraDB-Cluster/LATEST/source/Percona-XtraDB-Cluster-5.5.34.tar.gz 
 tar xzf Percona-XtraDB-Cluster-5.5.34.tar.gz 
 cd Percona-XtraDB-Cluster-5.5.34 
 ./BUILD/compile-pentium-wsrep 
 make install 
 </pre> 

 Then download and compile Galera 2.x: 
 2.x and MySQL-wsrep 5.5 with wsrep API v24:  
 <pre> 
 cd /usr/local/src bzr co --lightweight https://code.launchpad.net/~codership/galera/2.x 
 wget http://www.percona.com/redir/downloads/Percona-XtraDB-Cluster/LATEST/source/percona-xtradb-cluster-galera.tar.gz bzr co --lightweight https://code.launchpad.net/~codership/codership-mysql/wsrep-5.5 
 tar xzf percona-xtradb-cluster-galera.tar.gz 
 cd percona-xtradb-db-cluster-galera 2.x 
 scons MYSQL_SRC=../wsrep-5.5 scripts/mysql/build.sh -c -t 
 </pre> 

 And manually install the Galera plugin: 
 <pre> 
 cp garb/garbd /usr/local/mysql/bin/ 
 cp libgalera_smm.so /usr/local/mysql/lib/plugin/ 
 </pre> 

 h2. Resources 

 * http://www.codership.com/wiki/doku.php?id=compile_galera 
 * http://serverfault.com/questions/426021/how-to-install-percona-xtradb-cluster-on-x86-server 
 * http://www.percona.com/downloads/Percona-XtraDB-Cluster/LATEST/source/ 
 * http://www.fromdual.ch/building-galera-replication-from-scratch 

Back