Tungsten Replicator: MariaDB MySQL Master/Slave server setup on single server

Previous Tungsten Replicator article dealt with MySQL master/slave server setup on two separate MariaDB MySQL servers (.101 master and .102 slave). This time I tried setting up both master and slave on the same single .101 server. To do this, I installed a second MariaDB 5.2.7 MySQL server instance on same server running from port 3309 and the second Tungsten Replicator installation for the slave server ran from it’s own Tungsten Home & THL directories and separate THL and RMI ports.

Recently, a vBulletin customer on vBulletin.com support forums asked about ways of backing up a 30+ GB MyISAM/InnoDB mixed forum database with the least negative effect on forum performance as possible. Besides R1Soft CDP MySQL plugin backup, the consensus by a few forum members was the solution to setup MySQL replication and to run database backups from the slave server. But not everyone has spare additional servers lying around to act as MySQL slaves.

So as I’m just starting to play around with Tungsten Replicator, I decided to try this Tungsten Replicator master/slave configuration on single server setup. The objective is to setup a Tungsten Replicator slave on the same server as the master and just use the slave for MySQL database backups. Tungsten Replicator also have backup options you can configure as well (see documentation), but haven’t gotten that far yet. Next on my to do list.

Example section for slave replicator configuration for Backup/Restore:

################################
# BACKUP/RESTORE CONFIGURATION #
################################
 
# List of configured backup agents.  Uncomment appropriately for your site. 
replicator.backup.agents=mysqldump
 
# Default backup agent.
replicator.backup.default=mysqldump
 
# Script Agent--Executes a script to backup or restore. 
replicator.backup.agent.script=com.continuent.tungsten.replicator.backup.generic.ScriptDumpAgent
replicator.backup.agent.script.script=
replicator.backup.agent.script.commandPrefix=
replicator.backup.agent.script.hotBackupEnabled=false
 
# MySqlDump Agent--backup using mysql dump utility; restore with mysql.
replicator.backup.agent.mysqldump=com.continuent.tungsten.replicator.backup.mysql.MySqlDumpAgent
replicator.backup.agent.mysqldump.host=${replicator.global.db.host}
replicator.backup.agent.mysqldump.port=${replicator.global.db.port}
replicator.backup.agent.mysqldump.user=${replicator.global.db.user}
replicator.backup.agent.mysqldump.password=${replicator.global.db.password}
replicator.backup.agent.mysqldump.dumpDir=/tmp
replicator.backup.agent.mysqldump.mysqldumpOptions=--opt --all-databases --add-drop-database
replicator.backup.agent.mysqldump.hotBackupEnabled=true
 
# Xtrabackup Agent--Executes a script that uses xtrabackup to backup or restore. 
replicator.backup.agent.xtrabackup=com.continuent.tungsten.replicator.backup.generic.ScriptDumpAgent
replicator.backup.agent.xtrabackup.script=${replicator.home.dir}/samples/scripts/backup/xtrabackup.sh
replicator.backup.agent.xtrabackup.commandPrefix=
replicator.backup.agent.xtrabackup.hotBackupEnabled=true
# Xtrabackup can handle the following options
#   user            - The mysql user to use during backup [default: root]
#   password        - The password for the mysql user [default: ]
#               host                                            - The hostname for the database server [default: localhost]
#               port                                            - The port for the database server [default: 3306]
#   directory       - A working directory to stage backup files in [default: /tmp/innobackup]
#   archive         - A non-existing file that will be created to package the backup files [default: /tmp/innobackup.tar]
#   service         - The name of the mysql service [default: mysql]
#   mysqldatadir    - The absolute path for the mysql data directory [default: /var/lib/mysql]
#   mysqluser       - The os user that mysql runs as [default: mysql]
#   mysqlgroup      - The os group that mysql runs as [default: mysql]
#               mysql_service_comand    - The command to call when stopping/starting MySQL [default: /etc/init.d/mysql]
# replicator.backup.agent.xtrabackup.options=user=tungsten&password=secret&directory=/tmp/backup
replicator.backup.agent.xtrabackup.options=user=${replicator.global.db.user}&password=${replicator.global.db.password}&host=${replicator.global.db.host}&port=${replicator.global.db.port}&directory=/tmp/innobackup&archive=/tmp/innobackup.tar&mysqldatadir=/var/lib/mysql/&mysql_service_command=/etc/init.d/mysql
 
# List of configured storage agents.  Uncomment appropriately for your site. 
replicator.storage.agents=fs
 
# Default storage agent.
replicator.storage.default=fs
 
# File system storage agent.  For best results the directory parameter should
# be a shared file system visible to all replicators.  NOTE: CRC file checking
# may be time-consuming for large files; it is recommended if you can afford
# to check.  (Who really wants to load a bad backup??)
replicator.storage.agent.fs=com.continuent.tungsten.replicator.backup.FileSystemStorageAgent
replicator.storage.agent.fs.directory=/opt/tungsten2//backups/rep1
replicator.storage.agent.fs.retention=3
replicator.storage.agent.fs.crcCheckingEnabled=true

Tungsten Replicator: MariaDB MySQL master/slave setup on single server

I tried this last night but had encountered a few issues getting the right Tungsten installer syntax for adding the new slave to existing .101 master. Luckily, Giuseppe Maxia was able to help steer me in the right direction. Thanks Giuseppe :)

Step 1).

Install second MariaDB 5.2.7 MySQL server instance on same .101 master server running from port 3309.

mysqladmin ver;echo;/usr/bin/mysqladmin -S /var/lib/mysql2/mysql.sock -P 3309 ver
 
mysqladmin  Ver 9.0 Distrib 5.2.7-MariaDB, for unknown-linux-gnu on x86_64
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,
2009 Monty Program Ab
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
 
Server version          5.2.7-MariaDB-mariadb101-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 2 hours 2 min 54 sec
 
Threads: 3  Questions: 53  Slow queries: 0  Opens: 17  Flush tables: 1  Open tables: 10  Queries per second avg: 0.7
 
/usr/bin/mysqladmin  Ver 9.0 Distrib 5.2.7-MariaDB, for unknown-linux-gnu on x86_64
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,
2009 Monty Program Ab
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
 
Server version          5.2.7-MariaDB-mariadb101-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql2/mysql.sock
Uptime:                 1 hour 57 min 41 sec
 
Threads: 4  Questions: 281  Slow queries: 0  Opens: 21  Flush tables: 1  Open tables: 10  Queries per second avg: 0.39
You have new mail in /var/spool/mail/root

Pages: 1 2 3 4


Previous:
Next:



MaxCDN Site Acceleration

Get Cost Effective Content Delivery
Unbeatable speed, stats, & price
http://www.maxcdn.com



No Comments

Trackbacks/Pingbacks

  1. Tungsten Replicator: MariaDB MySQL Master/Slave Replication setup with HyperDB plugin for Wordpress | vbtechsupport.com - [...] eva2000 0 comments mysql, tungsten replicator, web tech, wordpress …
Add Comment Register

Leave a Comment