Hi Tomas
On 06/11/2009, at 2:43 AM, Tomas wrote:
> I have some questions of upgrade mysql also.
>
> As see from mysql manual, it suggest to
>
> 1. stop slave on passive server
> 2.SET sql_log_bin = 0 on slave or passive server first,
> 3 upgrade passive server,
>
> 4. stop slave on active server
> 5. .SET sql_log_bin = 0 on active server
> 6. upgrade active server.
>
> then start slave on both server ?
> Am I right?
The manual is wrong, since sql_log_bin is only a session variable, it
cannot be used to disable binlogging globally.
> because that will not let mysql_upgrade run both server twice ?
That's pretty much harmless, but there's another why you can avoid
having the other server execute this stuff.
You shouldn't have 5.0 replicate from 5.1, so essentially the old
server may not replicate from the new.
Before you upgrade the passive master, you stop replication - on both
sides.
During the upgrade, you move away the binary and relay logs on the
master you're upgrading. You have to leave
master.info (so it
maintains its position to the old master - otherwise it'll be missing
data later!)
When it's upgraded, you check the binlog position with show master
status, and you set the active master to begin its replication from
that position, before restarting it.
> Another question is very simple, which upgrade step you think is best?
>
> a. mysqldump -> reimport to a fresh new mysql 5.1
Well before an upgrade, having both a logical (mysqldump) and physical
backup (cp or xtrabackup) is good.
Yes you could do a dump/reload, if you want. On the passive master.
Absolutely.
Generally, upgrades in MySQL are ok without dump/reload, particularly
since the introduction of mysql_upgrade.
> or b. just upgrade mysql binary to 5.1 and run mysql_upgrade ?
That's what we did, with the extra replication repositioning trickery.
> I think step a is not good for MMM architecture.
You can do either, and because of MMM the users won't have an outage.
> --And is that risky to upgrade to 5.1 ? I do not want my production
> crash during sql queries after upgrade to 5.1
Any major operation has some risk, hence the additional backups
(you'll want to have them locally so you can quickly restore them, or
have another machine able to become 2nd master). What would you do if
one of your master servers were to go up in smoke? That's exactly the
same contingency plan you need to have in place when doing this kind
of upgrade.
Cheers,
Arjen.
> On Nov 5, 3:01 am, Walter Heck <
walterh...@gmail.com> wrote:
>> Hi Pierre,
>>
>> thanks for the tip. We upgraded safely and without 1 second of
>> downtime, yay!
>>
>> Walter
>>
>> On Wed, Nov 4, 2009 at 20:42, Pierre <
ppo...@reservit.com> wrote:
>>
>>> Hi Walter,
>>
>>> I did this two months ago with MMM 1.2.x. I did not have problem
>>> with
>>> MMM, but I had with replication. I used my 5.0 my.cnf file for Mysql
>>> 5.1.
>>
>>> With InnoDB, if you are using the "READ_COMMITED" isolation level,
>>> the
>>> statement based replication no longer works. This means that when
>>> the
>>> active master will run with Mysql 5.1, you may get errors like
>>> "Transaction level 'READ-COMMITTED' in InnoDB is not safe or binlog
>>> mode 'STATEMENT'".
>>
>>> In this case, you need to update your my.cnf file to use row based
>>> binary logging.
>>
>>> Regards,
>>> Pierre
> >
--
Arjen Lentz, Exec.Director @ Open Query (
http://openquery.com)
Exceptional Services for MySQL at a fixed budget.
Follow our blog at
http://openquery.com/blog/
OurDelta: packages for MySQL and MariaDB @
http://ourdelta.org