-->
Home | Expand Collapse | OPML | Previous | 2008-07-08 Tue | Next | Blog | Power by Lilina
 123
 123

  2008-07-08 Tue

20:01 今日人品爆发,------骨裂了 (669 Bytes) »

 

去变电所房顶(2层)调天线,下来的时候大意了, 从墙上的梯子跳了下去. 快一秒了还没落地,我草,中招! ,脊椎一紧,屁股贴地后瞬间弹起,感到了超过一个重力加速度的冲击.瞬时左脚大痛.回到医院后用秦王照骨镜观之,左脚根骨裂缝鸟幸好无长短腿之忧,善哉!

奥运真乃不详之会,鄙视之

11:28 How SHOW SLAVE STATUS relates to CHANGE MASTER TO (18229 Bytes) » MySQL Performance Blog

As you probably know MySQL Replication (statement based) works by fetching statements from MASTERs binary log and executing them on the SLAVE. Since MySQL 4.0 this process is a bit more involved having events passing via relay logs on the Slave which also means there are two replication threads "IO Thread" and "SQL Thread" used in the process but idea remains the same.

For replication to work properly you need to have proper "snapshot" - consistent state of the database as it was on master and corresponding position in masters binary logs. There are multiple ways to get the "snapshot" - shutting down MySQL Server and copying data, using LVM, Using Innodb Hot Backup Tool, Using another Slave, using backup image etc but in all the cases you have to be sure the snapshot you're dealing with corresponds to correct binary log position.

There are two sources of information for binary log position SHOW MASTER STATUS - this shows position as master writes its own binary and is helpful when you for example take backup on the Master to bring up first slave. This command output is pretty simple and leaves no room for mistakes:

SQL:
  1. mysql> SHOW master STATUS \G
  2. *************************** 1. row ***************************
  3.             File: db04-bin.000068
  4.         Position: 98
  5.     Binlog_Do_DB:
  6. Binlog_Ignore_DB:
  7. 1 row IN SET (0.00 sec)

If you're backing up from the Slave or you're cloning the Slave to make another one you need to use SHOW SLAVE STATUS which provides much more information.

SQL:
  1. mysql> SHOW slave STATUS\G
  2. *************************** 1. row ***************************
  3.              Slave_IO_State: Waiting FOR master TO send event
  4.                 Master_Host: 192.168.10.171
  5.                 Master_User: replicant
  6.                 Master_Port: 3306
  7.               Connect_Retry: 60
  8.             Master_Log_File: db01-bin.003814
  9.         Read_Master_Log_Pos: 744615652
  10.              Relay_Log_File: mysqld-relay-bin.000953
  11.               Relay_Log_Pos: 744615788
  12.       Relay_Master_Log_File: db01-bin.003814
  13.            Slave_IO_Running: Yes
  14.           Slave_SQL_Running: Yes
  15.             Replicate_Do_DB:
  16.         Replicate_Ignore_DB:
  17.          Replicate_Do_Table:
  18.      Replicate_Ignore_Table:
  19.     Replicate_Wild_Do_Table:
  20. Replicate_Wild_Ignore_Table:
  21.                  Last_Errno: 0
  22.                  Last_Error:
  23.                Skip_Counter: 0
  24.         Exec_Master_Log_Pos: 744615652
  25.             Relay_Log_Space: 744615788
  26.             Until_Condition: None
  27.              Until_Log_File:
  28.               Until_Log_Pos: 0
  29.          Master_SSL_Allowed: No
  30.          Master_SSL_CA_File:
  31.          Master_SSL_CA_Path:
  32.             Master_SSL_Cert:
  33.           Master_SSL_Cipher:
  34.              Master_SSL_Key:
  35.       Seconds_Behind_Master: 0
  36. 1 row IN SET (0.00 sec)

As you can see in this output there are 3 log file names and log file positions which can get confusing, and indeed I often see people using wrong values to restore the replication using CHANGE MASTER TO statement.

It is very important to understand the difference between IO Thread position in Master logs (Master_Log_File:Read_Master_Log_Pos) and SQL Thread position in Master logs (Relay_Master_Log_File:Exec_Master_Log_Pos).

When you're using CHANGE MASTER TO to set start position for the slave you're specifying position for SQL thread and so you should use Relay_Master_Log_File:Exec_Master_Log_Pos. Otherwise you're going to ruin your replication.

It does not help SHOW MASTER STATUS has Master_Log_File value and CHANGE MASTER TO accepts Master_Log_File parameter, while you actually want to use Relay_Master_Log_File instead. This naming was left from pre MySQL 4.0 era and it still causes confusion so many years later.

The mistake of using Master_Log_File is in fact VERY typical. I've seen multiple "internal instructions" for cloning the slave or slave recovery from backup using this value.

Infact Master_Log_File will work in most cases as well - you can note in the output about Master_Log_File and Relay_Master_Log_File are the same, and it will be the case in vast majority of cases.

If your replication does not fall behind the SQL Thread and IO thread will be running close, quite often being at same master position at all. Even if replication gets a bit behind in most cases you would still see SQL thread and IO threads close enough to share same master log file. Only in rare cases of switching master binary log file or replication being delayed very significantly you will see different log files for these variables which makes it very easy to make mistake and very hard to catch.


Entry posted by peter | 4 comments

Add to: delicious | digg | reddit | netscape | Google Bookmarks

07:01 向马克·夏卡尔致敬 (548 Bytes) » Google 黑板报 -- Google 中国的博客网志


