FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-02-2008, 08:10 PM
Mick
 
Default Master - Slave MySQL Database Server

On Wednesday 02 April 2008, Kaushal Shriyan wrote:
> hi,
>
> Is there a step by step guide to set up Master - Slave MySQL Database
> Server on Gentoo

By "Master - Slave" do you mean a server and a client?

These may help:

http://www.gentoo.org/doc/en/mysql-howto.xml
http://gentoo-wiki.com/MySQL
--
Regards,
Mick
 
Old 04-03-2008, 03:31 AM
"Daniel da Veiga"
 
Default Master - Slave MySQL Database Server

On Wed, Apr 2, 2008 at 4:39 AM, Kaushal Shriyan
<kaushalshriyan@gmail.com> wrote:
> hi,
>
> Is there a step by step guide to set up Master - Slave MySQL Database
> Server on Gentoo
>

AFAIK there is no such howto (I assume you mean "Replication" when you
say Master x Slave setup). Maybe cause MySQL has a complete howto on
how to enable this on ANY MYSQL installed on any system, even on
different OSs. There's no difference on the OS part if the MySQL
database is replicating or not...

Just follow:

http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html
http://dev.mysql.com/doc/refman/5.0/en/replication.html

--
Daniel da Veiga
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-07-2008, 10:01 AM
"Kaushal Shriyan"
 
Default Master - Slave MySQL Database Server

hi

is this a correct documentation http://howtoforge.com/mysql_master_master_replication for Master Slave Replication and is there a test case to test this setup


Thanks and Regards

Kaushal
 
Old 04-07-2008, 10:54 AM
Michael Schmarck
 
Default Master - Slave MySQL Database Server

Kaushal Shriyan <kaushalshriyan@gmail.com> wrote:

> hi
>
> is this a correct documentation *
> http://howtoforge.com/mysql_master_master_replication* for Master Slave
> Replication and is there a test case to test this setup

I'd advise to ask this question on the general mysql mailing list
again; see <http://lists.mysql.com/mysql>. You'll more than likely
get better responses from those guys, then you can get from here,
for the simple reason, that the chance of finding mysql users is
higher on a mysql list

Regards,

Michael

--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-07-2008, 09:54 PM
kashani
 
Default Master - Slave MySQL Database Server

Kaushal Shriyan wrote:

hi

is this a correct documentation
*http://howtoforge.com/mysql_master_master_replication* for Master Slave
Replication and is there a test case to test this setup


Thanks and Regards

Kaushal


That how-to is passable, but leaves out a number is considerations.

1. Install Mysql on the master and slave. Make sure the slave version is
the same or NEWER than the master. Master/Slave will break if the master
is running a later version than the slave. In the future you will always
update you slave first.


2. Get your master running and get your my.cnf setup. If you using
innodb you'll need to increase memory settings for it and possible tweak
your ibdata log file sizes. Do this first before even thinking about the
slave.


3. add replication user to master.
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'db02.yourdomain.com'
IDENTIFIED BY 'slavepass';


4. Make your slave config exactly the same as the master with two
exceptions. You can use smaller memory if you must, but do not change
the ibdata and iblog file sizes unless you're going to import from a
mysqldump.


master
# REPLICATION ================================================== =
log-bin = /var/lib/mysql/db01-bin
expire_logs_days = 7
server-id = 101

slave
# REPLICATION ================================================== =
log-bin = /var/lib/mysql/db02-bin
expire_logs_days = 7
server-id = 201
skip-slave-start
read-only

5. Now shutdown your master cleanly and delete the logs. You should
really, really be sure you shut down cleanly before deleting your bin-logs.

sudo /etc/init.d/mysql stop
cd /var/lib/mysql/
sudo rm -rf db01-bin.*
cd ../
sudo rsync -av mysql/ mysql-slave/
sudo /etc/init.d/mysql start

6. Copy your slave mysql dir over to the slave. Mysql should be down on
the slave before doing this.

rsync -av /var/lib/mysql-slave/ user@db02:/var/lib/mysql-slave/
ssh db02
cd /var/lib/
sudo chown -R mysql: mysql-slave/
sudo rsync -av mysql-slave/ mysql/

This way you don't have to start from scratch you screw it up. Any you
will screw it up at least once.


7. Start up the slave and tell it where to start.
sudo /etc/init.d/mysql start
mysql -u root -p
CHANGE MASTER TO MASTER_HOST='db01.yourdomain.com', MASTER_USER='repl',
MASTER_PASSWORD='slavepass', MASTER_LOG_FILE='db01-bin.000001',
MASTER_LOG_POS=4;

start slave;
show slave status;

The starting log position is always 4 when Mysql starts up fresh with no
logs, which is why we deleted them. Plus why copy around a lot of 1GB
log files when you rsync. If you have the option to shut your master
down, it's a nice short cut to avoid looking up the log position when
you dump and what not. Also rsync is much faster than doing a
master-dump mysqldump in most cases which makes for less production
downtime.


kashani
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 10:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org