5分で作るMySQL Cluster環境

Y
1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
MySQL Cluster 7.3リリース記念!!
5分で作るMySQL Cluster環境
日本オラクル株式会社
山崎 由章 / MySQL Senior Sales Consultant,
Asia Pacific and Japan
2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
 外部キー
 Connection Thread Scalability
 MySQL 5.6との統合
 Auto-Installer
 NoSQL API : JavaScript
for node.js
New!!
3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
MySQL Cluster: Overview
• 自動シャーディング、マルチマスター
• ACID 準拠のトランザクション, OLTP + Real-Time Analytics
読込み/書込み処理
に対する高い拡張性
• シェアードナッシング、単一障害点無し
• 自動修復 + オンラインオペレーション
99.999% の高可用性
• オープンソース + 商用版
• コモディディハードウェア + 充実した管理ツール、監視ツール
低い TCO
• Key/Value + SQL の柔軟性
• SQL + Memcached + JavaScript + Java + JPA + HTTP/REST & C++
SQL + NoSQL
• インメモリデータベース + ディスクデータ
• 非常に低いレイテンシ、短いアクセス時間
リアルタイム
4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Who’s Using MySQL Cluster?
5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
MySQL Cluster Connection Thread Scalability
• DBT2 Benchmark
– Single MySQL Server
– Single Data Node
– 128 client connections
8.5x
6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
MySQL Cluster 7.3: Auto-Installer
• 素早く設定可能
• リソースを自動検出
• ワークロードに合わせた最適化
• 再現可能なベストプラクティス
• MySQL Cluster 7.2 + 7.3 で
使用可能
Specify
Workload
Auto-
Discover
Define
TopologyDeploy
7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
MySQL Cluster 7.3: Auto-Installer
• マルチホストサポート
• リモートサーバへもデプロイ
可能
• 簡単に実行可能:
– bin/ndb_setup
– setup.bat
MySQL Cluster Auto-Installer
8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを使って、MySQL Clusterの
テスト環境を5分で作成してみよう
1.MySQL Cluster7.3をダウンロードする
2.Auto-Installerを起動して、各種設定を行う
3.Auto-InstallerからDeployする
4.稼働確認
9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
MySQL Cluster7.3をダウンロードする
• http://dev.mysql.com/downloads/cluster/ へアクセス
• 環境に応じたモジュールをダウンロード
– 今回は、
Linux - Generic (glibc 2.5) (x86, 64-bit), Compressed TAR Archive
(mysql-cluster-gpl-7.3.2-linux-glibc2.5-x86_64.tar.gz)
をダウンロード
10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
• TARファイルを解凍
– cd /usr/local
– tar xvzf /<<ファイルパス>>/mysql-cluster-gpl-7.3.2-linux-glibc2.5-x86_64.tar.gz
– mv mysql-cluster-gpl-7.3.2-linux-glibc2.5-x86_64 mysql-cluster
• mysqlユーザ作成
– groupadd -g 502 mysql
– useradd -u 502 -g mysql -d /home/mysql -s /bin/bash mysql
• Auto-Installerを起動(mysqlユーザで実行)
– /usr/local/mysql-cluster/bin/ndb_setup.py
11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
• 「Create New MySQL Cluster」をクリック後、
「Next」をクリックし続ける
– 設定を変更したい場合は、設定を変更後、「Next」をクリック
12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-Installerを起動して、各種設定を行う
18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-InstallerからDeployする
• 「Deploy and start cluster」をクリック
19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-InstallerからDeployする
20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-InstallerからDeployする
21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-InstallerからDeployする
22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Auto-InstallerからDeployする
23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
稼働確認
• SQLノード1に接続
– mysql -u root --port=3306 --socket=/home/mysql/MySQL_Cluster/53/mysql.socket
• SQLノード2に接続
– mysql -u root --port=3307 --socket=/home/mysql/MySQL_Cluster/54/mysql.socket
24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
稼働確認
• SQLノード1から実行
– InnoDBとNDBでテーブルを作成し、データをinsert
• use test;
• create table t_ndb (id int auto_increment, col1 char(20), primary key(id)) engine=ndb;
• create table t_innodb (id int auto_increment, col1 char(20), primary key(id)) engine=innodb;
• insert into t_innodb(col1) values('InnoDB');
• insert into t_ndb(col1) values('NDB');
– データを確認
• show tables;
• select * from t_innodb;
• select * from t_ndb;
25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
稼働確認
• SQLノード2から実行
– データを確認(NDBのテーブルのみが確認できる)
• use test;
• show tables;
• select * from t_innodb;
• select * from t_ndb;
– NDBのテーブルにデータをinsert
• insert into t_ndb(col1) values('NDB_Node2');
– データを確認
• select * from t_ndb;
26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
稼働確認
• SQLノード1から実行
– データを確認(SQLノード2から INSERT したデータも確認できる)
• select * from t_ndb;
27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
テスト環境はできたので、
後は奥野さんの本を片手に
MySQL Clusterを触りましょう!!
(http://gihyo.jp/book/にて、電子書籍版もあり)
※各種パラメータは、必要に応じて変更しましょう。
特に、以下の設定は、すぐに容量不足になりデータを挿入できなくなるので要注意!!
- DataMemory=1M
- IndexMemory=1M
28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 29
1 of 29

More Related Content

Similar to 5分で作るMySQL Cluster環境(20)

MySQLインストールのお作法MySQLインストールのお作法
MySQLインストールのお作法
Meiji Kimura4.6K views
20150920 中国地方db勉強会20150920 中国地方db勉強会
20150920 中国地方db勉強会
yoyamasaki2.1K views
Windows環境でのMySQLWindows環境でのMySQL
Windows環境でのMySQL
yoyamasaki3.8K views
20140518 JJUG MySQL Clsuter as NoSQL20140518 JJUG MySQL Clsuter as NoSQL
20140518 JJUG MySQL Clsuter as NoSQL
Ryusuke Kajiyama4.4K views
MySQL 5.7 Technical Update (日本語)MySQL 5.7 Technical Update (日本語)
MySQL 5.7 Technical Update (日本語)
Shinya Sugiyama2.2K views
20190530 osc hokkaido_public20190530 osc hokkaido_public
20190530 osc hokkaido_public
DAISUKE INAGAKI372 views
20150131 ChugokuDB-Shimane-MySQL20150131 ChugokuDB-Shimane-MySQL
20150131 ChugokuDB-Shimane-MySQL
Ryusuke Kajiyama2.1K views
20220914_MySQLでDevOps!20220914_MySQLでDevOps!
20220914_MySQLでDevOps!
Machiko Ikoma5 views
201312 scalr[oss] installation_idcf201312 scalr[oss] installation_idcf
201312 scalr[oss] installation_idcf
IDC Frontier6.5K views
MySQLとオープンソースビジネスの10年、そして未来へMySQLとオープンソースビジネスの10年、そして未来へ
MySQLとオープンソースビジネスの10年、そして未来へ
Open Source Software Association of Japan972 views
OpenStack 向けネットワーク入門OpenStack 向けネットワーク入門
OpenStack 向けネットワーク入門
Dell TechCenter Japan5.1K views

5分で作るMySQL Cluster環境

  • 1. 1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster 7.3リリース記念!! 5分で作るMySQL Cluster環境 日本オラクル株式会社 山崎 由章 / MySQL Senior Sales Consultant, Asia Pacific and Japan
  • 2. 2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.  外部キー  Connection Thread Scalability  MySQL 5.6との統合  Auto-Installer  NoSQL API : JavaScript for node.js New!!
  • 3. 3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster: Overview • 自動シャーディング、マルチマスター • ACID 準拠のトランザクション, OLTP + Real-Time Analytics 読込み/書込み処理 に対する高い拡張性 • シェアードナッシング、単一障害点無し • 自動修復 + オンラインオペレーション 99.999% の高可用性 • オープンソース + 商用版 • コモディディハードウェア + 充実した管理ツール、監視ツール 低い TCO • Key/Value + SQL の柔軟性 • SQL + Memcached + JavaScript + Java + JPA + HTTP/REST & C++ SQL + NoSQL • インメモリデータベース + ディスクデータ • 非常に低いレイテンシ、短いアクセス時間 リアルタイム
  • 4. 4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Who’s Using MySQL Cluster?
  • 5. 5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster Connection Thread Scalability • DBT2 Benchmark – Single MySQL Server – Single Data Node – 128 client connections 8.5x
  • 6. 6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster 7.3: Auto-Installer • 素早く設定可能 • リソースを自動検出 • ワークロードに合わせた最適化 • 再現可能なベストプラクティス • MySQL Cluster 7.2 + 7.3 で 使用可能 Specify Workload Auto- Discover Define TopologyDeploy
  • 7. 7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster 7.3: Auto-Installer • マルチホストサポート • リモートサーバへもデプロイ 可能 • 簡単に実行可能: – bin/ndb_setup – setup.bat MySQL Cluster Auto-Installer
  • 8. 8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを使って、MySQL Clusterの テスト環境を5分で作成してみよう 1.MySQL Cluster7.3をダウンロードする 2.Auto-Installerを起動して、各種設定を行う 3.Auto-InstallerからDeployする 4.稼働確認
  • 9. 9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster7.3をダウンロードする • http://dev.mysql.com/downloads/cluster/ へアクセス • 環境に応じたモジュールをダウンロード – 今回は、 Linux - Generic (glibc 2.5) (x86, 64-bit), Compressed TAR Archive (mysql-cluster-gpl-7.3.2-linux-glibc2.5-x86_64.tar.gz) をダウンロード
  • 10. 10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う • TARファイルを解凍 – cd /usr/local – tar xvzf /<<ファイルパス>>/mysql-cluster-gpl-7.3.2-linux-glibc2.5-x86_64.tar.gz – mv mysql-cluster-gpl-7.3.2-linux-glibc2.5-x86_64 mysql-cluster • mysqlユーザ作成 – groupadd -g 502 mysql – useradd -u 502 -g mysql -d /home/mysql -s /bin/bash mysql • Auto-Installerを起動(mysqlユーザで実行) – /usr/local/mysql-cluster/bin/ndb_setup.py
  • 11. 11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う • 「Create New MySQL Cluster」をクリック後、 「Next」をクリックし続ける – 設定を変更したい場合は、設定を変更後、「Next」をクリック
  • 12. 12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う
  • 13. 13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う
  • 14. 14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う
  • 15. 15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う
  • 16. 16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う
  • 17. 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-Installerを起動して、各種設定を行う
  • 18. 18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-InstallerからDeployする • 「Deploy and start cluster」をクリック
  • 19. 19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-InstallerからDeployする
  • 20. 20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-InstallerからDeployする
  • 21. 21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-InstallerからDeployする
  • 22. 22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Auto-InstallerからDeployする
  • 23. 23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 稼働確認 • SQLノード1に接続 – mysql -u root --port=3306 --socket=/home/mysql/MySQL_Cluster/53/mysql.socket • SQLノード2に接続 – mysql -u root --port=3307 --socket=/home/mysql/MySQL_Cluster/54/mysql.socket
  • 24. 24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 稼働確認 • SQLノード1から実行 – InnoDBとNDBでテーブルを作成し、データをinsert • use test; • create table t_ndb (id int auto_increment, col1 char(20), primary key(id)) engine=ndb; • create table t_innodb (id int auto_increment, col1 char(20), primary key(id)) engine=innodb; • insert into t_innodb(col1) values('InnoDB'); • insert into t_ndb(col1) values('NDB'); – データを確認 • show tables; • select * from t_innodb; • select * from t_ndb;
  • 25. 25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 稼働確認 • SQLノード2から実行 – データを確認(NDBのテーブルのみが確認できる) • use test; • show tables; • select * from t_innodb; • select * from t_ndb; – NDBのテーブルにデータをinsert • insert into t_ndb(col1) values('NDB_Node2'); – データを確認 • select * from t_ndb;
  • 26. 26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 稼働確認 • SQLノード1から実行 – データを確認(SQLノード2から INSERT したデータも確認できる) • select * from t_ndb;
  • 27. 27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. テスト環境はできたので、 後は奥野さんの本を片手に MySQL Clusterを触りましょう!! (http://gihyo.jp/book/にて、電子書籍版もあり) ※各種パラメータは、必要に応じて変更しましょう。 特に、以下の設定は、すぐに容量不足になりデータを挿入できなくなるので要注意!! - DataMemory=1M - IndexMemory=1M
  • 28. 28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 29. 29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 29