- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml- using inventory:
127.0.0.1 ansible_connection=localansible-playbook --connection=local 127.0.0.1 playbook.yml127.0.0.1 ansible_connection=localReferences:
| # | |
| # MIGRATE MySQL4 DATABASES TO MySQL5 - Steps for dumping and converting | |
| # | |
| # Uses mysqldump and patches output to be compatible with MySQL 5.5+ (? - no sure | |
| # at which specific release of MySQL 5 the old style syntax support ended). | |
| # | |
| # Conversion is most likely incomplete. It does some essential converting where | |
| # I regularly experienced problems during migration. | |
| # | |
| # Use on own risk, always try with test databases first. No warranty at all! |
| <?php | |
| # Fill our vars and run on cli | |
| # $ php -f db-connect-test.php | |
| $dbname = 'name'; | |
| $dbuser = 'user'; | |
| $dbpass = 'pass'; | |
| $dbhost = 'host'; | |
| $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| #======================================= | |
| # Part 1 is Setting up the Mirror Server | |
| # Install CPAN::Mini | |
| $ curl -L http://cpanmin.us | perl - --sudo CPAN::Mini | |
| # Select a CPAN Mirror URL from http://mirrors.cpan.org/ | |
| # - We'll use http://cpan.pair.com | |
| # Pick a directory to mirror to, I'll use /var/www/cpan |
| ## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/ | |
| --- | |
| - hosts: alpine_install | |
| user: root | |
| tasks: | |
| # - name: create a complete empty file | |
| # command: /usr/bin/touch /test/test.conf | |
| - name: create a new file with lineinfile |
Suponiendo dos servidores con IP's 10.1.0.1 (galera1) y 10.1.0.2 (galera2), la instalación de un cluster MariaDB es bien sencilla.
mariadb-server en nuestros nodos:
apt install mariadb-servermariadb.service en todos los nodos:
systemctl stop mariadb.service/etc/mysql/conf.d/galera.conf con el siguiente contenido (modificando en cada nodo la configuración específica):