background preloader


Facebook Twitter

MySQL Master Master Replication. This tutorial describes how to set up MySQL master-master replication.

MySQL Master Master Replication

We need to replicate MySQL servers to achieve high-availability (HA). In my case I need two masters that are synchronized with each other so that if one of them drops down, other could take over and no data is lost. Similarly when the first one goes up again, it will still be used as slave for the live one. Here is a basic step by step tutorial, that will cover the mysql master and slave replication and also will describe the mysql master and master replication. Notions: we will call system 1 as master1 and slave2 and system2 as master2 and slave 1.

Load Balancing and MySQL Master and Slaves (Articles) If you are currently using MySql master/slave replication for load balancing and wish to transport to cakePHP, it really couldn't be easier. 2 simple steps to master/slave replication in cake.. Firstly in app/config/database.php write the following:- How To Set Up A Load-Balanced MySQL Cluster. Version 1.0 Author: Falko Timme This tutorial shows how to configure a MySQL 5 cluster with three nodes: two storage nodes and one management node.

How To Set Up A Load-Balanced MySQL Cluster

This cluster is load-balanced by a high-availability load balancer that in fact has two nodes that use the Ultra Monkey package which provides heartbeat (for checking if the other node is still alive) and ldirectord (to split up the requests to the nodes of the MySQL cluster). In this document I use Debian Sarge for all nodes. Therefore the setup might differ a bit for other distributions. The MySQL version I use in this setup is 5.0.19. This howto is meant as a practical guide; it does not cover the theoretical backgrounds. This document comes without warranty of any kind! 1 My Servers I use the following Debian servers that are all in the same network (192.168.0.x in this example):

Ultra Monkey: If you get this in MySQL Lock wait timeout exceeded; try restart. Error : Lock wait timeout exceeded; try restarting transaction - Bugs: #10641: 1205, 'Lock wait timeout exceeded; try restarting. Mysql Master Master Repliction « Nasser Heidari. I’m going to setup MySQL Multi-Master Replication, here are my systems information: DB-1 : —> (Master 1 / Slave 2) DB-2 : —> (Master 2 / Slave 1) # uname -a Linux 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20 07:32:21 EST 2010 x86_64 x86_64 x86_64 GNU/Linux also I’m using MYSQL community Edition, you can find rpm’s here : # wget # wget # wget OK, lets start: I configured MySQL’s my.cnf file to use the tuning setup from the my-medium.cnf, which should give us good tuning parameters for our load at this point.

Mysql Master Master Repliction « Nasser Heidari

Then I added the pieces necessary for replication in both DB-1 and DB-2: Moving the MySQL's datadir directory. - lunatechian (lunatech-ia. By default, MySQL's datadir is placed in the /var/lib/mysql directory.

Moving the MySQL's datadir directory. - lunatechian (lunatech-ia

However, if you are planning on using MySQL tables to store a lot of data and your /var partition is small, it might cause you problem at a later stage. In such a scenario, it is better to move the MySQL's datadir to another partition (like /home. The steps are Stop your mysql server before starting this operation Create the directories that will be new datadir chown the directory to the mysql:mysql user copy the files from the old datadir to the new location.

However, make sure that the files named ib_arch_log_0000000000, ib_logfile0 etc. are not copied to the newer location. How to move MySQL datadir to another drive. Your MySQL database takes a huge space and your current drive is almost full? One of the available options is to move MySQL database to another drive with minimal downtime, here is how... On some machines this can also increase MySQL performance, especially one with fast drive -- such as Raptor or SCSI drive. I'm assuming: - the second drive mounted as "/home2" How to change the mysql database location - Spike Developer Zone. MySQL replikacja typu master-master. Top 20+ MySQL Best Practices. Database operations often tend to be the main bottleneck for most web applications today.

Top 20+ MySQL Best Practices

It's not only the DBA's (database administrators) that have to worry about these performance issues. We as programmers need to do our part by structuring tables properly, writing optimized queries and better code. In this article, I'll list some MySQL optimization techniques for programmers. Before we start, be aware that you can find a ton of useful MySQL scripts and utilities on Envato Market. Most MySQL servers have query caching enabled. The main problem is, it is so easy and hidden from the programmer, most of us tend to ignore it. The reason query cache does not work in the first line is the usage of the CURDATE() function. Using the EXPLAIN keyword can give you insight on what MySQL is doing to execute your query.

The results of an EXPLAIN query will show you which indexes are being utilized, how the table is being scanned and sorted etc... After adding the index to the group_id field: My MySQL Binary Log files are taking up all my disk space! – sys. …and other MySQL Oddities.

My MySQL Binary Log files are taking up all my disk space! – sys

If your MySQL binary log files are a “Growing” problem… there are a few simple steps you can use to curtail their growth and save your disk space from these huge files. They probably look like: