Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MySQL Casual Talks Vol.3 〜カジュアルだよこわくないよ〜

Avatar for n0ts n0ts
April 19, 2012

MySQL Casual Talks Vol.3 〜カジュアルだよこわくないよ〜

MySQL Casual Talks Vol.3

Avatar for n0ts

n0ts

April 19, 2012
Tweet

More Decks by n0ts

Other Decks in Technology

Transcript

  1. n Naoya Nakazawa n @n0ts n ೔ຊޠϒϩά n http://www.sssg.org/blogs/naoya/ n

    ແॴଐ n έʔϒϦϯά͔ΒΞϓϦ·Ͱ Thursday, April 19, 12
  2. LVS Application Server DB1 MySQL 5.0.51b DB2 MySQL 5.0.71 LVS

    Master repl Slave Master Slave repl Write Read Write Read Thursday, April 19, 12
  3. چDC ৽DC Application Server LVS LVS repl repl DB1 DB2

    Application Server LVS LVS repl repl DB1 DB2 Thursday, April 19, 12
  4. repl DB1 MySQL 5.0.51b چDC ৽DC Master Slave repl Master

    Slave DB1 MySQL 5.1.58 ×SSL Replication SSH Port Forwarding repl DB2 MySQL 5.0.71 Master Slave repl Master Slave DB2 MySQL 5.1.58 Thursday, April 19, 12
  5. n MySQL 5.1.58͔Β5.0.51bʹ઀ଓ͢Δͱɺ࣍ͷΤ ϥʔ͕ൃੜͨ͠ n ERROR 2026 (HY000): SSL connection

    error n MasterͷόʔδϣϯΛ5.1.58ʹ͋ΘͤΔͱ͏·͘ ͍ͬͨͷͰɺόʔδϣϯͷ໰୊͔ɺ5.0ܥΛSSLର ԠϏϧυ͍ͯ͠ͳ͔ͬͨ͜ͱ͕ݪҼ͔΋͠Εͳ͍ SSLϨϓϦέʔγϣϯͷࣦഊ Thursday, April 19, 12
  6. SSHϙʔτϑΥϫʔυ n ৽DC DB1 Master্ͰɺچDC DB1 MasterʹSSHτϯωϧΛ۷Δ n ssh -f

    <چDC DB1 Master> -L 13306:localhost:3306 -N -4 -g n LVSܦ༝ͷͨΊɺLVS͕੾ΓସΘΔͱSSHτϯωϧ͕੾ΕΔͨΊɺ MonitͰఆظతʹSSHτϯωϧ͕ด͍ͯ͡Δ͔֬ೝ͢ΔΑ͏ʹͨ͠ n pgrepͯ͠ͳ͚Ε͹SSHτϯωϧΛ۷Δ؆୯ͳγΣϧεΫϦϓτ n ৽DC DB1 MasterΛɺҰ࣌తʹSlaveʹ͢Δ n mysql> CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=13306 ...; Thursday, April 19, 12
  7. ৽DCͷMySQL n MySQL SlaveͷΈϋʔυ΢ΣΞRAID0 + SSD x 4 n XFS,

    deadlineεέδϡʔϥ n ެࣜͷMySQL 5.1.58 RPM n InnoDB pluginΛར༻ n InnoDBͷઃఆΛશൠతʹݟ௚͔ͨͬͨ͠ͷͰɺچDC্Ͱmysqldumpͨ͠ σʔλΛྲྀ͠ࠐΜͰɺ৽DC DB1 MasterΛεϨʔϒͱͨ͠ n DB2ͷํ͸ɺ׬શҠߦޙʹఀࢭͯ͠Ҡߦͨ͠ n Ұ෦ͷςʔϒϧʹInnoDB Data CompressionΛಋೖ Thursday, April 19, 12
  8. چDC ৽DC Application Server LVS LVS repl repl DB1 DB2

    Application Server LVS LVS repl repl DB1 DB2 Traffic Write Thursday, April 19, 12
  9. چDC ৽DC Application Server LVS LVS repl repl DB1 DB2

    Application Server LVS LVS repl repl DB1 DB2 Traffic Thursday, April 19, 12