mysql enterprise encryption 〃 非対称暗号化(公開鍵暗号)の業界標準機能を提供...

181

Upload: lyngoc

Post on 11-Mar-2018

224 views

Category:

Documents


1 download

TRANSCRIPT

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

MySQL 製品概要 updated: 2017/09/28

日本オラクル株式会社 MySQL Global Business Unit

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Safe Harbor Statement

以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。 また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメントするものではない為、購買決定を行う際の判断材料になさらないで下さい。 オラクル製品に関して記載されている機能の開発、リリースおよび時期については、 弊社の裁量により決定されます。

3

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 4

The world's most popular open source database 世界で最も普及しているオープンソース データベース

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 5

例) DB-Enginesによる調査結果

The world's most popular open source database

• http://db-engines.com/en/ranking

• データベースソフトウェアの普及度や人気を、インターネット上の求人情報や職務経歴上での経験、および検索エンジンやSNSでの情報量を元に、毎月を作成し公開。

• Oracle DBに続いて第2位

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 6

MySQLの歴史

4.0 全文検索/GIS (MyISAM) 複数テーブルUPDATE/DELETE 組み込みライブラリ型サーバ

Oracle MySQL Sun

3.23 MyISAM InnoDB レプリケーション

5.1 プラグガブル・ ストレージエンジン・ アーキテクチャ パーティショニング タスクスケジューラ

5.6 memcached API UNDO表領域 Global Transaction ID マルチスレッドスレーブ(DB) オンラインALTER TABLE トランスポータブル表領域

5.5 InnoDBがデフォルトに 準同期型レプリケーション PERFORMANCE_SCHEMA

1.0-3.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 GA 2015年10月21日 - 5.7.9 GA 新コストモデル オプティマイザ ロスレス レプリケーション マルチソース レプリケーション グループ レプリケーション マルチスレッドスレーブ 全文検索CJK対応/GIS (InnoDB) セキュリティ強化 (コンプライアンス対応) NoSQLオプション (JSON) General Tablespace Performance: Benchmark

・ 1995年:スウェーデンにてMySQL AB設立 (2005年:オラクルがInnobase Oyを買収) ・ 2008年:Sun MicrosystemsがMySQL ABを買収 ・ 2010年:オラクルがSun Microsystemsを買収

8.0 DMR データディクショナリ 文字コードutf8mb4 Invisible Indexes セキュリティROLE Descending Index Common Table Exp

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle Database & MySQL

• MySQLはWebにおけるデファクトスタンダード

• MySQLとOracleの両方を運用されるお客様にもより多くのメリット

• より多くのお客様の要件にお応えするために更なる連携と機能強化

7

Complementary 「補完関係」

例) Webアプリケーション データマート&アナリティクス 部署単位カスタム・アプリケーション

例) 大規模データベース 大規模データマート&アナリティクス 全社向け大規模アプリケーション 大規模なERP, CRM等

事前のビジネスプランニングと 十分な予算取り

予測を立てるのが困難で予算取りが難しいビジネス。

会社としてオープンソースを推進

MySQLスタッフ増強: エンジニアX2, 品質管理 X3, サポート X2

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle製品との動作保証

• Oracle Linux

• Oracle VM

• Oracle Solaris

• Oracle Clusterware

• Oracle Solaris Cluster

• Oracle Secure Backup

8

• Oracle Enterprise Manager

• Oracle Fusion Middleware

• Oracle GoldenGate

• Oracle Data Integrator

• Oracle Audit Vault & Database Firewall

• Oracle OpenStack for Oracle Linux/Solaris

MySQL Integrates into your Oracle Environment

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 9

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 10

Facebook Application MySQLは10億人以上のユーザーが使用するFacebookを支えています。Facebookでは、数万台のMySQLサーバーを使用し、典型的なサーバーでは1~2TBのデータを保持しています。そして1秒当たり1120万行の更新処理と2.5億行の参照処理をMySQLで処理しています。

※2015年12月のデイリーアクティブ利用者は10億4,000万人 ※2015年12月31日時点での月間アクティブ利用者数は15億9,000万人

Why MySQL? 「私達はMySQLよりも優れているものを見つけられていない」 Venkat Venkataramani, Director of Engineering , Facebook

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 11

Twitter Application 典型的な日では、1日当たり5億ツイート(つまり、1秒当たり約5,700ツイート)以上をMySQLで処理しています。2013年8月には、世界新記録となる143,199ツイート/秒を記録しました。

※https://twitter.com/ User:3億2,000万人

Why MySQL? 「パフォーマンス、レプリケーション、データ圧縮機能、トランスポータブル表領域、監視&診断機能が強化されているから」 Calvin Sun, Senior Engineering Manager, Twitter

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 12

YouTube Application YouTubeでは、毎月6億時間以上の動画が再生されています。そして、毎分100時間の動画がアップロードされています。あなたがYouTubeで動画を見る場合、そのデータはMySQLから取得されています。

※https://www.youtube.com User:10 億人以上

Why MySQL? "Anybody that tells you that MySQL does not scale probably has not considered exactly how to solve the problem." Mike Salomon, one of the original YouTube engineers

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 13

Booking.com Application Booking.comは2003年からMySQLを使用しています。MySQLはアジャイル開発モデルとBooling.comの60-70%の年間成長率を支えています。毎日、70万部屋がBooking.comを通して予約されています。 • 60 MB/秒 (イベントのデータ量) • 20億イベント/日 • 15 TB のデータ量(イベント処理、検索、など) • 150 TB のデータ量(アーカイブ用) http://www.booking.com 施設:220カ国・810,000以上の宿泊施設

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 14

なぜMySQLを使うのか?

初期コストを抑え、ビジネス変化に応じて追加投資可能

パフォーマンスがよく、 拡張性も高い

信頼性が高い 簡単に使える

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 15

MySQLのコミュニティ版と商用版 MySQL はデュアルライセンスソフトウェアです。ビジネスの変化や状況に応じて、 CommunityやCommercial Editionを使い分けて頂く事で,常に最適なソリューションを選択可能。

• MySQL Community Server

• MySQL Cluster

• MySQL GUI管理ツール

• MySQLコネクタ (JDBC, ODBC, etc.)

• ドキュメント

•フォーラム

Community Edition (GPL)

•Standard Edition

•Enterprise Edition

•MySQL Cluster Carrier Grade Edition

•商用ライセンス (組み込み用)

•プロフェッショナルサービス

• トレーニング、コンサルティング、サポート

Commercial Edition

コミュニティ版ソフトウェアはGPLv2でソースコードも公開し提供 商用版は、付加価値として技術サポートや管理機能、拡張機能を有償で提供

参考:MySQL Downloads

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 16

MySQL Enterprise Edition のサービスカテゴリー

管理ツール 拡張機能 サポート

•拡張性 •高可用性 •統合認証 •監査 •非対称暗号化 •ファイヤーウオール •透過的データ暗号化

•監視 •バックアップ •開発 •管理 •マイグレーション

•技術サポート •コンサルティングサポート •オラクル製品との 動作保証

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 17

MySQL Editions Standard Edition Enterprise Edition Cluster CGE

機能概要 MySQL Database ✔ ✔ ✔ MySQL Connectors ✔ ✔ ✔ MySQL Replication ✔ ✔ ✔ MySQL Router ✔ ✔ MySQL Partitioning ✔ ✔ Storage Engine: MyISAM, InnoDB ✔ ✔ ✔ Storage Engine: NDB (ndbcluster) ✔ MySQL Workbench SE/EE* ✔ ✔ ✔ MySQL Enterprise Monitor* ✔ ✔ MySQL Enterprise Backup* ✔ ✔ MySQL Enterprise Authentication (外部認証サポート)* ✔ ✔ MySQL Enterprise TDE (Transparent Data Encryption)* ✔ ✔ MySQL Enterprise Encryption (非対称暗号化)* ✔ ✔ MySQL Enterprise Firewall (SQLインジェクション対策)* ✔ ✔ MySQL Enterprise Audit (ポリシーベース監査機能)* ✔ ✔ MySQL Enterprise Scalability (スレッドプール)* ✔ ✔ MySQL Enterprise High Availability (MySQL Group Replication)* ✔ ✔ Oracle Enterprise Manager for MySQL * ✔ ✔ MySQL Cluster Manager (MySQL Cluster管理)* ✔ MySQL Cluster Geo-Replication ✔

*商用版のみで利用可能な追加機能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 18

MySQL Editions Standard Edition Enterprise Edition Cluster CGE

Oracle Premium Support

24時間365日サポート ✔ ✔ ✔

インシデント数無制限 ✔ ✔ ✔

ナレッジベース ✔ ✔ ✔

バグ修正&パッチ提供 ✔ ✔ ✔

コンサルティングサポート ✔ ✔ ✔

オラクル製品との動作保証

Oracle Linux、Oracle Solaris、Oracle VM ✔ ✔ ✔

Oracle Clusterware、Oracle Solaris Cluster ✔ ✔

Oracle Enterprise Manager ✔ ✔

Oracle GoldenGate ✔ ✔

Oracle Data Integrator ✔ ✔

Oracle Fusion Middleware ✔ ✔

Oracle Secure Backup ✔ ✔

Oracle Audit Vault and Database Firewall ✔ ✔

Oracle OpenStack for Oracle Linux/Oracle Solaris ✔ ✔

※最新の対比表は、MySQL Editionsのサイトを参照下さい

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 19

MySQL Enterprise Edition管理ツールと拡張機能概要 MySQL Enterprise Edition 目的 概要

MySQL Enterprise Monitor TCO削減 複数サーバの一括監視、警告通知、クエリ性能分析

Oracle Enterprise Manager for MySQL 〃 Oracle Enterprise ManagerからMySQLを統合監視可能

Oracle Premier Support 〃 24x7, インシデント無制限、コンサルティングサポート

MySQL Enterprise Scalability 品質維持 Thread Poolプラグインによる性能拡張性の向上

MySQL Enterprise Backup 機会損失対策 高速なオンラインバックアップ、ポイントインタイムリカバリ

MySQL Enterprise High Availability 〃 MySQL Group Replicationを使用した高可用性構成

MySQL Enterprise Authentication セキュリティ コンプライアンス対応

LDAPやWindows Active Directoryによる外部認証

MySQL Enterprise TDE 〃 データベースオブジェクトの透過的暗号化

MySQL Enterprise Encryption 〃 非対称暗号化(公開鍵暗号)の業界標準機能を提供

MySQL Enterprise Firewall 〃 SQLインジェクション対策、怪しいSQLをブロック/検知

MySQL Enterprise Audit 〃 ユーザ処理の監査、Oracle DBと同じツールで管理可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 20

