2008-07-08 Tue
去变电所房顶(2层)调天线,下来的时候大意了, 从墙上的梯子跳了下去. 快一秒了还没落地,我草,中招! ,脊椎一紧,屁股贴地后瞬间弹起,感到了超过一个重力加速度的冲击.瞬时左脚大痛.回到医院后用秦王照骨镜观之,左脚根骨裂缝鸟
幸好无长短腿之忧,善哉!
奥运真乃不详之会,鄙视之
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:
-
mysql> SHOW master STATUS \G
-
*************************** 1. row ***************************
-
File: db04-bin.000068
-
Position: 98
-
Binlog_Do_DB:
-
Binlog_Ignore_DB:
-
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.
-
mysql> SHOW slave STATUS\G
-
*************************** 1. row ***************************
-
Slave_IO_State: Waiting FOR master TO send event
-
Master_Host: 192.168.10.171
-
Master_User: replicant
-
Master_Port: 3306
-
Connect_Retry: 60
-
Master_Log_File: db01-bin.003814
-
Read_Master_Log_Pos: 744615652
-
Relay_Log_File: mysqld-relay-bin.000953
-
Relay_Log_Pos: 744615788
-
Relay_Master_Log_File: db01-bin.003814
-
Slave_IO_Running: Yes
-
Slave_SQL_Running: Yes
-
Replicate_Do_DB:
-
Replicate_Ignore_DB:
-
Replicate_Do_Table:
-
Replicate_Ignore_Table:
-
Replicate_Wild_Do_Table:
-
Replicate_Wild_Ignore_Table:
-
Last_Errno: 0
-
Last_Error:
-
Skip_Counter: 0
-
Exec_Master_Log_Pos: 744615652
-
Relay_Log_Space: 744615788
-
Until_Condition: None
-
Until_Log_File:
-
Until_Log_Pos: 0
-
Master_SSL_Allowed: No
-
Master_SSL_CA_File:
-
Master_SSL_CA_Path:
-
Master_SSL_Cert:
-
Master_SSL_Cipher:
-
Master_SSL_Key:
-
Seconds_Behind_Master: 0
-
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
2008-07-07 Mon
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年开始按许可证生产
原图尺寸较大,懒的缩小,请点连接自行观赏







