ra-grs windows azure storage lt
Post on 10-May-2015
2.025 Views
Preview:
DESCRIPTION
TRANSCRIPT
Azure Storage の可用性設定
1. ローカル冗長ストレージ (LRS=Locally Redundant Storage) データセンター内 3 箇所、同期
2. 地理冗長ストレージ (GRS=Geo Redundant Storage)地理的に離れた場所への複製( Local 3 箇所+リモート 3 箇所)、リモートは非同期、フェイルオーバー
3. 読み取りアクセス地理冗長ストレージ (RA-GRS=Read Access - Geo Redundant Storage) PREVIEW地理的に離れた場所にあるデータの RO 参照
2014/2/26 kyrt @takekazuomi 3
ご利用の前に
• Preview なので、 Windows Azure Preview のページで申し込みをする
https://account.windowsazure.com/PreviewFeatures
• Azure Portal で、 REPLICATION 設定を、 READ-ACCESS GEO REDUNDANT にする
2014/2/26 kyrt @takekazuomi 4
SDK の注意
• RA-GRS の新機能を使うには REST version 2013-08-15 を使う Storage SDK が必要
• .NET だと Storage Client Library 3.0 以降 http://www.nuget.org/packages/WindowsAzure.Storage
• Java だと、 Windows Azure Storage SDK for Java 0.5.0 以降 https://github.com/WindowsAzure/azure-storage-java
上記 SDK には、 Blobs, Tables and Queues の Last Sync Time をクエリーする、 参照先の primary. secondary 指定、 retry の切り替えの機能がある
2014/2/26 kyrt @takekazuomi 5
LocationMode
LocationMode で、参照先を定義
1. PrimaryOnly: 全ての Read request を primary endpoint だけに送る
2. PrimaryThenSecondary: Read requests は、最初 primary に、 retryable error な場合は、 secondary 、 primary の順で再試行を繰り返えす
3. SecondaryOnly: secondary endpoint からの読み込む4. SecondaryThenPrimary : PrimaryThenSecondary の逆
2014/2/26 kyrt @takekazuomi 6
NEW: retry policy interface IExtendedRetryPolicy3.x では、 2.x の IRetryPolicy を拡張した、 IExtendedRetryPolicy というのが使われるようになりました。このインターフェースでは、従来の ShouldRetry の変わりに Evaluate メソッドがリトライの判断のために使われます。
• 2.xhttps://github.com/WindowsAzure/azure-sdk-for-net/blob/v2.1.0.4/microsoft-azure-api/Services/Storage/Lib/Common/RetryPolicies/IRetryPolicy.cs
• 3.xhttps://github.com/WindowsAzure/azure-storage-net/blob/master/Lib/Common/RetryPolicies/IExtendedRetryPolicy.cs2014/2/26 kyrt @takekazuomi 7
Evaluate
• Evaluate では、 retryable errorの検査、 target location を変更を実施 →• production のコード
では、 secondary が404 の場合はエラーとせずに、 primary に戻している
2014/2/26 kyrt @takekazuomi 8
public RetryInfo Evaluate(RetryContext retryContext, OperationContext operationContext){ var statusCode = retryContext.LastRequestResult.HttpStatusCode;
if (retryContext.CurrentRetryCount >= this.maximumAttempts || ((statusCode >= 300 && statusCode < 500 && statusCode != 408) || statusCode == 501 // Not Implemented || statusCode == 505)) // Version Not Supported { return null; // do not retry }
RetryInfo info = new RetryInfo(); info.RetryInterval = EvaluateBackoffTime(); if (retryContext.CurrentRetryCount == this.maximumAttempts - 1) { // retry against secondary info.TargetLocation = StorageLocation.Secondary; } return info;}
まとめ
• RA-GRS を使うには、 .NET (xscl 3.0 以降 ) か Java (0.5.0以降 ) を使う• LocationMode でアクセス先が切り替わる• デフォルトは• リトライポリシーは、 ExponentialRetry• LocationMode は、 PrimaryOnly
• Primary のリトライ時に、 Secondary が 404( まだリプリケーションが完了していない)場合、 Primary に戻される
2014/2/26 kyrt @takekazuomi 9
リファレンス• Windows Azure Storage Redundancy Options and Read Access Geo
Redundant Storage• http://
blogs.msdn.com/b/windowsazurestorage/archive/2013/12/11/introducing-read-access-geo-replicated-storage-ra-grs-for-windows-azure-storage.aspx
• Windows Azure ストレージの冗長オプションと読み取りアクセス地理冗長ストレージ• http://
blogs.msdn.com/b/windowsazurej/archive/2013/12/19/blog-windows-azure-storage-redundancy-options-and-read-access-geo-redundant-storage.aspx
• Windows Azure: 新しいスケジューラ サービス、読み取りアクセス地理冗長ストレージ、監視のアップデート• http://satonaoki.wordpress.com/2013/12/13/azure-scheduler-ra-grs-monitoring/
• 地理冗長の読み取りアクセスを試してみる• http://buchizo.wordpress.com/2014/01/07/%E5%9C%B0%E7%90%86%E5%86%97%E9%95%B
7%E3%81%AE%E8%AA%AD%E3%81%BF%E5%8F%96%E3%82%8A%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/
• use RA-GRS;• http://blogs.technet.com/b/ksasaki/archive/2013/12/23/use-ra-grs.aspx※perl からのアクセス例です
2014/2/26 kyrt @takekazuomi 11
自己紹介
近江 武一
• Windows Azure (特に Storage) の構築、設計、支援• アーキテクチャ設計、検証twitter: @takekazuomigithub: https://github.com/takekazuomihttp://kyrt.in
2014/2/26 kyrt @takekazuomi 12
top related