管理ツール、拡張機能の対応バージョン、バイナリ入れ替え要否

MySQL Enterprise Edition バイナリ入れ替え 対応バージョン

MySQL Enterprise Monitor 必須では無い(※)

・監視対象サーバー:MySQL 5.0以降 ・マネージャーサーバーのサポートプラットフォーム https://www.mysql.com/support/supportedplatforms/enterprise-monitor.html

MySQL Enterprise Backup(MEB) 必須では無い(※)

・MEB 4.0 : MySQL 5.7 ・MEB 3.12 : MySQL 5.5、MySQL 5.6

MySQL Enterprise High Availability 必須では無い MySQL 5.7.17以降

MySQL Enterprise Authentication 必須 MySQL 5.5.16以降

MySQL Enterprise TDE 必須 MySQL 5.7.12以降

MySQL Enterprise Encryption 必須 MySQL 5.6.21以降

MySQL Enterprise Firewall 必須

MySQL 5.6.24以降 ※DETECTINGモードはMySQL 5.6.26以降で使用可能

MySQL Enterprise Audit 必須

MySQL 5.5.28以降 ※監査ログの詳細な絞り込みはMySQL 5.7.13以降で実施可能

MySQL Enterprise Scalability 必須 MySQL 5.5.16以降

※コミュニティ版のMySQL Serverに対して追加インストールすることも可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 21

世界最大規模のバイオメトリクス国民ID管理システム

アプリケーション

インド固有識別番号庁 (UIDAI: Unique Identification Authority of India)が導入を進める、Aadhaarと呼ばれる国民ID番号。2014年1月に6億ID突破。政府機関だけではなく、金融機関や通信業者からも利用。

※ 2016年5月現在 10億以上のIDをMySQLで管理

MySQL導入の効果

UIDマスタデータベースとしてシャード構成の商用版MySQLサーバにて安定稼働中。

MySQL導入の理由

ACIDなトランザクションに対応し、シ

ステムの成長に応じて段階的に拡張ができるスケールアウト構成が取りやすい点。

UIDAI: Unique Identification Authority of India 段階的な拡張で、初期投資を抑え,成長に伴う国民IDの増加を柔軟にサポート

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 22

1万人規模の社員が利用する基幹業務システムでの利用

アプリケーション

経費精算、勤怠管理や業務ワークフローシステムなど1万人規模の社員が利用する基幹システム。 MySQLを利用して個別に構築されていた業務システムを統合。

MySQL導入の効果

MySQL Enterprise Monitorによる包括的な監視と、Query Analizerでの

高速かつ高度なクエリ性能分析によって、高品質なシステムを短期間で実現。

MySQL導入の理由

事前評価での技術面およびコスト面での優位性を確認。サポートサービスや管理ツールが包含されており、企業システムにも安心して導入可能。

SCSK株式会社 MySQL Enterprise Monitorを活用し、 管理工数削減と品質管理を実現

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 23

8,000万人を誇る旅行のクチコミと比較サイトを強力に支援

アプリケーション

対前年比20%以上で成長を続ける

旅行ポータルビジネスの基盤を刷新し、年間利用者数8,000万人を誇

る旅行のクチコミと比較サイトをMySQLで強力に支援

MySQL導入の効果

MySQL Standard Editionで提供されて

いるサポートを使用することで、明確な回答と提案を得ることが出来、工数削減とシステムの安定化を実現。

MySQL導入の理由

「MySQLを利用する最大のメリットは、

かなりの量の情報がコミュニティに公開されており、機能の開発も活発なことです。これに日本オラクルのサポートが加わることで、さらに安心感が高くなりました。」

フォートラベル株式会社 コンサルティング・サポートを活用し、 工数削減とサービス品質向上を実現

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 24

その他事例) 株式会社スクウェア・エニックス様 http://www.oracle.co.jp/customers/CustomerSnapshot_SQUARE-ENIX_MySQL.pdf ソニー株式会社様 http://www.oracle.com/us/corporate/customers/customersearch/sony-7-mysql-ss-jap-2413264-ja.html 新生銀行様 http://www.mysql.com/why-mysql/case-studies/mysql-cs-shinseibank-ja/ アンリツネットーワークス株式会社様 http://www.oracle.co.jp/customers/CustomerSnapshot_Anritsu_Networks_MySQL_JA.pdf 株式会社 oricon ME様 http://itpro.nikkeibp.co.jp/atclact/activewp/b/17/04/05/00251/ その他の事例 https://www.mysql.com/why-mysql/case-studies/

【ツール】総所有コスト(TCO)計算ツール https://www-jp.mysql.com/tcosavings/

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Edition TCO削減:統合監視、サービス品質管理、機会損失削減

25

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Monitor

•複数のMySQLサーバを一括監視可能なダッシュボード

• システム中のMySQLサーバやレプリケーション構成を自動的に検出し監視対象に追加

•ルールに基づく監視と警告

•問題が発生する前に通知

•問題のあるSQL文の検出、統計情報の分析が可能なQuery Analyzer

26

参照:MySQL Enterprise Monitor "バーチャルなMySQL DBA"

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

クエリ解析機能 - MySQL Query Analyzer

•全てのMySQLサーバの 全てのSQL文を一括監視

• vmstatなどのOSコマンドやMySQLの SHOWコマンドの実行、 ログファイルの個別の監視は不要

• クエリの実行回数、エラー回数、 実行時間、転送データ量などを 一覧表示

• チューニングのための 解析作業を省力化

27

負荷の高い処理を特定

早期対応と改善

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

スロークエリログと比べた場合の利点

•実行統計を参照

•原因となるアプリケーションの特定

•一定期間の間、全体的なクエリーのパフォーマンスを確認

•該当のクエリーが発生した時間軸で確認可能

•実行計画を参照可能

•特定クエリー、特定ホスト、期間に焦点を置いて確認可能

•他のパフォーマンスグラフと特定クエリーの相関性を確認可能

28

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

レプリケーションモニター

• レプリケーショントポロジーの自動検知

• マスター/スレーブのパフォーマンス監視

• レプリケーションアドバイザーによるサポート

• レプリケーションのベストプラクティスを提示

29

レプリケーション環境の安定運用を支援

レプリケーションの遅延を検知して通知

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

参考:レプリケーション

• MySQLの標準機能

– シンプルな設定、マスター/スレーブ構成

• 非同期型 or 準同期

• 特徴

– 参照性能を向上させる構成

– バックアップ用途での利用も

– 基本は一方向でのデータコピーだが、 双方向や循環型での利用も可能 (データの更新には注意が必要)

• 更新ログ(bin-log)を利用

30

多数のWebサイトで実績があるMySQLの人気機能 Webアプリケーションでは参照が95% 更新が5%というケースも (Digg.com)‏

シンプルなスケールアウト構成によって 簡単に20倍以上の性能向上が図れる

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

レプリケーションモニター:トポロジビュー

• レプリケーション・グループ設定の監視

• レプリケーションチャネルビュー

•複数トポロジ対応(マスタ/スレーブ、マルチソース、円形、リング)

31

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

レプリケーションモニター:トポロジビュー

32

•包括的にInnoDB clustersをサポート

–トポロジビュー

–詳細なメトリックとグラフ

–ベストプラクティスのアドバイス

• MySQL Routersのモニタリング

• Group Replicationのモニタリング

NEW 3.4

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 33

S

S

M

参考: MySQLレプリケーショントポロジー

M M/S S

S

M

M

M M M

用途に応じて、最適なレプリケーションのトポロジーを選択可能

マスターから、スレーブへ多段階にデータ同期

複数マスターから1台のスレーブへデータ同期 複数マスター間でデータ同期

マスターから複数スレーブへデータ同期

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Best Practice Advisors

• MySQLベストプラクティスを適用可能

• 14アドバイザのカテゴリー

• 250以上のサブアドバイザカテゴリー

•閾値ベースの警告管理 –指数移動平均

–変更率の検知

•問題解決のアドバイスを提供

34

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Best Practice Advisors

•監視環境を素早く構築 –カスタムスクリプトの作成、 展開、バージョニング、管理に かかる時間を短縮

• DB管理者だけでは 発見不可能な問題や チューニング方法をアドバイス

35

利点

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Best Practice Advisors: Security

• MySQLセキュリティのベストプラクティスを適用 – 脆弱性の識別

– セキュリティ強化の方針に対する現在の設定を評価します

•監視と警告 – ユーザーアカウントとパスワード

– ファイヤーウオールの状況, 有効性, 危険性

– バックアップのセキュリティとデータ損失をモニタリング

– スキーマ変更をトラッキング

– 設定変更とチューニングに関してのアドバイス

• ユーザーセキュリティを集中管理

36

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Monitor + Backup

•バックアップ結果のモニタリング

•バックアップパフォーマンスのモニタリング

•最新バックアップ取得を確実にする事が可能

37

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Monitor

•権限コントロール(管理者、読み込み)

• マルチテナンシーをサポート (サービス毎、管理者毎)

• SYSベースのファイルI/O待機レポート・プロセス確認

• Firewall, Audit機能等のセキュリティ対応

38

Access Control Lists, New Reports

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle Enterprise Manager for MySQL

•推計70%のオラクルデータベースのお客様がMySQLを併用 – Webやカスタムアプリケーション、部門システム、組み込みアプリケーション

–もっともご要望の多かった製品連携

• MySQL 5.7 サポート

• Enterprise Audit サポート

• Enterprise Firewall サポート

39

Webおよびクラウド向けオラクル製品を単一のダッシュボードで管理

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 40

Oracle Enterprise Manager for MySQL概要

機能 概要

可用性のモニタリング 可用性監視と測定によるSLA管理

パフォーマンスモニタリング パフォーマンス指標とKPI管理

設定のモニタリング 構成収集とオプションの変更履歴管理

アラートと通知 SMTP, SNMP, OS コマンド, スクリプト

全ての使用可能なメトリックを収集 500以上の指標を収集

レポート 時系列グラフを含むパフォーマンスレポート

MySQLの自動検知 プラグインは リモート監視をサポートするため、各サーバーへの Oracle Management Agent のインストールは不要

動画によるデモは、MySQL Enterprise Managerのサイトにて視聴可能です。 参考:Oracle Enterprise Manager for MySQL

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Backup

• InnoDBのオンラインバックアップツール

• フル、増分、部分バックアップ(圧縮可能)

• マルチスレッドによる並列バックアップ&リカバリ処理

• クラウドストレージとの直接の連携(S3, Swift API)

•バックアップの暗号化 – AES 256

• Oracle Secure Backupとの連携

41

高速、オンラインバックアップ & リカバリ

