21. MySQL
MySQL 4.0.x
Software based sharding
Over 160 clusters / 80 servers(Master-Slave*2)
2.0TB of ibdata (master only)
App
① ②
Mapping Cluster Cluster Cluster Cluster Cluster
(Main DB) 1 2 3 4 5
22. Backup of MySQL 4.0
$ mysqldump --master-data blocks update query
MySQL 5.1.x MySQL 4.0.x
FLUSH LOCAL TABLES FLUSH TABLES WITH READ LOCK
FLUSH TABLES WITH READ LOCK BEGIN
SET SESSION TRANSACTION DB選択
ISOLATION LEVEL REPEATABLE READ テーブルからデータの読み込み
START TRANSACTION WITH COMMIT;
CONSISTENT SNAPSHOT SHOW MASTER STATUS
SHOW MASTER STATUS UNLOCK TABLES;
UNLOCK TABLES
DB選択
テーブルからデータの読み込み
23. mysqldump wrapper
for MySQL 4.0
$dbh->do('FLUSH TABLES WITH READ LOCK');
$dbh->select('SHOW MASTER STATUS');
pipe my $logrh, my $logwh;
my $pid = fork
if ( $pid == 0 ) { #子プロセス
open STDOUT, '>&', $logwh;
exec("mysqldump","--single-transaction","--databases","...");
}
while(<$logrh>){
print;
if ( m!^CREATE DATABASE!) {
$dbh->do('UNLOCK TABLE');
}
}
https://github.com/kazeburo/mysql40dump
38. cloudforecast
architecture#2
RRD DB
updater updater
radar enqueue
gearmand
fetcher fetcher fetcher fetcher fetcher
Server Server Server Server Server
39. How to setup &
configuration
http://www.slideshare.net/kazeburo/introduction-to-cloudforecast-yapcasia-2010-tokyo