今天,是俄国著名的超现实主义画家——马克·夏卡尔(1887年7月7日—1985年3月28日)的诞生纪念日。

我们谨以改变 Google Doodle 的方式,向这位艺术家致敬。

    

  2008-07-07 Mon

21:53 细品日本陆上自卫队AH-1S  (3285 Bytes) »

AH-1S攻击直升机是美国贝尔公司研制的第一种专用型攻击直升机,代号“休伊眼镜蛇”。AH-1S是AH-1G的最新改进型,于1978年开始服役。日本自卫队目前拥有装配有更强有力发动机和坚固机身的改进型AH-1S近100架。

    AH-1S“休伊眼镜蛇”为 AH-1G/Q 的改进型,也称“现代贝尔”209。该机改装大功率的 1342kw 莱康明 T53-L-7O3 涡轮轴发动机、减速器和传动系统,主要外形特征是驾驶舱盖由弧形改为平板式,以减少贴地飞行中被目视发现的可能性。短翼下可挂 8 枚“陶”式导弹。采用新研制的装 20mm/30mm 炮的通用炮塔,其机炮可由驾驶员或炮手通过头盔瞄准具控制,也可以由炮手用“陶”式导弹系统的望远镜式瞄准具控制。航炮射界:方位角 110度,俯仰角+20.5— -50度。AH-1S 除美国陆军使用外,以色列。日本、约旦、巴基斯坦、韩国、泰国也在使用。

      主要战术技术性能:机长13.54米,机宽0.915米、机高4.12米;空重2939千克,最大起飞重量4535千克,最大飞行速度315千米/小时,巡航速度230千米/小时,升限3720米,  

航程527千米;动力装置为一台涡轮轴发动机,最大功率1×1800轴马力;武器为一门20毫米口径航炮,8枚反坦克导弹或4个火箭发射器或4个机枪吊舱。

  主要特点:换装新的发动机,机动性增强;采用复合材料旋翼浆叶,能抗23毫米口径炮弹;采用平板式座舱玻璃,减少了贴地飞行时光的折射;加高了串列式座舱的后座,扩大了飞行员的视界;增强了火力,提高了命中精度。

  主要用途:AH-1S在海湾战争中击毁了大量伊拉克军队的坦克和其它目标,并在阻止伊拉克军队撤退的战场遮断行动中发挥了重要作用。但AH-1S直升机缺少全球定位导航系统,及夜间瞄准系统(如前视红外仪和自主激光指示器等)限制了夜间和恶劣气象条件下遂行任务的能力。

  日本于1977年引进年1983年开始按许可证生产

 

 

原图尺寸较大,懒的缩小,请点连接自行观赏

http://su-27-china1.blog.163.com/editAlbum.do?albumId=fks_087066092084086071086083083095087087086067082095#p1

 

 

21:50 相片: img_229158_42567848_24 (267 Bytes) »
21:50 相片: img_229158_42567848_17 (265 Bytes) »
21:50 相片: img_229158_42567848_7 (267 Bytes) »
21:50 相片: img_229158_42567848_18 (267 Bytes) »
21:50 相片: img_229158_42567848_23 (267 Bytes) »
21:40 KJ-2000 (195 Bytes) »

谁让某机场是军民合用哩...........

AA大人明查,此图非偶拍

17:15 Ctalk 0.0.60a Released » PLNews: Programming Language News
17:13 GNU CLISP 2.46 Released » PLNews: Programming Language News
17:11 Frink 2008-07-03 Released » PLNews: Programming Language News
17:09 newLISP 9.4.1 Released » PLNews: Programming Language News
17:07 PLT Scheme v4.0.2 Released » PLNews: Programming Language News
03:09 Speaking on OSCON 2008 » MySQL Performance Blog

  2008-07-05 Sat

20:01 小小魔女的早餐 » 萨苏的BLOG
07:01 浪潮之巅 第九章 硅谷的另一面(四) » Google 黑板报 -- Google 中国的博客网志

  2008-07-04 Fri

17:20 July 2 Haskell Weekly News Available » PLNews: Programming Language News
17:18 July 2 Tcl-URL! Now Available » PLNews: Programming Language News
17:16 Frink 2008-07-03 Released » PLNews: Programming Language News
17:15 Kite 1.0b3 Released » PLNews: Programming Language News
17:13 Sleep 2.1 Update 1 Released » PLNews: Programming Language News
17:11 eTcl 1.0-rc29 Released » PLNews: Programming Language News
16:27 Recovering Innodb table Corruption » MySQL Performance Blog

  2008-07-03 Thu

07:01 风邪与桔子汁 » 萨苏的BLOG
07:01 免费在线研讨会:The Google Trifecta » Google 黑板报 -- Google 中国的博客网志

  2008-07-02 Wed

17:18 newLISP 9.4.0 Released » PLNews: Programming Language News
17:16 New Version of Allegro CL 8.1 Express Released » PLNews: Programming Language News
17:14 Smalltalk Solutions 2008 Slides Available » PLNews: Programming Language News
17:13 June 24 to July 1 Caml Weekly News Available » PLNews: Programming Language News
17:12 Tcl/Tk 8.5.3 Released » PLNews: Programming Language News
17:10 CLIS 0.9.0 Released » PLNews: Programming Language News
12:20 书: 人类尸体的有趣故事 » ★兔主席地洞★
10:41 Should we proclaim MySQL Community Edition Dead ? » MySQL Performance Blog

  2008-07-01 Tue

20:01 浪潮之巅 第九章 硅谷的另一面(三) » Google 黑板报 -- Google 中国的博客网志
Sources