Posts

Showing posts with the label MySQL

Configure BiDirectional MySQL Replication (Master-Master)

Configure BiDirectional MySQL Replication (Master-Master) Now a days HA(High Availability) and DR(Disaster Recovery) Solutions are mandatory and required for mission critical databases. In  MySQL  world , DR solution are provided using the Replication (Master-Master). In this blog, We will discuss about setting up new  Master-Master setup. 1) Preparing Master Server 1(mysqlmaster01) : 1.a) Make Changes in my.cnf file.  cp -pr /etc/my.cnf /etc/my.cnf_<ddmmyyyy> Add below lined to my.cnf vi /etc/my.cnf server-id=1 log-bin gtid_mode=ON enforce-gtid-consistency auto-increment-increment = 2 auto-increment-offset = 1 expire_logs_days = 10 relay-log = /var/lib/mysql/relaylog/mysql-relay relay-log-recovery binlog_format=mixed replicate-do-db=mysqldb   1.b) Restart MYSQL server to make changed effective. service mysqld restart  1.c) Verify binary logs: SHOW MASTER LOGS; Show master Status; ls -lrt /var/log/*bin* 1.d) Create Replication user in Master Server 1:...

Switchover in MySQL Replication(Master-Slave) Setup

Switchover in MySQL Replication(Master-Slave) Setup  Performing DR Switch is regular activity for DBA for DR Testing. In this blog , We will show/discuss about how to switchover MySQL Replication (Master-Slave) Setup. Below are the steps followed for the MySQL Replication Switchover: 1) Stop All application servers/application. 2) Check Slave and Master status on the Slave(mysqlslave01) and Master server(mysqmaste01):   Log in to Master server (mysqmaste01): mysql> Flush logs; mysql> SHOW MASTER Status\G *************************** 1. row ***************************              File: mysql-bin.000002          Position: 28624712      Binlog_Do_DB: mysqldb  Binlog_Ignore_DB: Executed_Gtid_Set: 61fa835b-2c75-11e6-987c-005056b7fda8:1-4104 1 row in set (0.00 sec) Log into Slave server (mysqlslave01): Make sure slave running without log-slave-upda...

Configuring MySQL Replication Setup(Master-Slave)

Configuring MySQL Replication Setup(Master-Slave) Now a days HA(High Availability) and DR(Disaster Recovery) Solutions are mandatory and required for mission critical databases. In  MySQL  world , DR solution are provided using the Replication (Master-Slave), (Master-Master) and a solution for doing switchover and failover if required. In this blog, We will discuss about setting up new  Master-Slave setup. 1) Preparing Master Server (mysqlmaster01) : 1.a) Make changes in my.cnf file. cp -pr /etc/my.cnf /etc/my.cnf_DDMMYYYY Add below line to my.cnf vi /etc/my.cnf log-bin gtid_mode=ON enforce-gtid-consistency relay-log-recovery binlog_format=mixed server-id=1 binlog-do-db=mysqldb   1.b) Restart MYSQL server to make changes effective. service mysqld restart  1.c) Verify binary logs: SHOW MASTER LOGS; Show master Status; ls -lrt /var/log/*bin* 1.d) Create Replication user in Master Server:   mysql> CREATE USER 'repl'@'198.168.0.2' IDENTIFIED BY '**********...

Upgrade MySQL InnoDB Cluster

Upgrade MySQL InnoDB Cluster  Database upgrade are day-to-day activity which DBA perform on regular basic either due to EOS or application demand. In today blog , We will discuss about upgrading MySQL Inno D B. Upgrade in case of the MySQL InnoDB cluster can be divided primarily into three steps: 1) Upgrade MyShell on all Cluster nodes. 2) Upgrade all the MySQL Routers configured with InnoDB Cluster. 3) Upgrade InnoDB metadata /Innodb metadata schema. 4) Upgrade Individual MySQL Server running on all Cluster nodes. Below is the details about all above steps: 1) Upgrade MySQL Shell on all Cluster node or server used to manage Cluter: cd /tmp curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb dpkg -i mysql-apt-config* apt update apt-get update apt-get install mysql-shell Repeate above steps on all the server having MySQL-SHELL. Connect to Cluster using mysqlsh and run: var cluster = dba.getCluster() cluster.status() cluster.listRouters()    ==...