Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7

992 views

Published on

2015年9月10日にdb tech showcase 2015 Sapporo HOKKAIDOでnMySQL 5.7の技術アップデートセッションの資料です。MySQL 5.7 RC2(リリース候補版第2弾)で実装された新機能をご紹介しています。 #dbts2015 #dbts-sapporo-2015

Published in: Technology
  • Be the first to comment

[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7

  1. 1. Copyright*©*201 ,*Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL&5.7&&& & Ryusuke*Kajiyama*/* */*@RKajiyama* MySQL*Sales*ConsulIng*Senior*Manager,*Asia*Pacific*&*Japan* The&State&of&the&Dolphin
  2. 2. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* SAFE*HARBOR*STATEMENT* 2*
  3. 3. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* The*world's*most*popular*open*source*database* * 3
  4. 4. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 20 15 10 5 *A*Year*of*Anniversaries!
  5. 5. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 20*MySQL 20 * 15*MySQL 15 10*Innobase 10 5* 5 *A*Year*of*Anniversaries!
  6. 6. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 6*
  7. 7. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* The*world's*most*popular*open*source*database* * DB_Engines.com* h`p://db_engines.com/en/* SNS
  8. 8. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* •  MySQL & * •  * –  Oracle,*Red*Hat,*CentOS** –  Fedora* –  Ubuntu,*Debian* •  * –  SUSE* –  * –  DevOps * •  * –  MySQL*Database* –  MySQL*Workbench* –  MySQL*Connector/ODBC* –  MySQL*Connector/Python* –  MySQL*Connector/NET* –  MySQL*UIliIes* * * 12* MySQL :*Yum,*APT,*NuGET*
  9. 9. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* GitHub MySQL & •  MySQL Git* –  * –  * –  * •  GitHub*for*MySQL*Community* –  * –  h`ps://github.com/mysql* –  :*h`p://mysqlrelease.com* 13*
  10. 10. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.6* h7p://dev.mysql.com/doc/refman/5.6/ja/index.html 14
  11. 11. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Enterprise*EdiIon 15
  12. 12. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 1 SCSK 16 1 MySQL MySQL MySQL Enterprise Monitor Query Analizer MySQL
  13. 13. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* ID UIDAI:&Unique&IdenJficaJon&Authority&of&India 17 *(UIDAI:* Unique*IdenIficaIon*Authority*of* India Aadhaar ID 2015 8 9 ID * MySQL UID MySQL MySQL ACID
  14. 14. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* ** * •  * •  * •  * •  * •  * •  * •  * •  * •  •  * •  * •  * •  * * MySQL*Enterprise*EdiIon* 18*
  15. 15. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* “ MySQL DBA”## # MySQL*Enterprise*Monitor •  MySQL * •  MySQL * * * •  * •  & •  SQL Query*Analyzer*
  16. 16. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL&Enterprise&Backup& •  / * •  •  *&* * MySQL&Enterprise&Security& •  (PAM,* Windows,*LDAP,*etc.)* • MySQL*Enterprise*Monitor MySQL&Enterprise&EncrypJon& • AES256 * •  /* * •  * MySQL&Enterprise&Audit& •  SQL * •  * •  XML * MySQL*Enterprise*EdiIon
  17. 17. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Enterprise*Firewall* •  SQL*InjecIon*ProtecIon*with*PosiIve*Security*Model* •  Out*of*policy*database*transacIons*detected*and*blocked* •  Logging*&*Analysis* 21*
  18. 18. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Support * •  & SQL & –  & & –  & h7p://wwwPjp.mysql.com/support/consultaJve.html& •  & –  & –  &
  19. 19. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Support * •  & – CPU & •  & –  & h7p://www.oracle.com/jp/support/lifeJmePsupport/index.html& h7p://wwwPjp.mysql.com/support/&
  20. 20. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* Oracle*Enterprise*Manager*for*MySQL* Web & •  70% MySQL * – Web * –  * * ** 24*
  21. 21. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Enterprise*EdiIon*&*Cluster*CGE * 30 & •  Oracle&SoWware&Delivery&Cloud& h`p://edelivery.oracle.com/** * •  * “MySQL*Database”* * •  * h`p://dev.mysql.com/doc/index_ enterprise.html* * *
  22. 22. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Cluster*7.4*GA 26
  23. 23. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 1,000 MySQL*Cluster 27 Paypal 1 20 203 30% MySQL MySQL Cluster AWS 5 1/3 MySQL “NoSQL SQL ” Daniel Austin, Chief Architect, PayPal h7p://wwwPjp.mysql.com/customers/view/?id=1223
  24. 24. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* :* * •  * •  * •  * •  * •  * •  * •  * •  * •  * •  *&* * •  4 MySQL*Cluster *Linux Windows* MySQL*User*Conference*Session:*h`p://bit.ly/ogeid3*
  25. 25. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Cluster:*SQL*and*NoSQL*Hybrid*APIs AcJvePAcJve&RDBMS && NoSQL& 29 MySQL*Cluster*Data*Nodes* Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps JPA Cluster*JPA PHP Perl Python Ruby JDBC Cluster*J JS Memcached MySQL JNI Node.JS ndb_eng NDB*API*(C++)
  26. 26. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Cluster*7.4*GA* •  200*Million*NoSQL* Reads/Sec* •  2.5M*SQL*Ops/Sec* •  50%*Faster*Reads* •  40%*Faster*Mixed* Performance* •  AcIve_AcIve* Geographic* Redundancy* •  Conflict*DetecIon/ ResoluIon* AcIve_AcIve* •  5X*Faster* Maintenance*Ops* •  Detailed*ReporIng* Management* 30*
  27. 27. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Cluster*7.4*–* NoSQL:*20 / & * FlexAsych*(C++*NDB*API) SQL:*250 / & * DBT2*BM 31 !"!!!! !50,000,000!! !100,000,000!! !150,000,000!! !200,000,000!! !250,000,000!! 2! 4! 6! 8! 10! 12! 14! 16! 18! 20! 22! 24! 26! 28! 30! 32! Reads&per&second& Data&Nodes& FlexAsync&Reads& !"!!!! !500,000!! !1,000,000!! !1,500,000!! !2,000,000!! !2,500,000!! !3,000,000!! 2! 4! 6! 8! 10! 12! 14! 16! SQL$Statements/sec$ Data$Nodes$ DBT2$SQL$Statements$per$Second$
  28. 28. Copyright*©*201 ,*Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL& & & *
  29. 29. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 33 4.0& /GIS*(MyISAM)* UPDATE/DELETE* Oracle*MySQL* Sun* 3.23& MyISAM* InnoDB* * 5.1& * * * * * 5.6& memcached*API* UNDO * Global*TransacIon*ID* * ALTER*TABLE* * 5.5& InnoDB * * PERFORMANCE_SCHEMA* 1.0P3.22 & *(ISAM,*HEAP) Windows /64bit * *(SJIS/UJIS) 5.0& * / / * XA INFORMATION_SCHEMA* 4.1& Unicode * * CSV,*ARCHIVE* ndbcluster* 1995 2000 2005 2010 2015 5.7+& * * * * CJK /GIS*(InnoDB)* * * NoSQL * * *
  30. 30. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* •  MySQL*5.0*(2005)* –  * –  * –  * –  * –  * – XA * – INFORMATION_SCHEMA* •  MySQL*5.1*(2008)* –  * * –  * –  * * –  * –  34 •  MySQL*5.5*(2010)* – InnoDB * –  * * –  * * – PERFORMANCE_SCHEMA MySQL
  31. 31. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* •  * –  * –  * – SSD * – UNDO * –  * – JSON*EXPLAIN* – Memcached*API* •  – Global*TransacIon*ID* –  * –  * – Binlog* * –  * –  * * –  35 •  * –  ALTER*TABLE* –  * * –  * * –  * •  * •  SHA256* •  * MySQL*5.6
  32. 32. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.6:*InnoDB*–* ALTER&TABLE •  ADD/DROP*INDEX* •  ADD/DROP*COLUMN* •  ADD/DROP*FOREIGN*KEY* •  RENAME*COLUMN,*TABLE* •  CREATE*PRIMARY*KEY* •  ALTER*ROW_FORMAT,*KEY_BLOCK_SIZE* •  ALTER*COLUMN*NULLABLE,*NOT_NULLABLE* • 
  33. 33. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.6:*InnoDB •  * •  / * •  ID & :* mysql> SET innodb_buffer_pool_dump_at_shutdown=ON; :* mysql> SET innodb_buffer_pool_load_at_startup=ON;* ! * * ! * SaaS *
  34. 34. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* CREATE TABLE t(c1 INT) engine=InnoDB; FLUSH TABLE t FOR EXPORT; -- quiesce the table and create the meta data file $innodb_data_home_dir/test/t.cfg UNLOCK TABLES; CREATE TABLE t(c1 INT) engine=InnoDB; -- if it doesn't already exist ALTER TABLE t DISCARD TABLESPACE; -- The user must stop all updates on the tables, prior to the IMPORT ALTER TABLE t IMPORT TABLESPACE; MySQL*5.6:*InnoDB •  MySQL * – Export* – Import
  35. 35. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.6:*InnoDB RDBMS NoSQL •  Memcached*API * –  Memcached * – SQL •  NotOnlySQL * –  * –  JOIN FK SQL •  * – mysqld Memcached * –  InnoDB*API memcached* * InnoDB&Storage&Engine& MySQL&Server& Memcached&plugin& ApplicaJon& SQL&& (MySQL&Client)& NoSQL&& (Memcached& &&Protocol)& mysqld&
  36. 36. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* InnoDB*memcached*Plugin •  The*mapping*is*done*through*specifying*corresponding*column*values*in* containers*table:* mysql> desc containers; +------------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------------+--------------+------+-----+---------+-------+ | name | varchar(50) | NO | PRI | NULL | | | db_schema | varchar(250) | NO | | NULL | | | db_table | varchar(250) | NO | | NULL | | | key_columns | varchar(250) | NO | | NULL | | | value_columns | varchar(250) | YES | | NULL | | | flags | varchar(250) | NO | | 0 | | | cas_column | varchar(250) | YES | | NULL | | | expire_time_column | varchar(250) | YES | | NULL | | | unique_idx_name_on_key | varchar(250) | NO | | NULL | | +------------------------+--------------+------+-----+---------+-------+ 9 rows in set (0.02 sec)
  37. 37. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7*RC2 41
  38. 38. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7*Release*Candidate*2*Available!* 42* InnoDB :* * Online&Bulk*load* * * *(mulI_source,*mulI_threaded*slaves )* :* greater*user*control*&*be`er*query*performance* Performance*Schema * MySQL*SYS*Schema * &&& & & MySQL*5.6 2 * :** ,* & * NEW!*JSON Support*(now*in*labs)* RC2* And*many*more*new*features*and*enhancements...*h`p://mysqlserverteam.com/the_mysql_5_7_7_release_candidate_is_available/*#
  39. 39. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 0& 100,000& 200,000& 300,000& 400,000& 500,000& 600,000& 700,000& 8& 16& 32& 64& 128& 256& 512& 1,024& Queries&per&Second& ConnecJons& MySQL&5.7:&Sysbench&Read&Only&(Point&Select)& MySQL&5.7& MySQL&5.6& MySQL&5.5& MySQL*5.7:*Sysbench*Benchmark* * Intel(R)*Xeon(R)*CPU*E7_4860*x86_64* 4*sockets*x*10*cores_HT*(80*CPU*threads)* 2.3*GHz,*512*GB*RAM* Oracle*Linux*6.5* &&&&&&&&&&2x&Faster&than&MySQL&5.6& & & & &3x&Faster&than&MySQL&5.5& 645,000&QPS& 43*
  40. 40. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* InnoDB* * Thank*you,*SanDisk*Fusion_io* •  * –  * – IO * –  * OS (NVMFS) * •  IO ** – MySQL * –  * –  SSD * •  InnoDB UNDO * 44* RC2*
  41. 41. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7:* *–* & SQL •  * – * * – * * •  * –  I/O * –  * •  * •  EXPLAIN JSON * * 45*
  42. 42. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7:*OpImizer*_*JSON*EXPLAIN * •  JSON*EXPLAIN * –  * – MySQL*Workbench Visual*Explain * { "query_block": { "select_id": 1, "cost_info": { "query_cost": "200.40" }, "table": { "table_name": "nicer_but_slower_film_list", "access_type": "ALL", "rows_examined_per_scan": 992, "rows_produced_per_join": 992, "filtered": 100, "cost_info": { "read_cost": "2.00", "eval_cost": "198.40", "prefix_cost": "200.40", "data_read_per_join": "852K" }, "used_columns": [ "FID", "title", "description", "category", "price", "length", "rating", "actors" ], ...
  43. 43. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* InnoDB&P&General&Tablespace&Support 47 A*general*tablespace*is*a*shared*tablespace,*similar*to*the*system*tablespace.*It*can*hold*mulIple*tables,*and*supports*all* table*row*formats.*General*tablespaces*can*also*be*created*in*a*locaIon*relaIve*to*or*independent*of*the*data*directory.* [USER01]>*CREATE*TABLESPACE*U_TABLESPACE01*ADD*DATAFILE*'/home/mysql/user_tablespace01.ibd'*Engine=InnoDB;* Query*OK,*0*rows*affected*(0.01*sec)* [USER01]>*CREATE*TABLESPACE*U_TABLESPACE02_8K*ADD*DATAFILE*'/home/mysql/user_tablespace02_8k.ibd'*FILE_BLOCK_SIZE*=**8192*Engine=InnoDB;* Query*OK,*0*rows*affected*(0.01*sec)* * [USER01]>*CREATE*TABLE*`T_USER01`*(* >**`id`*int(11)*NOT*NULL*AUTO_INCREMENT,*`text`*varchar(100)*DEFAULT*NULL,*PRIMARY*KEY*(`id`)* >**)*TABLESPACE*=*U_TABLESPACE01*ENGINE=InnoDB*AUTO_INCREMENT=1*DEFAULT*CHARSET=uÄ8mb4;* Query*OK,*0*rows*affected*(0.01*sec)* * *[USER01]>*CREATE*TABLE*`T_USER02_8K`*(* >*`id`*int(11)*NOT*NULL*AUTO_INCREMENT,*`text`*varchar(100)*DEFAULT*NULL,*PRIMARY*KEY*(`id`)* >)*TABLESPACE*=*U_TABLESPACE02_8K*ENGINE=InnoDB*AUTO_INCREMENT=1*DEFAULT*CHARSET=uÄ8mb4** >*ROW_FORMAT=COMPRESSED*KEY_BLOCK_SIZE*=8;* Query*OK,*0*rows*affected*(0.00*sec) 13.1.15&CREATE&TABLESPACE&Syntax&
  44. 44. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* InnoDB*_**Temporary*Tables* •  * – CREATE/DROP * – DDL , I/O * •  DML * – No*REDO*logging,*no*change*buffering,*less*locking* •  * – ACID/MVCC * –  * 48* 14.11&InnoDB&Startup&OpJons&and&System&Variables&
  45. 45. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* InnoDB*_*NaIve*parIIoning*Support InnoDB * •  •  49 Handler* *(ha_innopart)* Encapsulate*all*parIIoning*in*one*single&handler InnoDB&NaJve&ParJJoning&–&Early&Access& main*handler& (ha_parIIon) ParIIon*1* handler& ha_innobase ParIIon*2* handler& ha_innobase ParIIon*N* handler& ha_innobase ………
  46. 46. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* & •  *( )** •  * –  * * –  * – JOIN * •  OR * * 50*
  47. 47. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* InnoDB*_*Full*Text*Search*(FTS) •  N_gram * –  * •  mecab * –  51 CREATE TABLE `N_DEMO`( `FTS_N_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) DEFAULT NULL, PRIMARY KEY (`FTS_N_ID`), FULLTEXT KEY `ngram_idx` (`title`) /*!50100 WITH PARSER `ngram` */ ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; CREATE TABLE `M_DEMO` ( `FTS_M_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) DEFAULT NULL, PRIMARY KEY (`FTS_M_ID`), FULLTEXT KEY `mecab_idx` (`title`) /*!50100 WITH PARSER `mecab` */ ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
  48. 48. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7*RC * •  Performance&Schema:*性能統計情報のさらなる追加* •  * •  SYSLOG Linux/Windows * •  GIS InnoDB Boost.Geometry * •  Security , * 52* •  ReplicaJon*for*be`er*scalability*and*availability* •  Fabric*for*high*availability*and*sharding*
  49. 49. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL&SYS&Schema& DB管理者、開発者や運用担当者を支援& •  DB管理者や運用担当者の作業効率を改善& *_*サーバの稼働状況、ユーザやホストの状況、主要な稼働指標*** *_*性能問題の発見、分析および改善* * •  状況をより簡単に把握し理解するための複数のビュ ー& *_*IO量の高いファイルや処理、ロック、コストの高いSQL文*** *_*テーブル、インデックス、スキーマの統計*** •  他のデータベースにおけるSYS類似機能:* _  Oracle*V$表*****(動的パフォーマンスビュー)* _  MicrosoÉ*SQL*Server*DMV (Dynamic*Management*Views)* 53*
  50. 50. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* & 54* • Resize&the&InnoDB&Buffer&Pool&online** –  オンラインでのバッファーサイズのチューニング* –  データベースの使用パターンの変化にリアルタイムで適応* • Separate&UNDO&tablespace& –  自動オンラインUNDOログ切り捨て(MySQL*5.7.5∼)* –  UNDOログファイルサイズの増加を回避する事が可能* • Dynamic&configuraJon& –  Making*exisIng*seÑngs*dynamically*configurable* –  As*a*design*principle*for*new*features*&*seÑngs* –  その他、幾つかのレプリケーションの設定変更等も*   オンラインで変更可能になりました。* 14.4.8*TruncaIng*Undo*Logs*That*Reside*in*Undo*Tablespaces*
  51. 51. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* •  * –  * –  * •  OGC(Open*GeospaIal*ConsorIum) * –  * •  Boost.Geometry * –  * –  * •  Boost.Geometry * MySQL&5.7:&GIS&P&Boost.Geometry & 55* ALTER*TABLE* add*SPATIAL*index( );
  52. 52. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7.7* •  mysql_install_db * – mysqld __iniIalize __iniIalize_insecure * •  CREATE*USER ALTER*USER * – SSL,*PASSWORD*EXPIRE,*ACCOUNT*[LOCK*|*UNLOCK]* •  mysql.user Password authenIcaIon_string * •  SET*PASSWORD PASSWORD() * – ALTER*USER * •  ENCRYPT,*DES_ENCRYPT,*DES_DECRYPT *AES 56 mysqld*__iniIalize*__user=mysql mysql_install_db*__user=mysql
  53. 53. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* Security&P&EncrypJon,&Passwords,&InstallaJon& •  AES*256*EncrypIon*(Default*in*MySQL*5.7*)* •  * –  * •  * –  / * –  ,* (test),* * 57* [&Global&ConfiguraJon&]& SET*GLOBAL*default_password_lifeIme*=*180;* [&Individual&user&accounts&]& ALTER*USER*joro@sv1*PASSWORD*EXPIRE*INTERVAL*90*DAY;* ALTER*USER*joro@sv1PASSWORD*EXPIRE*DEFAULT;* ALTER*USER*joro@sv1PASSWORD*EXPIRE*NEVER;*
  54. 54. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* •  * 1 * –  * –  * –  * •  & * * •  * MySQL*5.7:*MulI_Source*ReplicaIon* Binlog* Master*1* Binlog* Master*2* …* …* Binlog* Master*N* IO*1* Relay*1* Coordinator* W1* W2* …* WX* IO*2* Relay*2* Coordinator* W1* W2* …* WX* …* …* Coordinator* W1* W2* …* WX* IO*N* Relay*N* Coordinator* W1* W2* …* WX* Slave& 58*
  55. 55. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7:*スキーマ内マルチスレッドスレーブ* •  * 5 * –  * –  * * •  GTID*&* * * •  Sysbench*OLTP*test* – 1,000 * – SSD*/*48*core*HT*/*512*GB*RAM* * 59* 0* 500* 1000* 1500* 2000* 2500* 3000* 3500* 4000* 4500* 5000* 0* 4* 16* 25* 50* 100* 200* Worker&Threads& Slave&TransacJons&per&Second& Baseline* 50*clients* 100*clients* 150*clients* 200*clients* PPslavePparallelPtype& & 1.&DATABASE**:*(Default)*Use*the*db*parIIoned*MTS*(1*worker*per*database)* 2.&LOGICAL_CLOCK:**Use*logical*clock*based*parallelizaIon*mode.&
  56. 56. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 60 GTID (gId_mode) Enabling&Global&TransacJon&IdenJfiers&Without&DownJme&in&MySQL&5.7.6& 1.*Disable*all*write*operaIons.* 2.*Wait*for*all*transacIons*to*propagate** ****from*the*master(s)*to*all*slaves.* 3.*Stop*all*servers.* 4.*On*each*server,*set*gId_mode=ON*in*the*configuraIon* file.* 5.*Start*all*servers.* 6.*Enable*write*operaIons.* It*is*sIll*possible*to*use*the*old,*offline*procedure.** The*procedure*is*as*follows: Offline*procedure* Online*procedure* 詳細:*17.1.5.2*Enabling*GTID*TransacIons*Online* * 17.1.5.4*Verifying*ReplicaIon*of*Anonymous*TransacIons* 1* SET*@@GLOBAL.ENFORCE_GTID_CONSISTENCY*=*WARN; 2 SET*@@GLOBAL.ENFORCE_GTID_CONSISTENCY*=*ON; 3 SET*@@GLOBAL.GTID_MODE*=*OFF_PERMISSIVE; 4 SET*@@GLOBAL.GTID_MODE*=*ON_PERMISSIVE; 5 SHOW*STATUS*LIKE*'ONGOING_ANONYMOUS_TRANSACTION_COUNT'; 6 SET*@@GLOBAL.GTID_MODE*=*ON; 7 On*each*server,*add*gId_mode=ON*to*my.cnf.* 8 STOP*SLAVE*;* CHANGE*MASTER*TO*MASTER_AUTO_POSITION*=*1;* START*SLAVE; 各サーバーで以下のコマンドを実行 MySQL*ReplicaIonの設定や運用を簡素化する為に、GTIDモードのレプリケーションを利用する方法がありますが、既にGTID モード以前のレプリケーションで運用されている場合は、稼働中の全てのサーバーを停止してからGTIDモードのレプリケー ションへ移行する必要がありました。しかし、稼働中のサービスを停止して切り替える事は難しいのが現実です。* MySQL*5.7.6*以降のMySQLにアップグレードする事で、オンラインのままMySQLのレプリケーションを切り替える事が出来るよ うになりました。* 5.6.x* Standard* ReplicaIon 5.7.6 * Standard* ReplicaIon 5.7.6 * GTID*Mode* ReplicaIon ① ②
  57. 57. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Fabric*1.5:* *&* * •  OpenStack* * •  * –  ;* * •  * –  * •  * –  * –  * •  Fabric :*Python,*Java,* PHP,*.NET,*C*(labs)* –  * * 61* MySQL&Fabric& Connector* ApplicaIon* ReadPslaves& mappings& SQL& HA&group& ReadPslaves& HA&group& Connector* ApplicaIon*
  58. 58. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 62 MySQL*Slave*ReplicaIon*Filters*Dynamic* REPLICATE_DO_DB** REPLICATE_IGNORE_DB** REPLICATE_DO_TABLE** REPLICATE_IGNORE_TABLE* REPLICATE_WILD_DO_TABLE* REPLICATE_WILD_IGNORE_TABLE* REPLICATE_REWRITE_DB* MySQL_5.7.3 “CHANGE'REPLICATION'FILTER”& * *slave** MySQL_5.7.3 OpIon (my.cnf) MySQL The*following*slave*replicaIon*filters*can*be* changed*dynamically*using*this*command. mysql>*STOP*SLAVE*SQL_THREAD;* Query*OK,*0*rows*affected*(0.05*sec)* mysql>*CHANGE*REPLICATION*FILTER* REPLICATE_DO_DB=(db1);* Query*OK,*0*rows*affected*(0.00*sec) )* MySQLP5.7.3P&Making&MySQL&Slave&ReplicaJon&Filters&Dynamic&
  59. 59. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Labs 63
  60. 60. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*Labs •  * –  * •  MySQL MySQL*Cluster * – MySQL*5.6*memcached*API* – MySQL*Cluster*7.2*memcached*API* – MySQL*5.6*Performance*Schema* – MySQL*5.6*Intra_schema*MulI*Thread*Slave* – MySQL*5.6*Online*Alter*Table* – MySQL*5.7*MulI*Source*ReplicaIon* – MySQL*5.7*New*OpImizer*Cost*Model
  61. 61. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* •  ” ” * •  * –  ( * –  “OpImisIc*State*Machine”* * •  * –  * –  / * –  * –  * •  * –  InnoDB* –  GTID * –  PERFORMANCE_SCHEMA* MySQL*5.7:* * ApplicaIon* MySQL*Masters* ReplicaIon** Plugin* API* MySQL* Server* Group*Comms* (Corosync)* 65* labs.mysql.com*
  62. 62. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* MySQL*5.7:*JSON* •  * •  JSON * –  * •  JSON * –  * – SQL * •  Generated*Columns( ) ** –  * •  h`p://mysqlserverteam.com/json_labs_release_overview/* RC2*
  63. 63. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* 5.6& MySQL&Server&P&GA& InnoDB & & &&&NoSQL & MySQL&Cluster&P&GA& 2 NoSQL 200 SQL & & 7.4& 5.7& MySQL&Server&P&RC2& &&& & JSON Group&ReplicaJon & 67
  64. 64. Copyright*©*201 *Oracle*and/or*its*affiliates.*All*rights*reserved.**|* The*world's*most*popular*open*source*database* * 68

×