• 検索結果がありません。

サンのオープンソースへの 取り組み

N/A
N/A
Protected

Academic year: 2021

シェア "サンのオープンソースへの 取り組み"

Copied!
37
0
0

読み込み中.... (全文を見る)

全文

(1)

<Insert Picture Here>

(2)

2

以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。

また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことは

できません。以下の事項は、マテリアルやコード、機能を提供することをコミットメン

ト(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さ

い。オラクル製品に関して記載されている機能の開発、リリースおよび時期につい

ては、弊社の裁量により決定されます。

OracleとJavaは、Oracle Corporation 及びその子会社、関連会社の米国及びその他の国における登録商標です。文 中の社名、商品名等は各社の商標または登録商標である場合があります。

(3)

The world's most popular open source database

(4)

MySQLの高可用性構成

MySQL Cluster MySQL Cluster アプリケーション/ APサーバ 負荷分散 双方向 同期複製

MySQL Cluster

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

MySQL Server

MySQL+DRBD

Linux用のノード間データコピー

アプリケーション/ APサーバ フェールオーバー 同期複製 MySQL Server アプリケーション/ APサーバ 共有ディスク

3

rd

ベンダ製HAソフト利用

共有ディスクにデータを格納

フェールオーバー MySQL Server MySQL Server アプリケーション/ APサーバ 負荷分散 非同期複製 準同期複製

レプリケーション(標準機能)

非同期&準同期データレプリケーション

MySQL Server MySQL Server

(5)

MySQL Cluster

+レプリケーション

MySQL Cluster MySQL Cluster アプリケーション/ APサーバ 負荷分散 双方向 同期複製 MySQL Cluster MySQL Cluster 双方向 同期複製 非同期複製 アプリケーション/ APサーバ 共有ディスク フェールオーバー MySQL Server MySQL Server

共有ディスク型構成

+レプリケーション

MySQL Server ・・・ 非同期複製 アプリケーション/ APサーバ 参照処理の 負荷分散 MySQL Server MySQL Server

複合型の高可用性構成例

(6)
(7)

データの変更点を

1

つ以上の場所に複製すること

update customer update customer

非同期レプリケーション - Asynchronous Replication

同期レプリケーション - Synchronous Replication

レプリケーションとは?

(8)

Webアプリケーションでは参照が95%、

更新が5%というケースも (Digg.com)

> シンプルなスケールアウト構成によって

簡単に20倍以上の性能向上が図れる

レプリケーション

MySQLの標準機能

シンプルな設定

マスタ

→スレーブ

多数Webでの実績

非同期型&準同期型

特徴

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

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

基本は一方向でのデータコピ

ーだが、双方向や循環型で

の利用も可能 (データの更新

には注意が必要)

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

(9)

非同期レプリケーション

Application

Master

Connection Thread

Data

Binlog

Slave

Data

Relaylog

Commit

Changing

Data

Changing

Binlog

Replication

Response

Changing

Data

(10)

マスタ > スレーブ

マルチマスタ > スレーブ (マルチソース)

マスタ < > マスタ (マルチマスタ)

マスタ > マルチスレーブ

循環型 (マルチマスタ)

マスタ > スレーブ > マルチスレーブ

MySQL レプリケーションの構成パターン

(11)

準同期レプリケーション

Application

Master

Connection Thread

Data

Binlog

Slave

Data

Relaylog

Commit

Changing

Data

Changing

Binlog

Replication

Response

Changing

Data

Response

(12)

MySQL 5.5のレプリケーション改善点

1.

準同期(Semisynchronous)レプリケーション

スレーブに変更点を転送してからアプリケーションに応答を返

すため、信頼性が向上

2.

スレーブでのfsync改良&リレーログの自動復旧

fsyncsを改良しスレーブの障害時のログ破損を回避。

破損した場合にも自動普及

3.

レプリケーション ハードビート

障害発生検知のメカニズムの精度を向上

4.

サーバ毎のレプリケーション フィルタリング

特定のサーバIDを持つマスターのイベントを無視

(13)

MySQL 5.5のレプリケーション改善点

5.

スレーブでのデータ型変換の自動化(RBR)

マスターとスレーブ間でデータ型が異なる場合に自動的に型

を変換

6.

ログを個別にフラッシュ

'FLUSH LOGS'実行時にログを選択してフラッシュ可能に

7.

トランザクション非対応に関係なく安全にログに記録

InnoDBとMyISAMのテーブルを同一のトランザクション内で

更新した場合、コミット後に全変更点をバイナリログに記録

(14)
(15)

NDB API JDBC/ODBC/etc SQL Based Applications MySQL Server C++/Java Applications Management Client Management Node LDAP MySQL Cluster Data Node N D B A PI MGM API Data Node Data Node Data Node

MySQL Cluster

非共有ディスク型高可用性クラスタソリューション

サーバの追加により性能&データ容量を拡大する

スケールアウト構成

無停止でのサーバ追加&データ再構成が可能

データを複数のサーバにデータの複製を

分散配置

マルチマスタ構成、単一障害点無し

ミリ秒単位での障害検知、自動フェールオーバー、自動リカバリ

ACID準拠の

トランザクション

通信系の加入者データベースや

Webのセッション永続化など、

シンプルなトランザクションが

同時多発的に発生するシステム向き

SQL以外にもC++やJavaのAPI経由

で直接データアクセス可能

(16)

SQL Node

(MySQL)‏

• 標準的なSQLインターフェース

• スケールアウトによる性能向上

• レプリケーション構成可能

• 高パフォーマンス

• C++ API

• 開発ガイドを公開

• データストレージ (ディスク/メモリ)‏

• 自動的なパーティショニング

• ローカル&グローバルチェックポイント

• スケールアウトによる容量と可用性向上

• 管理および設定

• "Arbitration" 調停役

• 2ノードでの可用性

NDB API

(Application)‏

Data Node

(NDB Storage Engine)‏

Management

Node

MySQL Clusterを構成するコンポーネント

(17)

MySQL Clusterに関するキーワード

パーティション

水平(行単位)パーティショニング

主キー(または指定のインデックス)のKeyパーティショニング

パーティション数 = データノード数

レプリカ

データの完全なコピー

ノードグループ

自動的に作成される

グループ数 = データノード数÷レプリカ数

(18)

SQL Node (MySQL) NDB API Data Node (NDB Storage Engine)

X

NDB APIによるアクセス

NDB API = 高パフォーマンス C++ API

キー、インデックススキャン、テーブルスキャン

ACIDトランザクション対応

オブジェクト指向エラーハンドリング

SQLでは達成できない非常に高いパフォーマンス

(19)

>

レイテンシーの低減による10倍

以上のスループット

>

Javaプログラマの「普通の」コ

ーディングで利用可能

MySQL Cluster Connector for Java

MySQL Cluster Connector for Java

– ネイティブJavaインターフェース – SQLは利用しない

MySQL Cluster Java API :ドメイン

オブジェクトモデルのパーシステンスAPI

– 別名Cluster/J

– Javaアプリケーションに組み込んで利用

JPA準拠のO/Rマッパーでのアクセス

– MySQL Cluster Plug-in for OpenJPA

– 主キーによる参照、更新、挿入や削除は

Cluster/Jで

(20)

Measured as CPU time on a single host

(21)

Cluster 1

同期型

レプリケーション

Cluster 2

MyISAM MEMORY InnoDB

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

クラスタのノードグループ間で

は同期型レプリケーションで、

冗長性を確保

地理的に離れたクラスタ間で、

双方向の非同期型レプリケー

ションを行い、地理的冗長性を

確保

(MySQL Clusterではない)通

常のMySQLサーバへ非同期

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

レポート生成や課金処理など

のアプリケーションを実行

Geographical Replication - 地理的冗長性の確保

(22)

Delivering up to 10x higher

Java Throughput

MySQL Cluster Connector for

Java:

Native Java API

JPA Plug-In

Reducing Cost of Operations

Simplified Management &

Monitoring:

NDBINFO

MySQL Cluster Manager (part of CGE only)

Faster Restarts

(23)

ndbinfo

New database (ndbinfo) which

presents real-time metric data

in the form of tables

Exposes new information

together with providing a

simpler, more consistent way

to access existing data

Examples include:

– Resource usage (memory, buffers)

– Event counters (such as number of READ operations since last restart)

– Data node status and connection status

mysql> use ndbinfo mysql> show tables; +---+ | Tables_in_ndbinfo | +---+ | blocks | | config_params | | counters | | logbuffers | | logspaces | | memoryusage | | nodes | | resources | | transporters | +---+

(24)

ndbinfo

Example 1: Check memory usage/availability

mysql> select * from memoryusage;

+---+---+---+---+ | node_id | DATA_MEMORY | used | max | +---+---+---+---+ | 3 | DATA_MEMORY | 594 | 2560 | | 4 | DATA_MEMORY | 594 | 2560 | | 3 | INDEX_MEMORY | 124 | 2336 | | 4 | INDEX_MEMORY | 124 | 2336 | +---+---+---+---+

Note that there is a DATA_MEMORY and INDEX_MEMORY row for

each data node in the cluster

If the Cluster is nearing the configured limit then increase the

DataMemory and/or IndexMemory parameters in config.ini and then

perform a rolling restart

(25)

ndbinfo

Example 2: Check how many table scans performed on each data node

since the last restart

mysql> select node_id as 'data node', val as 'Table Scans' from counters where counter_name='TABLE_SCANS';

+---+---+ | data node | Table Scans | +---+---+ | 3 | 3 | | 4 | 4 | +---+---+

You might check this if your database performance is lower than

anticipated

If this figure is rising faster than you expected then examine your

application to understand why there are so many table scans

(26)

MySQL Cluster 7.1: ndbinfo

Example 3: Check if approaching the point at which the undo log completely fills up

between local checkpoints (which could result in delayed transactions or even a

database halt if not addressed):

mysql> select node_id as 'data node', total as 'configured undo log buffer size', used as 'used buffer space' from logbuffers where log_type='DD-UNDO‘;

+---+---+---+ | data node | configured undo log buffer size | used buffer space | +---+---+---+ | 3 | 2096128 | 0 | | 4 | 2096128 | 0 | +---+---+---+

(27)
(28)

Monitoring

Status Monitoring &

Recovery

Automated Management

Cluster-Wide

Management

Process Management

On-Line Operations

(Upgrades /

Reconfiguration)

HA Operations

Disk Persistence

Configuration

Consistency

HA Agent Operation

MySQL Cluster Manager 1.0 Features

(29)

Example configuration

MySQL Cluster Manager agent

runs on each physical host

No central process for Cluster

Manager – agents co-operate,

each one responsible for its local

nodes

Agents are responsible for

managing all nodes in the cluster

Management responsibilities

– Starting, stopping & restarting nodes

– Configuration changes – Upgrades

– Host & Node status reporting – Recovering failed nodes

agent 1. ndb_mgmd 7. mysqld 192.168.0.10 agent 2. ndb_mgmd 8. mysqld 192.168.0.11 agent 5. ndbd 3. ndbd 192.168.0.12 agent 6. ndbd 4. ndbd 192.168.0.13 mysql client agent n. ndb_mgmd n. mysqld n. ndbd

MySQL Server (ID=n)

Management Node (ID=n)

Data Node (ID=n)

(30)

Creating & Starting a Cluster

1. Define the site:

2. Expand the MySQL Cluster tar-ball(s) from mysql.com to known directory

3. Define the package(s):

Note that the basedir should match the directory used in Step 2.

4. Create the Cluster

This is where you define what

nodes/processes make up the Cluster and where they should run

5. Start the Cluster:

agent 1. ndb_mgmd 7. mysqld 192.168.0.10 agent 2. ndb_mgmd 8. mysqld 192.168.0.11 agent 5. ndbd 3. ndbd 192.168.0.12 agent 6. ndbd 4. ndbd 192.168.0.13 mysql client

Mysql> create site --hosts=192.168.0.10,192.168.0.11, -> 192.168.0.12,192.168.0.13 mysite;

Mysql> add package --basedir=/usr/local/mysql_6_3_26 6.3; Mysql> add package --basedir=/usr/local/mysql_7_0_7 7.0;

Mysql> create cluster --package=6.3

-> [email protected],[email protected], -> [email protected],[email protected], [email protected], -> [email protected],[email protected],[email protected] -> mycluster;

(31)

Upgrade Cluster

• Upgrade from MySQL Cluster 6.3.26 to 7.0.7:

• Automatically upgrades each node and restarts the process – in the correct order to avoid any loss of service

• Without MySQL Cluster Manager, the

administrator must stop each process in turn, start the process with the new version and wait for the node to restart before moving onto the next one agent 1. ndb_mgmd 7. mysqld 192.168.0.10 agent 2. ndb_mgmd 8. mysqld 192.168.0.11 agent 5. ndbd 3. ndbd 192.168.0.12 agent 6. ndbd 4. ndbd 192.168.0.13 mysql client

(32)

MySQL Cluster Manager 1.1

GA 1

st

November 2010

On-line add-node

mysql> add hosts --hosts=192.168.0.35,192.168.0.36 mysite;

mysql> add package --basedir=/usr/local/mysql_7_0_7 –

hosts=192.168.0.35,192.168.0.36 7.0;

mysql> add process

[email protected],[email protected],ndbd@19

2.168.0.35,[email protected] mycluster;

mysql> start process --added mycluster;

Restart optimizations

Fewer nodes restarted on some parameter changes

Data Node Data Node mysqld Mgmt Node mysqld Mgmt Node 31 32 33 34 Data Node Data Node mysqld mysqld 31 32 33 34 Data Node Data Node •35 36 mysqld Mgmt Node mysqld Mgmt Node

(33)

米国海軍 航空母艦用 航空機管理システム

Aviation Data Management and Control System (ADMACS)

艦載機・飛行甲板の運用管理

空母に搭載された航空機のメンテ

ナンス、燃料補給計画の管理

空母上の飛行甲板の利用を含む、

フライトプランの作成および管理

MySQL Cluster

4ノードのLinux上で利用

単一障害点のない完全な冗長性

障害を想定したテストでの安定性と

フットプリントの小ささが選択理由

世界最大の軍艦 ニミッツ級航空母艦で運用中

(34)

NEC モバイルインターネットプラットフォーム

3G通信の顧客情報管理、ユーザ認証、

アクセス制御、課金システム

アプリケーションによってSQLおよびAPIを利用

2,000万加入者のデータを管理

2,400TPSを処理

将来の加入者やデータ量、

処理能力の増加に備えた

フレキシブルなサーバ構成が可能

お客様の声 MySQL Clusterの安定性と処理性能はすでに 理解していましたが、特に選定の決め手となっ たのは導入の容易性と、拡張性の高さです。

(35)

MySQLの高可用性構成

MySQL Cluster MySQL Cluster アプリケーション/ APサーバ 負荷分散 双方向 同期複製

MySQL Cluster

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

MySQL Server

MySQL+DRBD

Linux用のノード間データコピー

アプリケーション/ APサーバ フェールオーバー 同期複製 MySQL Server アプリケーション/ APサーバ 共有ディスク

3

rd

ベンダ製HAソフト利用

共有ディスクにデータを格納

フェールオーバー MySQL Server MySQL Server アプリケーション/ APサーバ 負荷分散 非同期複製 準同期複製

レプリケーション(標準機能)

非同期&準同期データレプリケーション

MySQL Server MySQL Server

(36)

Requirements

Replication

Cluster

MySQL &

DRBD

Availability

Automatic Fail Over No Yes Yes Fail Over Time Varies < 1 sec < 5 min Resynch of Data No Yes Yes Geographic Redundancy Yes Yes No

Scalability

Load Balancing Scale-Out Yes No Read Intensive Yes Yes No Write Intensive No Yes No

# of Nodes 100’s‏(reads) 255 1 Active

SQL Functionality

Primary Key Lookups Yes Yes Yes Simple JOINs Yes Yes Yes Complex JOINs Yes No Yes Transactions Yes Yes Yes

(37)

参照

関連したドキュメント

LPガスはCO 2 排出量の少ない環境性能の優れた燃料であり、家庭用・工業用の

If Φ is a finite root system, and if we take H 0 to be the category of representations of an alternating quiver corresponding to Φ , then our generalized cluster complex is the

We construct critical percolation clusters on the diamond hierarchical lattice and show that the scaling limit is a graph directed random recursive fractal.. A Dirichlet form can

In this paper we develop an elementary formula for a family of elements {˜ x[a]} a∈ Z n of the upper cluster algebra for any fixed initial seed Σ.. This family of elements

The layout produced by the VDCB algorithm is more evenly distributed according to the CP model, and is more similar to the original layout according to the similarity measures

Nakanishi, “Exact WKB analysis and cluster algebras II: simple poles, orbifold points, and generalized cluster algebras”, arXiv:1401.7094.. 13

Keywords Cluster algebra · Quiver mutation · Periodic quiver · Somos sequence · Integer sequences · Pell’s equation · Laurent phenomenon · Integrable map · Linearisation ·

Given that we computed the M -triangle of the m-divisible non-crossing partitions poset for E 7 and E 8 and that the F -triangle of the generalised cluster complex has been computed