MySQL Enterprise Backup の特徴と利点

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 42

高速なオンラインバックアップ&リカバリー処理により、機会損失を最小限に抑える事が可能

高速なバックアップとリカバリー

mysqldumpより49倍速い mysqldumpより80倍速い

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

機会損失の例

• システム冗長化を行っている事を前提にデータ復旧が発生した場合の リカバリー時間でのシュミレーション

•売上を10億とした場合の時間当たりの損失を11.4万円、0.19万/分 として換算

43

データ復旧時間 機会損失

18時間45分(1,125分) 213.75万円

14分 2.66万円

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Monitor: Backup

•バックアップ結果のモニタリング

•バックアップパフォーマンスのモニタリング

•最新バックアップ取得を確実にする事が可能

44

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Monitor: Backup

•バックアップの状態監視 –データセンター全体のバックアップ監視

•バックアップジョブ詳細の確認 –容易なバックアップ、リカバリが可能

•全てのバックアップ・タイプをサポート

•重要なイベントを警告

–パフォーマンスの悪いバックアップ

–バックアップジョブの失敗

–古いバックアップデータの確認

NEW 3.3

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Workbench

•管理ツール

• SQLエディタ

• Performance Dashboard

• Visual Explain

• GIS Viewer

• ER図作成、フォワード/ リバースエンジニアリング、 など豊富な機能

46

データベースアーキテクト、開発者、DBA のための統合ビジュアルツール

商用版のみの機能: DBドキュメント出力、データモデルの検証、 MySQL Enterprise Backup, Audit, FirewallのためのGUI

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Workbench

•移行元 – Microsoft SQL Server, PostgreSQL,

Sybase ASE, Sybase SQL Anywhere, SQLite, Microsoft Access, MySQL, and more

• オブジェクトとデータの移行

• MySQLバージョンアップグレード (テスト環境用)

47

データベース・マイグレーション・ウィザード

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Workbench EE + Audit

•監査イベントへ迅速且つ容易に アクセス可能

• インデックスを利用した監査 ログの検索が可能 –イベントタイプ

–ユーザーアカウント

–日付範囲

–テキストマッチ

48

EE限定機能との連携

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Workbench EE + Firewall

• Firewall機能の有効・無効化

• User and Privileges設定 –アカウント毎のMode設定

– White List追加・削除

49

EE限定機能との連携

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Workbench EE + Backup&Restore

•バックアップジョブの作成と管理 –新規バックアップジョブの作成・スケジュール化と自動実行

–有効なバックアップジョブ確認・最新バックアップアクティビティの確認

•バックアップデータのリストア (フル、差分、部分)

50

EE限定機能との連携

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Edition 拡張機能と包括的なセキュリティ対策

51

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 52

MySQL Enterprise Scalability : Thread Pool

MySQL Enterprise Edition

Thread Pool有り

MySQL Community Edition

Thread Pool無し

MySQL 5.6.11 Oracle Linux 6.3、Unbreakable Kernel 2.6.32 4 sockets、24 cores、 48 Threads Intel(R) Xeon(R) E7540 2GHz CPUs 512GB DDR RAM

参照:MySQL Enterprise Scalability Thread Poolでスケーラビリティが60倍向上

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Scalability : Thread Pool

• スレッド・グループ数を設定可能(デフォルト = 16)

– 各スレッドグループは最大4096再利用可能なスレッドをサポート

• ラウンド・ロビンによって各接続をスレッド・グループに割り当て

• スレッドは優先付けされステートメントキューに挿入される

– サーバの負荷や接続増加に対応したスケーラビリティを確保

53

内部クライアント

Connection Execution Threads

外部クライアント

Thread Pool

Thread Group 1 Threads 1 - 4096

Thread Group 2 Threads 4097 - 8193

Thread Group N Threads 8194 - N

Thread Group 1

Thread Group 2

Thread Group N

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Authentication

• PAM(Pluggable Authentication Modules) –外部認証方式へのアクセス

–標準のインタフェース(Unix, LDAP, Kerberosなど)

–プロキシ/非プロキシユーザー

• Windows

–ネイティブWindowsサービス(WAD)へのアクセス

– Windowsにログイン済みユーザを認証

• プラガブル認証API

54

外部認証のサポート

MySQLアプリケーションを既存のセキュリティ・インフラストラクチャ/SOPと統合

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Audit

• ログオン、クエリーの情報を監査可能

• ユーザがポリシーを設定可能:フィルタリング、ログローテーション

•動的に設定を変更可能:Audit設定時にサーバの再起動が不要

• Oracleの仕様に合わせXMLベースの監査ログを出力 (Oracle Audit Vaultとの互換性(ログフォーマット))

•サイズに基づいた監査ログファイルの自動ローテーション

• MySQL 5.5のAudit APIを使って実装 / MySQL 5.5.28 以上で使用可能

55

ポリシーベースの監査機能を提供

コンプライアンス対応等で監査が必要なアプリケーションでもMySQLを利用可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 56

ポリシーベースの監査機能を提供

MySQL Enterprise Audit

2. User Joe connects and runs a query

1. DBA enables Audit plugin

3. Joe’s connection & query logged

WHO

WHERE

WHEN

WHAT

管理者

Joe (ユーザー)

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 57

監査ログ絞込み(Legacy Mode:アカウント、ステータス)、ログローテーション設定等

MySQL Enterprise Audit 基本設定

root@localhost [world]> show variables like 'audit%';

+-----------------------------+-----------------------------------------------------------+

| Variable_name | Value |

+-----------------------------+-----------------------------------------------------------+

| audit_log_buffer_size | 524288 |

| audit_log_connection_policy | ERRORS |

| audit_log_current_session | ON |

| audit_log_exclude_accounts | |

| audit_log_file | enterprise_audit.log |

| audit_log_flush | OFF |

| audit_log_format | NEW |

| audit_log_include_accounts | fw_user@localhost,[email protected],root@localhost |

| audit_log_policy | ALL |

| audit_log_rotate_on_size | 2097152 |

| audit_log_statement_policy | ALL |

| audit_log_strategy | ASYNCHRONOUS |

+-----------------------------+-----------------------------------------------------------+

監査対象アカウントを設定

ログローテーションサイズ

新規接続の監査時に、エラーになった接続だけ監査

参照) https://dev.mysql.com/doc/refman/5.7/en/audit-log-legacy-filtering.html

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

{ "filter": { "class": { "name": "connection" } } }

New Audit Filtering • DBAによる柔軟な監査設定が可能 –非常にきめの細かいルールを設定可能

• 監査ログファイルのサイズを最小限に抑える事が可能

• ファイルシステムI/Oとストレージを抑えパフォーマンスを向上させる(最小限のアイテムのみ取得)

• 必用最小限のログから、必要な情報を瞬時に確認する事が可能

• JSONを使用して定義

–全体的な監査ルール • サーバー全体的に監査を行いたい場合

• 廃止:新しい監査ログフィルタリングの使用を推奨。

NEW 5.7.13

58

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 59

5.7.13以降はJSON定義での詳細フィルター可

MySQL Enterprise Audit 監査ログ絞り込み設定(5.7.13~)

root@localhost [mysql]> select * from audit_log_user;

+--------------+------+------------------+

| USER | HOST | FILTERNAME |

+--------------+------+------------------+

| confidential | % | log_confidential |

+--------------+------+------------------+

1 row in set (0.00 sec)

root@localhost [mysql]> select * from audit_log_filter¥G

*************************** 1. row ***************************

NAME: log_confidential

FILTER: {"filter": {"class": {"name": "table_access", "event": {"log": {"field": {"name":

"table_name.str", "value": "tbl_confidential"}}, "name": "read"}}}}

1 row in set (0.00 sec)

参照) https://dev.mysql.com/doc/refman/5.7/en/audit-log-filtering.html

監査対象アカウントを設定

監査対象テーブル 特定の処理を監査

テーブル アクセス

READ

INSERT

UPDATE

DELETE

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 60

監査ログのフィルタリングとモニタリング mysqlauditgrep audit log search utility (正規表現含む、ログのフィルターをサポート) http://dev.mysql.com/doc/mysql-utilities/1.3/en/mysqlauditgrep.html

[root@GA01 security]# mysqlauditgrep --format=VERTICAL --pattern="delete" /usr/local/mysql/data/enterprise_audit.log ************************* 1. row ************************* STATUS: 0 NAME: Query TIMESTAMP: 2015-08-04T22:31:11 UTC COMMAND_CLASS: delete CONNECTION_ID: 18 HOST: localhost USER: root[root] @ localhost [] STATUS_CODE: 0 RECORD_ID: 406966_2015-08-04T17:36:50 SQLTEXT: delete from tbl_partition where member_id = 1 and month = 5

delete文だけ絞込み

✉ メール SNMP

閾値

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Encryption

• MySQLの暗号化ライブラリ – AES256による対称鍵暗号

–公開鍵 / 非対称鍵暗号

• キーの管理 –公開鍵および秘密鍵の生成

–鍵交換方式: RSA, DSA, DH

•署名とデータの検証 –電子署名、検証、妥当性確認のための暗号学的ハッシュ関数

• Oracle Key Vaultとの統合

61

非対称暗号: RSA, DSA, and DH 等の暗号化をサポート

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Encryption Encryption/Decryption within MySQL

機密情報 機密情報

Private / Public Key Pairs - create_asymmetric_priv_key ファンクションでPrivate鍵を発行 - create_asymmetric_pub_key ファンクションでPublic鍵の発行 - 外部で生成された鍵を使用 (e.g. OpenSSL)

Encryption Public Key

Decryption Private Key

Encrypted Data

62

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Encryption App Encrypts/MySQL Decrypts

Encryption Public Key

Decryption Private Key

Encrypted Data

機密情報

Applications

機密情報

BC31EA6386CDE70C38F8052B170DDCDB614BEF08633F0179B4BF3E7ABD8B891BA5E2B374980E1D5815B58

63

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Encryption App Encrypts / MySQL Stores / MySQL Decrypts

Encryption Public Key

Decryption Private Key

Encrypted Data

機密情報 機密情報

Applications Applications

BC31EA6386CDE70C38F8052B170DDCDB614BEF08633F0179B4BF3E7ABD8B891BA5E2B374980E1D5815B58

64

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle Key Vault - Oracle Key Vaultにて鍵を作成 - 外部で生成された鍵を使用(e.g. OpenSSL)

Encryption Public Key

Decryption Private Key

Encrypted Data

機密情報

Applications

機密情報

MySQL Enterprise Encryption Oracle Key Vault Generates Keys (or externally generated)

BC31EA6386CDE70C38F8052B170DDCDB614BEF08633F0179B4BF3E7ABD8B891BA5E2B374980E1D5815B58

65

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Firewall • SQLインジェクション対策、リアルタイムで保護

– ホワイトリストモデル、実行されるクエリーを分析してホワイトリストと照合

• 学習してホワイトリストを自動作成

– ユーザー毎に、SQL実行パターンを記録して自動的にホワイトリストを作成

• 不審なアクセスを「検知」または「ブロック」

– ポリシーに違反するトランザクションを「検知」しログに記録

– ポリシーに違反するトランザクションを「検知」しログに記録しつつ、 「ブロック」

• 透過的

– アプリケーションを変更する必要無し

• Enterprise Monitorと連携しモニタリングと検知

– 閾値ベースで管理者にメールやSNMPで連絡しエスカレーション

66

MySQL Enterprise Firewall monitoring

MySQL 5.6.24 (2015-04-06) ~ Protection from SQL Injection Attacks - #1 Web Application Vulnerability - 77% of Web Sites had vulnerabilities

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Firewall: オペレーティングモード

67

ALLOW In Whitelist

Blocks SQL Attacks

Allows “Matching” SQL

Table

Table

Table

BLOCK NOT In Whitelist

BLOCK and ALERT

DETECT (IDS) NOT In Whitelist

ALLOW and ALERT

Table

Table

Table

許可– SQLを実行 - SQL Matches Whitelist ブロック– リクエストをブロック - Not in Whitelist 検知– SQLを実行 & アラート - Not in Whitelist

1

2

3

Table

Table

Table

Allows SQL & Alerts

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Firewall

• データを全件検索する 不審なアクセスのブロック例

68

select * from FW_DEMO where id = 3;

select * from FW_DEMO; Block & Log ✖

Allow & Log ✔

White List

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Firewall 使用方法

• プロシージャーをコールするだけで制御可能 –追加のネットワーク機器等は不要

– MySQLインスタンス内に完全統合

• ユーザー毎にFirewall設定可能

69

学習 CALL sp_set_firewall_mode('fw_user@localhost','RECORDING');

防御 CALL sp_set_firewall_mode('fw_user@localhost','PROTECTING');

検知 CALL sp_set_firewall_mode('fw_user@localhost','DETECTING');

無効化 CALL sp_set_firewall_mode('fw_user@localhost','OFF');

初期化 CALL sp_set_firewall_mode('fw_user@localhost','RESET');

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Firewall 使用方法

• コマンドで操作する以外にも、MySQL Workbench からGUIでユーザー毎のFirewall有効/無効や、ホワイトリストの追加・削除等を行う事が可能

70

ルール追加

ルール削除

ファイルからルール追加

ルールをファイルに保存

ルールをリセット

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Firewall 使用方法

•関連するステータス変数 – Firewall_access_denied : ブロックした数

– Firewall_access_granted : ブロックしなかった数

– Firewall_access_suspicious : 検知した数

– Firewall_cached_entries : 記録した数

71

インクリメントカウンタから稼働状況を確認

[test]> SHOW STATUS LIKE 'Firewall%'; +-----------------------------+-------+ | Variable_name | value | +-----------------------------+-------+ | Firewall_access_denied | 15 | | Firewall_access_granted | 5 | | Firewall_access_suspicious | 10 | | Firewall_cached_entries | 2 | +-----------------------------+-------+

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 72

MySQL Enterprise Monitor との連携(グラフによる可視化、Alertの送信)

MySQL Enterprise Firewall 使用方法

✉ メール・SNMP

閾値

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise TDE(Transparent Data Encryption)

• シンプルなデータ暗号化(AES256)

• OSのファイルシステム上、バックアップメディア上のデータを保護

•鍵管理機能を含む(鍵の保護、ローテーション、など) – Oracle Key Vaultと連携可能(KMIP v1.2に対応)

–鍵管理は、セキュリティ対策上重要なポイント

– 2層暗号化鍵アーキテクチャを採用(マスター暗号化鍵、表領域鍵から構成)

• アプリケーションの変更不要

•簡単な設定で導入可能

•高パフォーマンス(オーバーヘッドが少ない)

73

NEW 5.7.12

~

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 74

MySQL Enterprise TDE(Transparent Data Encryption)

暗号化された 表領域ファイル

暗号化鍵

クラッカー、 悪意のあるOSユーザー

ファイルに直接アクセス、 ファイルを盗んで手元のMySQLサーバーに

配置してデータへアクセス

暗号化により、データを保護

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

セキュリティ規制が求めるもの

•鍵を安全に管理し、定期的に鍵を変更することが求められている –最小限の場所に保管

–最小限の管理者がアクセス可能

3.5 Store cryptographic keys in a secure form (3.5.2), in the fewest possible locations (3.5.3) and with access restricted to the fewest possible custodians (3.5.1)

3.6 Verify that key-management procedures are implemented for periodic key changes (3.6.4)

And more!

PCI DSS v3.0 November 2013

75

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 76

鍵管理の課題

管理

• 鍵の安全な共有方法、管理方法

• ローテーションによる鍵の増加

• 鍵の可用性、保持期間、古い鍵の管理 (古いバックアップからのリカバリ時に必要)

セキュリティ規制

• 鍵と暗号化データの物理的な分離

• 定期的なローテーション

• 鍵の監視と監査

• 鍵と暗号化データの長期保存

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise TDE 使用方法

•事前設定(暗号化鍵をファイルシステムで管理する場合) – early-plugin-load に keyring_file.so を指定

– keyring_file_data を任意のディレクトリに設定(暗号化鍵の配置先を指定)

•事前設定(暗号化鍵をOracle Key Vaultで管理する場合) – Oracle Key Vaultのインストール、設定

– early-plugin-load に keyring_okv.so を指定

– keyring_okv_conf_dir を設定(Oracle Key Vault関連ファイルの配置先を指定)

77

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise TDE 使用方法

•使用方法 – CREATE TABLE / ALTER TABLE 時に ENCRYPTION='Y' を指定

– ALTER INSTANCE ROTATE INNODB MASTER KEY でマスター暗号化鍵を ローテーション可能 • 表領域鍵は変更されないため、暗号化データの複合/再暗号化は発生しない

• 容易にローテーション可能

78

[NEW57]> show create table T_TDE¥G ************************ 1. row ************************ Table: T_TDE Create Table: CREATE TABLE `T_TDE` ( `id` int(11) NOT NULL AUTO_INCREMENT, `confidential` varchar(60) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ENCRYPTION='Y' 1 row in set (0.00 sec)

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle Key Vault(OKV) と連携可能

• Oracle KMIP Client Library を使用

•鍵を安全に管理 – DBA はマスター暗号化鍵を管理しない

– OKV 管理者のみがマスター暗号化鍵にアクセス可能

– OKV により、冗長化やバックアップ等の仕組みも提供

• セキュリティ規制を順守

79

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL 5.7 Key Ring

MySQL Process

In Memory Key Ring

OKV or KMIP Compliance Key Vault

Get/Put MySQL Keys On MySQL KeyRing

鍵リングの鍵は、内部コンポーネント内部コードまたは 内部のプラグインにのみアクセス可能です KEY RINGを保持しない: メモリ内のみに保持・保護 http://mysqlserverteam.com/mysql-enterprise-transparent-data-encryption-tde-provides-at-rest-encryption-for-physical-innodb-tablespace-data-files/

80

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

OKV

参考) More Detailed Architecture of Transparent Data Encryption in MySQL

81

Database

MySQL server

Plugin & Services

Infrastructure

InnoDB ENC1

ENC2

PT1

Client

Keyring plugin

• Transparent Data Encryption • Master Key : 256 bit

• Stored outside the database • Table encryption

• Per table encryption key • Protected by master key • 256 bit

• AES CBC for data encryption

Keys

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Audit MySQL Enterprise Firewall MySQL Enterprise Encryption MySQL Enterprise Transparent Data Encryption

82

参考)セキュリティ対策

参照) IPA http://www.ipa.go.jp/security/vuln/10threats2015.html

参照) JNSA http://www.jnsa.org/result/incident/2012.html

企業の信頼性・ブランディングを守り、情報を保護し、損害賠償や有事の対応リスクを軽減します。 サイトやサービスによって、対策を使い分ける場合の選択肢としても利用可能。 ユーザー数が増える毎に、ビジネスは成長するが、 社会的責任も大きく増えていく傾向にある。

例) 金券500円の場合 1,500万人 X 500円 = 7,500,000,000円

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

技術サポートとコンサルティングサポート

83

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Enterprise Support

•最大のMySQLのエンジニアリングおよびサポート組織

• MySQL開発チームによるサポート

• 29言語で世界クラスのサポートを提供

• メンテナンス・リリース、バグ修正、パッチ、アップデートの提供

• 24時間x365日サポート

•無制限サポート・インシデント

• MySQL コンサルティング・サポート

84

Get immediate help for any MySQL issue, plus expert advice

~リモートDBAとして、是非ご活用ください!!~

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Supportの特徴

• 「パフォーマンス・チューニング」や「SQLチューニング」まで 通常サポートの範囲内

–コンサルティングサポートが含まれており、「クエリ・レビュー」、「パフォーマンス・チューニング」、「レプリケーション・レビュー」、「パーティショニング・レビュー」などに対応可能

–詳細はこちらを参照下さい http://www-jp.mysql.com/support/consultative.html

• ソースコードレベルでサポート可能 –ほとんどのサポートエンジニアがソースを読めるため、 対応が早い開発エンジニアとサポートエンジニアも 密に連携している

85

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Supportの特徴

•物理サーバー単位課金 – CPU数、コア数に依存しない価格体系

– 4CPUまで(コア数は制限無し)同一料金、5CPU以上の価格は営業問合せ

• コミュニティ版バイナリに対してもサポートを提供可能 –サブスクリプションを契約することで、バイナリを入れ替えずにサポートを受けられる (バイナリはオラクルが提供しているものをご使用ください)

–商用版の機能を使用する場合のバイナリ入れ替えの必要性については、P22参照

– Oracle CloudのMySQL Cloud Service以外のDBaaSはサポート対象外

• オラクルのライフタイムサポート –詳細はこちらを参照下さい

http://www.oracle.com/jp/support/lifetime-support/index.html http://www-jp.mysql.com/support/

86

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQLの高可用性構成

88

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 89

資産運用会社向けシステムの基幹データベースでの利用

アプリケーション

資産運用会社でのファンドマネージ

ャの業務支援や、資産管理、コンプ

ライ アンスチェック、約定管理など

のミッションクリティカルなフロント業

務向けシステムをSaaSとして開発

MySQL導入の効果

投資コストを抑えつつ、1 テラバイト

クラスの大量データを問題なく 扱う

ことができ、秒間 200 件を超えるト

ランザクションにも十分耐えうる。

MySQL導入の理由

「MySQLは使える!! MySQLは

RDBMSプロダクト品質も安定 して

います。さらにサービスが充実し て

いて安心。MySQL の特徴を活かし、

メリットを享受できるシステムは多い

はずです。 」

株式会社野村総合研究所

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 90

MySQLの高可用性構成のパターン

MySQL Cluster

MySQL Cluster

アプリケーション/ APサーバ

負荷分散

双方向 同期複製

• MySQL Cluster シェアードナッシング型高性能クラスタ

MySQL Server

• MySQLグループ・レプリケーション マルチマスタ構成も可能なレプリケーション拡張機能

アプリケーション/ APサーバ

負荷分散

仮想同期複製& 自動フェールオーバー

MySQL Server

アプリケーション/ APサーバ

共有ディスク

• Oracle Clusterwareなど 共有ディスクにデータを格納

フェールオーバー

MySQL Server

MySQL Server

アプリケーション/ APサーバ

負荷分散

非同期複製

• レプリケーション(標準機能) 非同期&準同期データレプリケーション

MySQL Server

MySQL Server

MySQL Server

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 91

複合型の高可用性構成 共有ディスク型構成+レプリケーション MySQL Cluster+レプリケーション

アプリケーション/ APサーバ

負荷分散

双方向 同期複製

MySQL

Cluster

非同期複製

アプリケーション/ APサーバ

MySQL

Server MySQL Server

MySQL

Server

非同期/ 準同期複製

アプリケーション/ APサーバ

参照処理の 負荷分散

MySQL

Server

MySQL

Server

MySQL

Cluster 双方向 同期複製

MySQL

Cluster

MySQL

Cluster

共有ディスク

グループレプリケーション+Router (MySQL InnoDB Cluster)

フェールオーバー

アプリケーション/ APサーバ

MySQL

Server

MySQL

Server

MySQL Router2.1

非同期/準同期 仮想同期複製

MySQL

Server MySQL

Server

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQLの高可用性構成 非同期

レプリケーション 準同期

レプリケーション グループ

レプリケーション クラスタウェア MySQL Cluster

アプリ接続先の 自動フェイルオーバー × ×

○ (MySQL Router 2.1を

使用) ○ ○

DBの自動 フェイルオーバー

△ (mysqlfailoverで可能)

△ (mysqlfailoverで可能) ○ ○ ○

障害発生時の データロス無し × ○ ○ ○ ○

冗長化による更新 処理に対する オーバーヘッド

ほぼ無し 有り 有り 無し 有り

クラスタモード マスター+スレーブ マスター+スレーブ シングルプライマリ or マルチマスター マスターのみ マルチマスター

共有ディスク 不要 不要 不要 必要 不要

ストレージエンジン InnoDB InnoDB InnoDB InnoDB NDB

サポートOS ALL ALL ALL ALL ALL

単一ベンダーサポート ○ ○ ○ △ ○

92

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Group Replication

93

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

グループレプリケーションとは?

• レプリケーション機能をベースとした、MySQL側でのフェイルオーバー 処理が不要な高可用性ソリューション

• MySQL5.7以降にプラグインとして追加インストール可能

• MySQLがサポートする全てのプラットフォームに対応 – Linux, Windows, Solaris, OSX, FreeBSD

•手軽に高可用性構成を実現可能 –複数台でグループを組み、全台が同じデータを持つ

– 3台以上の奇数でグループを構成することを推奨

• シングルプライマリーモード(デフォルト)とマルチマスターモードが使用可能

94

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

M S

S

S

S

M

更新処理 参照処理 参照処理

更新処理

参照増加? スレーブ 追加!

95

参照性能のスケールアウト

補足: レプリケーションの用途

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 96

冗長性: マスターがクラッシュした場合, スレーブをマスターに昇格

補足: レプリケーションの用途

C

B

A

C

B

A 障害発生

C

B

A

Bが新しい マスターに昇格

障害発生 構成変更

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

シングルプライマリーモード

•自動的なリーダー選択メカニズム – Secondaryノードは参照のみ可能 (書き込んだ場合: ERROR 1290)

97

S S S P S

Primary

ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

シングルプライマリーモード

•自動的なリーダー選択メカニズム –障害発生時は自動的にフェイルオーバー

–スレーブの中の1台が新Primaryになり、書き込み可能になる

–スレーブは自動的に新Primaryサーバーを参照

98

S S S P P

新Primary

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

マルチマスターモード:どこでも更新可能

•異なるサーバー上での2つのトランザクションは、同じデータを更新可能

•競合が検出された場合、自動的に対処される –先にコミットしたトランザクションが優先される

99

M M M M M

UPDATE t1 SET a=4 WHERE a=2 UPDATE t1 SET a=3 WHERE a=1

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

マルチマスターモード:どこでも更新可能

•異なるサーバー上での2つのトランザクションは、同じデータを更新可能

•競合が検出された場合、自動的に対処される –先にコミットしたトランザクションが優先される

100

M M M M M

UPDATE t1 SET a=4 WHERE a=2 UPDATE t1 SET a=3 WHERE a=1 OK OK

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

マルチマスターモード:どこでも更新可能

•異なるサーバー上での2つのトランザクションは、同じデータを更新可能

•競合が検出された場合、自動的に対処される –先にコミットしたトランザクションが優先される

101

M M M M M

UPDATE t1 SET a=2 WHERE a=1 UPDATE t1 SET a=3 WHERE a=1

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

マルチマスターモード:どこでも更新可能

•異なるサーバー上での2つのトランザクションは、同じデータを更新可能

•競合が検出された場合、自動的に対処される –先にコミットしたトランザクションが優先される

102

M M M M M

UPDATE t1 SET a=2 WHERE a=1 OK ERROR 1180 (HY000): Got error 149 during COMMIT

UPDATE t1 SET a=3 WHERE a=1

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

障害検知

•サーバーがグループから外れると、他のサーバーは自動的に検知する

103

M M M M M

メンテナンスや システムクラッシュが発生

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

障害検知

•サーバーがグループから外れると、他のサーバーは自動的に検知する

104

M M M M M

メンテナンスや システムクラッシュが発生

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

自動復旧

•サーバーが再びグループに参加すると、自動的に他のサーバーと同期する

105

M M M M M

グループに参加

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

自動復旧

•サーバーが再びグループに参加すると、自動的に他のサーバーと同期する

106

M M M M M

リカバリー → オンライン

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

自動復旧

•サーバーが再びグループに参加すると、自動的に他のサーバーと同期する

107

M M M M M

リカバリー → オンライン

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Group Replication: 提供する基本機能

•高可用性分散MySQLデータベースサービス –サーバのフェールオーバーを手動で処理する必要性を排除

–分散フォールトトレランス機能を提供

–どこでも更新可能な、アクティブ/アクティブのセットアップも構成可能

–再構成の自動化(ノードの追加/削除、クラッシュ、障害)

–トランザクション競合を自動的に検出して処理する

–データ損失に対する保証

108

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Group Replication: その他、導入を考慮するケース • Elastic Replication サーバーの数を動的に増減する必要があるレプリケーションインフラストラクチャで、 最小限の対応で対応する事が可能になります。

• Highly Available Shards シャーディングは、書き込みスケールアウトを実現する為の一般的なアプローチです。 ユーザーは、MySQLグループレプリケーションを使用して、フェデレーテッドシステムを構成し高可用性のシャードを実装できます。各シャードは各レプリケーショングループにマップする事が出来ます。 –マスター/スレーブレプリケーションの代替 –単一のマスターサーバーが競合ポイントになる可能性があります。 グループ全体へ書き込みする事で、特定状況下ではスケーラビリティが向上する可能性 があります。

109

ベンチマーク: http://mysqlhighavailability.com/an-overview-of-the-group-replication-performance/

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

必要要件 •現状では、IPv4のみサポート •低レイテンシ、広帯域の安定したネットワーク • InnoDBストレージエンジン •全てのテーブルに主キーが必要(Certification処理で必要) •バイナリログを出力し、フォーマットはROW • グローバルトランザクション識別子(GTID)有効 • その他、以下の設定 – master_info_repository=TABLE – relay_log_info_repository=TABLE – log_slave_updates=ON

– transaction_write_set_extraction=XXHASH64

110

参考 : https://dev.mysql.com/doc/refman/5.7/en/group-replication-requirements.html

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

制限事項

• グループ内の最大メンバー数は9メンバー

•バイナリログのチェックサムは未サポート(binlog_checksum=NONE を設定)

• セーブポイントは使用できない(MySQL 5.7.19以前)

• グループ内のサーバーとの連携処理において、LOCK TABLES、UNLOCK TABLES、GET_LOCK関数は考慮されない

111

参考 : https://dev.mysql.com/doc/refman/5.7/en/group-replication-limitations.html

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

制限事項

• マルチマスターモードの場合 –スキーマ変更処理中は別のサーバーから同じオブジェクトに対してDML, DDLにより オブジェクトやデータを変更できない http://lefred.be/content/mysql-group-replication-videocast-1/

–カスケードオプション付きの外部キー制約は未サポート

– SERIALIZABLE分離レベルは未サポート

112

参考 : https://dev.mysql.com/doc/refman/5.7/en/group-replication-limitations.html

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

その他の考慮事項

• スプリットブレインを考慮した場合、3台以上の奇数でグループを構成することを推奨 –現時点では、スプリットブレイン発生時の少数グループは読み取り専用モードになる (3台で構成し、2台と1台のグループに分断された場合、2台のグループはグループ・ レプリケーションとして稼働し続け、1台のグループは読み取り専用モードになる)

• マルチマスターモードで使用する場合 –他のメンバーとトランザクションが競合した場合、COMMIT時にトランザクションが 破棄される可能性があることを考慮してトランザクションを適切なサイズに保ち、 アプリケーションでリトライ処理等を実装する (長時間実行するバッチ処理等が、同じデータを更新する処理と被らないように!!)

–グループ内のサーバーとの連携処理によるロック待ちを軽減するために、 READ COMMITED分離レベルを推奨

• READ COMMITED分離レベルにすると、ギャップロックを取得しなくなるため

113

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

よくある質問

•書き込み処理をスケールアウトできますか? –書き込み処理の競合が発生しない場合、多少はスケールアウトできる可能性は ありますが、過剰な期待はしないでください。 書き込み処理をスケールアウトする必要がある場合は、アプリケーションレイヤーでの シャーディングを推奨します。

•単純なレプリケーション構成と比較して、ネットワーク帯域、CPUリソース、 メモリ使用量が増加しますか? –はい。サーバー同期処理等が行われるため、オーバーヘッドが増加します。

• あるノードが遅延している場合、他のノードは影響を受けますか? –はい。影響を受けます。現時点では、グループからメンバーを自動的に離脱する ポリシーはありません。稼働状況を監視し、必要に応じて手動でメンバーを離脱 させて下さい。

114

参考 : https://dev.mysql.com/doc/refman/5.7/en/group-replication-frequently-asked-questions.html

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL InnoDB Cluster

115

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL InnoDB Clusterとは?

•以下のコンポーネントの組み合わせから構成される MySQLの高可用性フレームワーク – MySQL Group Replication : DBの読み取り拡張性、自動フェイルオーバーを提供

– MySQL Router : アプリ接続先の自動フェイルオーバーを提供

– MySQL Shell : グループ・レプリケーション環境の構築、設定、Routerの設定

• 2017年4月12日 GA –以下の製品を個別にインストールすることで使用可能

• MySQL 5.7.19 (2017-07-17)

• MySQL Router 2.1.4 (2017-07-24)

• MySQL Shell 1.0.10 (2017-07-28)

116

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL InnoDB Cluster:ビジョン

"高可用性とスケーリング機能を包括的に備えた単一製品として、使いやすいエンドツーエンドの統合ソリューションを提供"

117

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL InnoDB Cluster:ゴール

118

統合製品: MySQL • 全てのコンポーネントを同時に開発

• 全てのコンポーネントを同時に検証

• 一つのパッケージとして提供

新しい技術と柔軟性 • C++ 11 (ISO標準 ISO/IEC 14882:2011)

• Protocol Buffers

• 開発フレンドリー

使いやすさ • 統合クライアント: MySQL Shell

• 容易なパッケージング

• 同種のサーバー群

スケールアウト • シャード・クラスター

• Nレプリカセットのフェデレーテッド構成

• 各レプリカセットによるシャードの管理

デモ: https://www.youtube.com/watch?v=JWy7ZLXxtZ4

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 119

スケールアウト High Performance

使いやすさ Built-in HA

全てを同梱したソリューション Everything Integrated

MySQL

InnoDB cluster

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL InnoDB Cluster: 全体アーキテクチャー

MySQL InnoDB

cluster MySQL Enterprise Monitor

mysql-js> cluster.status() { "clusterName": “NewAppCluster", "defaultReplicaSet": { "status": "Cluster tolerant to up to ONE failure.", "topology": { “hanode1:3306": { "address": “hanode1:3306", "status": "ONLINE", "role": "HA", "mode": "R/W",

120

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL InnoDB Cluster: 内部アーキテクチャー

121

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

HA

Group Replication

アプリケーションはMySQL Routerに接続

Group Replicationによる高可用性グループと メタデータの管理

MySQL Shellで設定管理が可能

+-------------------------------+ | Database | +-------------------------------+ | information_schema | | mysql | | mysql_innodb_cluster_metadata | | performance_schema | | sys | +-------------------------------+

mysql_innodb_cluster_metadata.* performance_schema.replication_group_members performance_schema.replication_group_member_stats

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Router 2.1

122

透過的にアプリケーション接続をルーティング

App Servers with MySQL Router

MySQL Group Replication

MySQL Shell Setup, Manage,

Orchestrate

•透過的にクライアント接続をルーティング –ロードバランシング

–アプリケーション接続フェイルオーバー

• InnoDB Clusterをネイティブサポート –グループレプリケーションの構成を認識可能

– InnoDB Clusterへのルーディングを動的に コントロール可能

–マルチマスターモード及びシングルマスターモードをサポート

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Shell

123

すべての運用管理タスクのための、統一された単一クライアント

App Servers with MySQL Router

MySQL Group Replication

MySQL Shell Setup, Manage,

Orchestrate

•多言語対応: JavaScript, Python, and SQL

• ドキュメントとリレーショナルモデルの両方をサポート

•開発と管理用に完全なAPIを提供 ”MySQL Shell provides the developer and DBA with a single intuitive,

flexible, and powerfull interface for all MySQL related tasks!”

[root@misc01 admin]# mysqlsh --help | egrep -i "Start in" --sql Start in SQL mode using a node session. --sqlc Start in SQL mode using a classic session. --js Start in JavaScript mode. --py Start in Python mode. [root@misc01 admin]#

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Shell: 管理用API

• mysql-js> dba.help()

• グローバル変数 ‘dba’がMySQLの管理用APIに アクセスする為に使用可能

• DBA管理オペレーション – Manage MySQL InnoDB clusters

• クラスター作成

• MySQLインスタンスの構築

• クラスターの状況を確認可能

• MySQLインスタンスの開始・停止

• MySQLインスタンスの検証 …

データベース管理者向けインターフェース

124

App Servers with MySQL Router

MySQL Group Replication

MySQL Shell Setup, Manage,

Orchestrate

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 125

mysql-js> dba.help() The global variable 'dba' is used to access the MySQL AdminAPI functionality and perform DBA operations.It is used for managing MySQL InnoDB clusters. The following properties are currently supported. - verbose Enables verbose mode on the Dba operations. The following functions are currently supported. - createCluster Creates a MySQL InnoDB cluster. - deleteLocalInstance Deletes an existing MySQL Server instance on localhost. - deployLocalInstance Creates a new MySQL Server instance on localhost. - dropMetadataSchema Drops the Metadata Schema. - getCluster Retrieves a cluster from the Metadata Store. - help Provides help about this class and it's members - killLocalInstance Kills a running MySQL Server instance on localhost. - resetSession Sets the session object to be used on the Dba operations. - startLocalInstance Starts an existing MySQL Server instance on localhost. - stopLocalInstance Stops a running MySQL Server instance on localhost. - validateInstance Validates an instance for usage in Group Replication. For more help on a specific function use dba.help('<functionName>') e.g. dba.help('deployLocalInstance')

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL InnoDB Clusterのチュートリアル

•以下のセミナー資料に、コマンド付きのMySQL InnoDB Clusterの チュートリアルが含まれています – MySQLの新しい高可用性構成

MySQLグループ・レプリケーションとMySQL InnoDB Cluster https://www.mysql.com/jp/why-mysql/presentations/mysql-innodb-cluster-201704-ja/

• チュートリアル動画もあります – https://youtu.be/RfyxlGS4Zks

126

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 127

今後の拡張機能

MySQL HA

Out-Of-Box HA

Read Scale-Out

Async Replication + Auto Failover

Write Scale-Out

Sharding Step1

Step2

Step3

* InnoDB Cluster Now GA!

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

S1 S2 S3 S4 S…

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

HA

MySQL InnoDB Cluster: Architecture – Step 2

Group Replication

Read-Only Slaves

128

Group Replicationに参照用の スレーブを接続する事が可能。 + 参照先のノードがダウンした場合、自動的に稼働中の他のグループメンバーを参照

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

S1 S2 S3 S4 S…

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

HA

Rep

licaS

et 1

S1 S2 S3 S4 S…

M

M M

MySQL Connector

Application

MySQL Router

HA

Rep

licaS

et 2

Rep

licaS

et 3

MySQL Connector

Application

MySQL Router

MySQL InnoDB Cluster: Architecture – Step 3

S1 S2 S3 S4 S…

M

M M

HA

129

Groupを分ける事による、 書き込みのシャーディング

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

InnoDB Clustersのシャーディング

• グループレプリケーション –各シャードは、高可用性構成のレプリカセットです

• MySQL Router

–シャードマッピングとメタデータを管理

–クライアントルーティングを管理

–クロスシャード実行フレームワークを提供 • サーバーにて分散クエリ実行

• MySQL Shell

–管理機能とオーケストレーション機能を提供

130

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 131

MySQL InnoDB Cluster: The End Goal

M

App

M M

MySQL Shell and Orchestration Tooling

M App

M M

Simple Shard Mapping, State and Extra

Metadata

Control, Coordinate, Provision

...

Monitoring (MEM)

MySQL Router Group Replication – Shard 1

Group Replication – Shard N MySQL Router

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Cluster Carrier Grade Edition

132

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Clusterとは?

• MySQLとは開発ツリーの異なる別製品

•共有ディスクを使わずに、アクティブ-アクティブのクラスタ構成が組める インメモリデータベース (一部のデータはディスクに格納することも可能)

•元々はSQLを使わないデータベースだったが、MySQLと統合されSQLも 使えるようになった(NoSQL(KVS)とSQLの両方が使えるデータベース) – MySQL Clusterの基礎となる技術は、通信機器ベンダのエリクソンで携帯通信網の加入者データベース向けに開発されたEricsson Network DataBase(NDB)と呼ばれ ていた技術

133

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

History of MySQL Cluster ”NDB”

90年代後期

Ericsson (Alzato) にて設計/開発

2003年

MySQL ABが NDB Cluster ProjectをEricssonから引き継ぎ開発 (MySQL 4.1)

2008年

SunがNDB Cluster Projectを引き継ぎ開発(MySQL 5.1/Cluster 6.x~ )

2010年

OracleがNDB Cluster Projectを引き継ぎ開発(MySQL 5.1 / Cluster 7.x~)

Original design paper: Design and Modelling of a Parallel Data Server for Telecom Application

MySQL Clusterの基礎となっている技術は、通信機器ベンダのエリクソンで携帯通信網の加入者

データベース向けに開発されたEricsson Network Data Base(NDB)と呼ばれていた技術が起源

Changes in MySQL 5.0.9 (2005-07-15)

Changes in MySQL 5.0.8 (Not released)

Changes in MySQL 5.0.7 (2005-06-10)

134

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Clusterが向いているシステム

•高可用性が求められるシステム –携帯電話の通信インフラを支えるために開発された技術がベース

–単一障害点が無い構成

–障害発生時に、アプリケーションは処理をリトライすれば存続したノードで処理を継続

•同時多発的に大量のトランザクションが発生するシステム –サーバー台数を増加することで負荷分散可能

•参照処理だけでなく、更新処理に対しても拡張性が求められるシステム –自動的にデータをシャーディングし、更新処理についても負荷分散可能

135

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 136

MySQL Clusterを導入済みのお客様

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 137

導入事例: 携帯電話ネットワーク

HLR / HSS

課金, 認証, VLR

認証, 追跡接続サービス, 課金

位置情報 の更新

プリペイ& ポストペイ課金

MySQL Cluster in Action: http://bit.ly/oRI5tF

• 大量の書き込みトランザクション

• 3ms未満のデータベースレスポンス

• 停止時間 & トランザクション消失 = ビジネスの損失

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 138

導入事例: 航空機管制システム • 米国海軍航空母艦

• 包括的航空機運用管制システム

• メンテナンス記録

• 燃料搭載量管理

• 気象状況

• 飛行甲板管理

• システム要件

• 単一障害点無し

• 完全な冗長性

• 小さなフットプリント & 過酷な利用環境での利用

• 4台のMySQL Clusterノード LinuxおよびWindows

MySQL User Conference Session: http://bit.ly/ogeid3

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 139

1,000億ドル以上の取引を守るMySQL Cluster

アプリケーション

世界最大級のオンライン決済サービス。Paypalの口座間やクレジットカ

ードでの送金や入金が可能。アクティブアカウント1億以上、20以上の通貨に対応し、203の国と地域で利用可能。年率30%の成長。

MySQL導入の効果

MySQL ClusterをAWSの5拠点に導入し、全世界で1/3秒未満のレイテンシ

を実現。リアルタイムでの不正検知が可能に。

MySQL導入の理由

「NoSQLの特徴である迅速な開発とSQLモデルの信頼性の両方のメリットを実装してるため」 Daniel Austin, Chief Architect, PayPal

PayPal

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 140

MySQL Cluster の特徴

• 永続性を持つインメモリテーブル + ディスクテーブル

• 低レイテンシ リアルタイム

• 自動シャーディング、マルチマスタ

• ACIDトランザクション、OLTPとリアルタイム分析

参照更新性能の 高い拡張性

• シェアードナッシング、単一障害点無し

• 自動復旧、オンラインメンテナンス 99.999% の可用性

• キー・バリュー型+複雑なリレーショナルな処理

• SQL + Memcached + JavaScript + Java + HTTP/REST & C++ SQL + NoSQL

• オープンソース+商用版運用支援ツール

• 特殊なハードウェア不要、管理監視ツール群、サポート 低コスト

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps

JPA

Cluster JPA

PHP Perl Python Ruby JDBC Cluster J JS Apache Memcached

MySQL JNI Node.JS mod_ndb ndb_eng

NDB API (C++)

NoSQL Access to MySQL Cluster data

MySQL Cluster Data Nodes

MySQL (ACID, JOIN, Replication等) NoSQL (ACID, Key Value, Performance)

141

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Cluster アーキテクチャ

142

データ・ノード (冗長化・データ分散)

データ、インデックス管理,トランザクション制御

ノード・グループ1

F1

F3

F3

F1

ノード

1

ノード

2

ノード・グールプ 2

F2

F4

F4

F2

ノード

3

ノード

4

アプリケーション・ノード(SQL, NoSQL) REST JPA

管理ノード 管理ノード (構成、調停) Cluster起動/停止 各ノードの設定管理 バックアップ/リストア スプリットプレイン解消

Sync

Sync

ノードの最大合計数は255台まで (データノードのIDは1~48)

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

データ・ノードでのデータ保持方法

データ・ノード

ノード・グループ1

F1

F3

F3

F1

ノード

1

ノード

2

ノード・グールプ 2

F2

F4

F4

F2

ノード

3

ノード

4

・主キーのハッシュ値で水平分割して、各データノードにデータを保持 ・ レプリカを別のデータ・ノードと持ち合う

書き込みは、ノード追加でオンラインスケール

参照は,PKベースであればリニアにスケール

PK以外で広範囲にデータ参照する場合は……

ID (PK) Product

F1 Sample 1

F2 Sample 2

F3 Sample 3

F4 Sample 4

143

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 144

Data Nodeの拡張(例) NDB API Case

SMALL Medium Large

例) Max 200M QPM and 20M UPM.

例) Max 600M QPM and 55M UPM. 例) Max 1100M QPM and 110M UPM

Data nodeは最大48台まで増設可能 (Node IDは、1~48を使用) → ノードを増やすことで、処理とデータの分散を行うので負荷を分散する事が可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

D1 D2 D3 D4

API ----------

----------

----------

TC TC TC TC

1

2

データアクセス: Primary Key lookup

1.APIは(ex: MySQL)、対象の行データが存在する データノードを見付ける為に、透過的に行のPKを ハッシュする

2.行を参照する為に、データノード上のOrdered Indexを参照

3. 対象行データをAPIに返す

145

PK col ordered

3

補足: ※ 高速且つ効率的でスケーラブル ※ PKには、ハッシュインデックスとオーダードインデックスの両方が 作成されます。これにより、高速なルックアップと範囲検索の両方 が可能になっています。オーダードインデックスが必要なければ テーブル定義においてUSING HASHオプションを使うことでハッシュ インデックスのみを作成します。但し、この場合は等価比較のみで インデックスを利用出来ます。

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

D1 D2 D3 D4

API ----------

----------

----------

TC TC TC TC

1

2

4

データアクセス: Unique key lookup

146

PK col PK col ordered

UK PK

3

1. Uniqueなハッシュ値をベースにどのデータ ノードがPKハッシュ値を保持しているか判断

2. PKハッシュ値を参照してどのデータノードが 対象行を保持しているか判断

3.行を参照する為に、行データを保持している データノード上のOrdered Indexを参照

4.対象行データをAPIに返す

補足: ※Secondary keysは,hidden/systemテーブルとして実装 ※ Hiddenテーブルは、新たなセカンダリーキーをPKと して保持し、 ベーステーブルのPKを値として保持。 ※データは、同一ノード若しくは他のノード ※ネットワークをまたぐ事によって、PKによるLookupよりも 若干Latencyが増加

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

D1 D2 D3 D4

API ----------

----------

----------

TC TC TC TC

1 3

2

データアクセス: Condition Pushdown (No Indexes Used)

147

1. WHERE句を含む参照リクエストを ランダムに選定されたノードに送信

2. WHERE句の要素を各データノードで フィルタリングしてから対象行データを APIに返す (データノード側でフィルタリング)

NOTE: engine_condition_pushdown - WHERE句の条件をデータノードへ送信 - データノード側でデータをフィルタリング - テーブルスキャン等を高速化

PK col PK col PK col PK col

- データはアプリケーションに返される 前にAPI側でマージされる

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Cluster 7.4 NoSQL パフォーマンス

•大規模なOTLP処理に向く

• ベンチマーク環境 –インメモリーテーブル

– MySQL Cluster 7.4 FlexAsych

148

2億NoSQL読込み/秒

-

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

Readspersecond

DataNodes

FlexAsyncReads

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Cluster 7.4 SQL パフォーマンス

•大規模なOTLP処理に向く

•分析のためにJOINも可能

• ベンチマーク環境 –インメモリーテーブル

– MySQL Cluster 7.4 DBT2 BM

149

250万SQL/秒

-

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

SQLStatements/sec

DataNodes

DBT2SQLStatementsperSecond

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

• クラスタのノードグループ間では同期

型レプリケーションで、冗長性を確保

• 地理的に離れたクラスタ間で、双方向

の非同期型レプリケーションを行い、

地理的冗長性を確保

• (MySQL Clusterではない)通常の

MySQLサーバへ非同期型のレプリ

ケーションを行い、レポート生成や課

金処理などのアプリケーションを実行

• NoSQL処理もレプリケーション可能

Geographical Replication 地理的冗長性の確保

Cluster 1

同期型レプリケーション

Cluster 2

MyISAM MEMORY InnoDB

非同期型レプリケーション

NDB NDB

150

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 151

MySQL Cluster 7.5

• Node Sizes of 128TB

• Read Optimized Tables

• Global Tables

パフォーマンス・ キャパシティ

• MySQL 5.7 との統合

• JSON Data Type

• Generated Columns

• Records-Per-Key Optimization

SQLの改善

• Improved Reporting

• Improved Logging

• Improved Visibility

• Improved Debugging

• Improved Restore

管理の強化

GA

https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-what-is-new.html

MySQL Cluster NDB 7.5.4 (2016-10-18)

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 152

ndbinfoの拡張

mysql> SELECT p.param_name AS Name,v.node_id AS Node,p.param_type AS Type, -> p.param_default AS 'Default',p.param_min AS Minimum,p.param_max AS Maximum, -> CASE p.param_mandatory WHEN 1 THEN 'Y' ELSE 'N' END AS 'Required',v.config_value AS Current -> FROM config_params p JOIN config_values v ON p.param_number = v.config_param -> WHERE p. param_name IN ('NodeId', 'HostName','DataMemory', 'IndexMemory'); +-------------+------+----------+-----------+---------+---------------+----------+----------------+ | Name | Node | Type | Default | Minimum | Maximum | Required | Current | +-------------+------+----------+-----------+---------+---------------+----------+----------------+ | NodeId | 1 | unsigned | | 1 | 48 | Y | 1 | | HostName | 1 | string | localhost | | | N | 192.168.56.114 | | DataMemory | 1 | unsigned | 83886080 | 1048576 | 1099511627776 | N | 134217728 | | IndexMemory | 1 | unsigned | 18874368 | 1048576 | 1099511627776 | N | 68157440 | | NodeId | 2 | unsigned | | 1 | 48 | Y | 2 | | HostName | 2 | string | localhost | | | N | 192.168.56.115 | | DataMemory | 2 | unsigned | 83886080 | 1048576 | 1099511627776 | N | 134217728 | | IndexMemory | 2 | unsigned | 18874368 | 1048576 | 1099511627776 | N | 68157440 | +-------------+------+----------+-----------+---------+---------------+----------+----------------+

容易に細かい設定を確認可能 (config_params,config_valuesテーブル) 既定値,最大値,最少値,現状値をパラメータ毎に確認可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 153

JSONデータ型やGenerated Columnに対応

MySQL5.7で実装された機能が利用可能

mysql> select @@version; +----------------------------------+ | @@version | +----------------------------------+ | 5.7.13-ndb-7.5.3-cluster-gpl-log | +----------------------------------+ 1 row in set (0.00 sec) mysql> show create table JSON75¥G *************************** 1. row *************************** Table: JSON75 Create Table: CREATE TABLE JSON75 ( user_id varchar(32) GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,'$.user_id'))) STORED NOT NULL, doc json DEFAULT NULL, last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`user_id`) ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 mysql> select * from JSON75 where user_id = 1; +---------+-----------------------------------------+---------------------+ | user_id | doc | last_update | +---------+-----------------------------------------+---------------------+ | 1 | {“name”: “ユーザーA”, “user_id”: 1} | 2016-09-30 21:45:47 | +---------+-----------------------------------------+---------------------+

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

•バックアップからの読み取りは、 どのコピーからもデータの読み取りを可能にします

• 7.4までは、全ての参照処理は、 プライマリーフラグメントのみ参照

154

Reading from backup (ndb_read_backup, READ_BACKUP)

Node Group

Data Node 1 Data Node 2

セカンダリのフラグメントからも データを参照可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Fully replicated (FULLY_REPLICATED)

• Fully replicatedは、対象テーブルに対して、どのデータノードにおいても、ローカルでデータの読み書きが出来るようになります

•静的データに最適で、より高速なJOIN処理を実現可能

155

Node Group

Data Node 1 Data Node 2

Node Group

Data Node 3 Data Node 4

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Clusterの管理ツール

156

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 157

ダウンタイムの低下、管理性の向上

MySQL Cluster Manager

管理作業の自動化

• ノード/クラスタ全体の 起動、停止

• オンライスケーリング

• オンライン再構成

• オンラインアップグレード

• オンラインバックアップ&リストア

• 既存環境のインポート

自己修復

• ノード監視

• SQLノード、管理ノード、データノードの自己修復

HA 操作

• クラスタ全体で一貫性のとれた設定変更

• 永続的な設定変更

• HA エージェント

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL Cluster Manager無し

• 1 x クラスタの事前状態チェック • 8 x ssh コマンド/サーバー • 8 x プロセス停止コマンド • 4 x 構成ファイルの転送 ‐ scp (2 x mgmd & 2 x

mysqld) • 8 x プロセス起動コマンド • 8 x 開始または再参加プロセスの確認 • 8 x 完了確認処理 • 1 x クラスタ全体の完了確認 • 各構成ファイルの手動による編集

MySQL Cluster Manager有り

mcm> upgrade cluster --package=7.4 mycluster;

158

MySQL Cluster Managerの利点(アップグレードの例)

合計46コマンド、2.5時間の作業 (各ノードに接続してコマンド実行する必要有り)

合計1コマンド、完全自動処理

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle MySQLクラウドサービスによる TCOの最適化

159

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

Oracle MySQLクラウドサービス

160

The World’s Most Popular Open Source Database in the Oracle Cloud

Oracle MySQL Cloud Service は、

迅速,安全且つコスト効率良く

MySQLをデプロイする事が可能。

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

• シンプル – わずか数回のクリックで,素早くMySQLデータベース・インスタンスが利用可能。

•自動化 – データベース管理を自動化するツールで簡単にMySQLを管理する事が可能。

•統合 – 迅速な開発と展開の為に、Oracleクラウド サービスとの統合

• エンタープライズ対応 – パフォーマンス、セキュリティ&アップタイム用のOracleの実証済みのMySQLエンタープライズ・エディションを標準提供。

161

MySQL Cloud Service: 価値提案

+

MySQL Enterprise Edition

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 162

STEP1) “インスタンスの作成”をクリック

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 163

STEP2) ホスト名を入力しカタログからサーバー タイプを選択し作成。必要に応じて Object Storage, MySQL Enterprise Monitorの設定を入力し完了。 作成時間: 約10分

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 164

STEP3) Public IPが設定されているので、アサインされた IPに対して鍵認証でログインする事が可能

SSHを利用した接続 Workbench経由でのSSH接続

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 165

mysql> select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE,LOAD_OPTION from PLUGINS -> where PLUGIN_TYPE <> 'INFORMATION SCHEMA'; +-----------------------+---------------+-------------------+----------------------+ | PLUGIN_NAME | PLUGIN_STATUS | PLUGIN_TYPE | LOAD_OPTION | +-----------------------+---------------+-------------------+----------------------+ | binlog | ACTIVE | STORAGE ENGINE | FORCE | | mysql_native_password | ACTIVE | AUTHENTICATION | FORCE | | sha256_password | ACTIVE | AUTHENTICATION | FORCE | | InnoDB | ACTIVE | STORAGE ENGINE | FORCE | | PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | FORCE | | MRG_MYISAM | ACTIVE | STORAGE ENGINE | FORCE | | MyISAM | ACTIVE | STORAGE ENGINE | FORCE | | MEMORY | ACTIVE | STORAGE ENGINE | FORCE | | CSV | ACTIVE | STORAGE ENGINE | FORCE | | BLACKHOLE | DISABLED | STORAGE ENGINE | OFF | | partition | ACTIVE | STORAGE ENGINE | ON | | FEDERATED | DISABLED | STORAGE ENGINE | OFF | | ARCHIVE | DISABLED | STORAGE ENGINE | OFF | | ngram | ACTIVE | FTPARSER | ON | | audit_log | ACTIVE | AUDIT | FORCE_PLUS_PERMANENT | | thread_pool | ACTIVE | DAEMON | ON | | authentication_pam | ACTIVE | AUTHENTICATION | ON | | auth_socket | ACTIVE | AUTHENTICATION | ON | | validate_password | ACTIVE | VALIDATE PASSWORD | ON | +-----------------------+---------------+-------------------+----------------------+

MySQL Enterprise版のバイナリーが インストール済みの為、Enterprise版の 機能が利用する事が可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 166

MySQL Enterprise Backupも実装されていて、 Dashboardからバックアップジョブ設定、 Point In Timeリカバリー含めて管理可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 167

MySQL Enterprise Monitorも利用可能 MySQLの設定、パフォーマンス、クエリー等 を一元管理する事が可能

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 168

Dashboardから、MySQLのパッチ適用、 適用前の事前検証と適用後のロールバックを実施する事が可能 ※適用前にMEBでバックアップが自動取得されます。

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 169

最高レベルのセキュリティ スケーラビリティと可用性 MySQLエキスパート テクニカルサポート

Oracleクラウド環境へ統合 ハイブリッドにデプロイ可能 クラウド& オンプレミス TCOの削減

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

• ビジネスの俊敏性を向上: イノベーションにリソースを集中し、迅速に最新のアプリケーションを提供。

•確実なセキュリティ,パフォーマンス,稼働時間: ソースレベルから、最も包括的なMySQL Cloud プラットホームを利用する事が可能。

• TCO(総所有コスト)を削減: 稼働時間を向上させながら、インフラストラクチャ 及びデータベース管理操作コストを節約可能。

170

MySQL Cloud Service: ビジネス上のメリット

REST APIを利用して、自動化する事も可能です。 http://docs.oracle.com/cloud/latest/mysql-cloud/CSMCS/toc.htm http://docs.oracle.com/en/cloud/iaas/compute-iaas-cloud/stcsa/toc.htm

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 171

MySQL Cloud Service Pricing

詳細: https://cloud.oracle.com/en_US/mysql/pricing

1 OCPU = 2 vCPU [root@japacsc01-mysql-1 opc]# cat /proc/cpuinfo | grep processor processor : 0 processor : 1 [root@japacsc01-mysql-1 opc]#

課金方法は2つオプション - Metered (実際に利用した分のみのコスト負担) - No-Metered (月単位での固定課金)

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

詳細情報 @ cloud.oracle.com/mysql

172

Sign up today for a free trial @

https://cloud.oracle.com/ja_JP/mysql

無償トライアルの申し込み方法

https://faq.oracle.co.jp/ci/fattach/get/2851/1476840092/redirect/1/filename/PAAS_TrialGuide_20161014.pdf

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

参考情報

173

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 174

30日間トライアル

MySQL Enterprise Edition & Cluster CGEの試使用

• Oracle Software Delivery Cloud http://edelivery.oracle.com/

•製品パックを選択: "Product" にMySQLと入力し、 OSを選択し"Continue"

•製品マニュアル http://dev.mysql.com/doc/index-enterprise.html

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQLの最新情報配信

• MySQLホームページ http://www-jp.mysql.com/

• MySQL イベント http://www-jp.mysql.com/news-and-events/events/

• MySQLニュースレター(月刊)※マイプロファイル内からMySQLを選択ください http://www.oracle.com/jp/syndication/subscribe/index.html

• MySQL Twitter @mysql_jp

• OTN セミナー オンデマンド コンテンツ http://www-jp.mysql.com/news-and-events/generate-article.php?id=1709

175

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

価格

MySQL サブスクリプション(ソケット数) 年間価格(円) ライセンスカウント単位

MySQL Standard Edition (1-4ソケット・サーバー/年) 240,000 サーバー

MySQL Enterprise Edition (1-4ソケット・サーバー/年) 600,000 サーバー

MySQL Cluster Carrier Grade Edition (1-4ソケット・サーバー/年) 1,200,000 サーバー

176

MySQLライセンスは、MySQLデータベースがインストールされたサーバー数でカウントされます。

価格は「物理サーバー単位」で、各エディションについて、1-4ソケットおよび5ソケット以上をもつサーバーの2クラスの価格があります。 5ソケット以上の価格については、MySQL担当営業までお問い合わせください。 MySQL Cluster を初めて導入される場合は、コンサルタントをご利用されることをお薦めしています。必ずオラクルのMySQL担当営業 までご相談くだ さい。

※サーバー:プログラムがインストールされたコンピュータと定義されます。サーバー・ライセンスによって使用許諾を受けたプログラムを、 指定された1台のコンピュータで使用することができます。仮想環境上でMySQLを稼働させた場合も物理サーバー単位でカウントされます。 ※ソケット:CPUチップ(またはマルチチップ・モジュール)を装着したスロットと定義され、1つまたは複数のコアを含みます。コアの数にかかわらず、 各チップ(またはマルチチップ・モジュール)は1つのソケットとして数えられます。

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

MySQL 販売パートナー(OPN MySQL Specialization認定パートナー)

• SCSK株式会社

• 株式会社ソフトエイジェンシー

• コネクト株式会社

• 株式会社スマートスタイル

177

※OPN MySQL Specialization 認定パートナーは、お客様の推薦、スペシャリストの保有数、ビジネスの実績という 3つの基準により選出され、MySQL 製品・ソリューションにおける販売・開発・実装について、実績に裏付けられた 高い知識と専門性を有します。 ※参考:OPN MySQL 5 Specialization 認定パートナーに聞く MySQL 5 Specialization を取得した理由とは? http://www-jp.mysql.com/partners/specialized/

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

• 伊藤忠テクノソリューションズ株式会社

• 株式会社ジゾン

• 新日鉄住金ソリューションズ株式会社

• 富士通ミドルウェア

• ダイワボウ情報システム株式会社

• 株式会社野村総合研究所

• 菱洋エレクトロ株式会社

• 株式会社日立システムズ

• 株式会社日立ソリューションズ

• 日本ヒューレット・パッカード株式会社

• 日本ユニシス株式会社

• 日本電気株式会社

178

MySQL 販売パートナー

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

お問合せ先

• [MySQL お問い合わせ窓口] 0120-065556

• 【受付時間】 平日 9:00-12:00/13:00-18:00 (祝日及び年末年始休業日を除きます) [email protected]

179

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 180