Install packages on both nodes
sudo yum install corosync pcs pacemaker maxscaleSet the password for the hacluster user [both nodes]
| #!/bin/bash | |
| TODAY=$(date +%Y%m%d) | |
| DOW=$(date +%w) | |
| # check if sshfs is mounted. if not, do it | |
| mount -f /mnt/backup | |
| if [ $? -eq 0 ] | |
| then | |
| mount /mnt/backup | |
| fi | |
| mysql --password=foo! -e "set global wsrep_desync=ON" |
| - hosts: lab | |
| user: root | |
| tasks: | |
| - name: download couchbase package | |
| get_url: url=http://packages.couchbase.com/releases/3.0.1/couchbase-server-enterprise_3.0.1-debian7_amd64.deb dest=/tmp/ | |
| - name: install couchbase package | |
| apt: deb=/tmp/couchbase-server-enterprise_3.0.1-debian7_amd64.deb | |
| - name: create couchbase datadir | |
| file: path=/data/couchbase owner=couchbase group=couchbase state=directory |
| package main | |
| import ( | |
| // "bytes" | |
| "bufio" | |
| _ "database/sql" | |
| "fmt" | |
| _ "github.com/go-sql-driver/mysql" | |
| "github.com/jmoiron/sqlx" | |
| "github.com/tanji/mariadb-tools/dbhelper" |
| #!/bin/bash | |
| if [ -z $1 ] | |
| then | |
| echo "example usage: $(basename $0) 20150401 20150530" | |
| exit 1 | |
| fi | |
| date=$1 | |
| while true | |
| do | |
| echo $date |
| sysbench \ | |
| --test=/usr/share/doc/sysbench/tests/db/oltp.lua \ | |
| --mysql-host=localhost \ | |
| --mysql-port=3306 \ | |
| --mysql-user=root \ | |
| --mysql-password=admin \ | |
| --mysql-db=test \ | |
| --mysql-table-engine=innodb \ | |
| --mysql-ignore-errors=all \ | |
| --oltp-test-mode=complex \ |
Multisource_1SHOW SLAVE 'db1' STATUSSeconds_Behind_Master,Slave_SQL_Running| [mysqld] | |
| binlog_format=ROW | |
| innodb_buffer_pool_size=64M | |
| innodb_autoinc_lock_mode=2 | |
| innodb_flush_log_at_trx_commit=2 | |
| bind-address=0.0.0.0 | |
| #galera settings | |
| wsrep_provider=/usr/lib64/galera/libgalera_smm.so | |
| wsrep_cluster_name="my_wsrep_cluster" | |
| wsrep_cluster_address=gcomm://192.168.50.101,192.168.50.102,192.168.50.103 |
| version: '2' | |
| services: | |
| db1: | |
| image: mariadb:latest | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=admin | |
| command: mysqld --log-bin --server-id=1 | |
| db2: | |
| image: mariadb:latest | |
| environment: |
| version: '2' | |
| services: | |
| node1: | |
| image: mariadb:10.1 | |
| environment: | |
| - TERM=xterm | |
| - MYSQL_ROOT_PASSWORD=admin | |
| - MYSQL_INITDB_SKIP_TZINFO=1 | |
| volumes: | |
| - ~/Dev/docker/compose/galera/conf.d:/etc/mysql/conf.d |