* [gentoo-user] Master - Slave MySQL Database Server
@ 2008-04-02 7:39 Kaushal Shriyan
2008-04-02 20:10 ` Mick
2008-04-03 3:31 ` Daniel da Veiga
0 siblings, 2 replies; 5+ messages in thread
From: Kaushal Shriyan @ 2008-04-02 7:39 UTC (permalink / raw
To: gentoo-user
hi,
Is there a step by step guide to set up Master - Slave MySQL Database
Server on Gentoo
Thanks and Regards
Kaushal
--
gentoo-user@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Master - Slave MySQL Database Server
2008-04-02 7:39 [gentoo-user] Master - Slave MySQL Database Server Kaushal Shriyan
@ 2008-04-02 20:10 ` Mick
2008-04-03 3:31 ` Daniel da Veiga
1 sibling, 0 replies; 5+ messages in thread
From: Mick @ 2008-04-02 20:10 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Master - Slave MySQL Database Server
2008-04-02 7:39 [gentoo-user] Master - Slave MySQL Database Server Kaushal Shriyan
2008-04-02 20:10 ` Mick
@ 2008-04-03 3:31 ` Daniel da Veiga
1 sibling, 0 replies; 5+ messages in thread
From: Daniel da Veiga @ 2008-04-03 3:31 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-user] Master - Slave MySQL Database Server
@ 2008-04-07 10:01 Kaushal Shriyan
2008-04-07 21:54 ` kashani
0 siblings, 1 reply; 5+ messages in thread
From: Kaushal Shriyan @ 2008-04-07 10:01 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 286 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Master - Slave MySQL Database Server
2008-04-07 10:01 Kaushal Shriyan
@ 2008-04-07 21:54 ` kashani
0 siblings, 0 replies; 5+ messages in thread
From: kashani @ 2008-04-07 21:54 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-07 21:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-02 7:39 [gentoo-user] Master - Slave MySQL Database Server Kaushal Shriyan
2008-04-02 20:10 ` Mick
2008-04-03 3:31 ` Daniel da Veiga
-- strict thread matches above, loose matches on Subject: below --
2008-04-07 10:01 Kaushal Shriyan
2008-04-07 21:54 ` kashani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox