SlideShare uma empresa Scribd logo
1 de 16
Azure AppFabric Service Busでクラウド型PC監視サービスを作ってみる 26 August 2010 #jazug 中原 知也@tnkhr01
自己紹介 中原 知也 (Twitter :   @tnkhr01) 新しいモノに目がない Azure歴1年(2009CTP~) 本職は仮想化系営業/SE/ソリューション開発 社内でAzureの話があがると駆けつける人 Tech・Days 2010 でAzure賞を頂きました-> 26-Aug-10 @tnkhr01 2
クラウド型PC監視サービス? Agent 監視対象PC (Agent起動) 26-Aug-10 @tnkhr01 3 Internet Explorer Tool 監視用PC
Windows Azure クラウド型PC監視サービス? Windows Azure Platform AppFabricService Bus End Point Web Role WCF WCF WCF Agent Tool Internet Explorer 監視対象PC (Agent起動) 監視用PC 26-Aug-10 @tnkhr01 4
AppFabric SDK V1.0EchoSample 今回はコレを ベースに 実装してみる Windows Azure Platform AppFabric Service Bus EndPoint Echo:「Hello Azure!」 Service.exe Client.exe http://www.microsoft.com/downloads/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5 26-Aug-10 @tnkhr01 5 Return:「Hello Azure!」
クラウド(Service Bus)側の実装 26-Aug-10 @tnkhr01 6
Service(監視Agent)側の実装 <実装方法>  受け取ったEchoをコマンドと見立てて実行し、 標準出力をクライアントに返す(だけ)。 <メリット>  楽。 <デメリット>  セキュリティ的に激しく危険。  (実際は構文解析+フィルタが必須)  public string Echo(string text)  { ProcessStartInfopsi = new ProcessStartInfo(); psi.FileName = System.Environment. GetEnvironmentVariable("ComSpec"); psi.RedirectStandardInput= false; psi.RedirectStandardOutput = true; psi.UseShellExecute= false; psi.CreateNoWindow = true; psi.Arguments= @"/c " + text;         Process p = Process.Start(psi);         string results = p.StandardOutput.ReadToEnd(); p.WaitForExit();         return results; } 26-Aug-10 @tnkhr01 7
Client(監視用Tool)側の実装 <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) 26-Aug-10 @tnkhr01 8
26-Aug-10 @tnkhr01 9 typeperf-sc 1 "rocessor(*) Processor Time” "(PDH-CSV 4.0)","E4300-02rocessor(0) Processor Time","E4300-02rocessor(1) Processor Time","E4300-02rocessor(_Total) Processor Time" "08/25/2010 00:36:54.941","7.964674","31.363486","19.664075"                コマンドは、正しく完了しました。 Client(監視用Tool)側の実装 CPU使用率 (コア1,2,合計) <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) sc query state= all … SERVICE_NAME: W3SVC DISPLAY_NAME: World Wide Web Publishing Service         TYPE               : 20  WIN32_SHARE_PROCESS         STATE              : 4  RUNNING                                 (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)         WIN32_EXIT_CODE    : 0  (0x0)         SERVICE_EXIT_CODE  : 0  (0x0)         CHECKPOINT         : 0x0         WAIT_HINT          : 0x0 SERVICE_NAME: WAS … プロセス稼働状況 …と表示してほしいが?
ハマりました 大きなデータを送受信すると… Error: 操作 'Echo' の応答メッセージの本文をシリアル化解除しているときにエラーが発生しました。XML データの読み取り中に、最大文字列コンテンツ長のクォータ (8192)を超えました。このクォータを増やすには、XML リーダーの作成時に使用される XmlDictionaryReaderQuotasオブジェクトの MaxStringContentLengthプロパティを変更してください。 26-Aug-10 @tnkhr01 10
Client/Program.cs (問題の箇所) // create the channel factory loading the configuration ChannelFactory<IEchoChannel> channelFactory =  newChannelFactory<IEchoChannel>  ("RelayEndpoint", newEndpointAddress(serviceUri)); // apply the Service Bus credentials channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential); // create and open the client channel IEchoChannelchannel = channelFactory.CreateChannel(); channel.Open(); … 26-Aug-10 @tnkhr01 11
Client/App.config (bindingの確認)  <client>       <!-- Application Endpoint -->       <endpoint name="RelayEndpoint“	contract="Microsoft.ServiceBus.Samples.IEchoContract“	binding="netTcpRelayBinding"/>     </client> 26-Aug-10 @tnkhr01 12
Client/Program.cs (変更後) // create the channel factory loading the configuration NetTcpRelayBinding binding = new NetTcpRelayBinding(); binding.Name = "RelayEndpoint"; binding.MaxReceivedMessageSize = 819200; binding.MaxBufferSize = 819200; binding.ReaderQuotas.MaxStringContentLength = 819200; binding.ReaderQuotas.MaxNameTableCharCount = 819200; ChannelFactory<IEchoChannel> channelFactory =  newChannelFactory<IEchoChannel>  	(binding, new EndpointAddress(serviceUri)); // apply the Service Bus credentials … 「msdnセキュリティに関するデータの考慮事項」は要確認 http://msdn.microsoft.com/ja-jp/library/ms733135.aspx 26-Aug-10 @tnkhr01 13
DEMO 26-Aug-10 @tnkhr01 14 Windows Azure Windows Azure Platform AppFabricService Bus End Point Web Role WCF PC電源入れたまま 外出してしまった! スリープに! WCF Agent ブラウザ 監視対象Win7 PC (Agent起動) ガラケー @tnkhr01
まとめ 26-Aug-10 @tnkhr01 15
26-Aug-10 @tnkhr01 16

Mais conteúdo relacionado

Destaque

Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Private Cloud
 
Migrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows AzureMigrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows Azure
Brian Bendera
 

Destaque (13)

Creando vms con azure power shell
Creando vms con azure power shellCreando vms con azure power shell
Creando vms con azure power shell
 
Sql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & IkeSql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & Ike
 
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
 
SQL Azure Federation and Scalability
SQL Azure Federation and ScalabilitySQL Azure Federation and Scalability
SQL Azure Federation and Scalability
 
Building An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureBuilding An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql Azure
 
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
 
Scaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure FederationsScaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure Federations
 
Migrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows AzureMigrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows Azure
 
Bases de datos SQL Azure en Microsoft Azure con C#
Bases de datos SQL Azure en Microsoft Azure con C#Bases de datos SQL Azure en Microsoft Azure con C#
Bases de datos SQL Azure en Microsoft Azure con C#
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for Developers
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQL
 
Azure Data Lake Intro (SQLBits 2016)
Azure Data Lake Intro (SQLBits 2016)Azure Data Lake Intro (SQLBits 2016)
Azure Data Lake Intro (SQLBits 2016)
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Azure AppFabric Service Bus でクラウド型PC監視サービスを作ってみる

  • 1. Azure AppFabric Service Busでクラウド型PC監視サービスを作ってみる 26 August 2010 #jazug 中原 知也@tnkhr01
  • 2. 自己紹介 中原 知也 (Twitter :   @tnkhr01) 新しいモノに目がない Azure歴1年(2009CTP~) 本職は仮想化系営業/SE/ソリューション開発 社内でAzureの話があがると駆けつける人 Tech・Days 2010 でAzure賞を頂きました-> 26-Aug-10 @tnkhr01 2
  • 3. クラウド型PC監視サービス? Agent 監視対象PC (Agent起動) 26-Aug-10 @tnkhr01 3 Internet Explorer Tool 監視用PC
  • 4. Windows Azure クラウド型PC監視サービス? Windows Azure Platform AppFabricService Bus End Point Web Role WCF WCF WCF Agent Tool Internet Explorer 監視対象PC (Agent起動) 監視用PC 26-Aug-10 @tnkhr01 4
  • 5. AppFabric SDK V1.0EchoSample 今回はコレを ベースに 実装してみる Windows Azure Platform AppFabric Service Bus EndPoint Echo:「Hello Azure!」 Service.exe Client.exe http://www.microsoft.com/downloads/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5 26-Aug-10 @tnkhr01 5 Return:「Hello Azure!」
  • 7. Service(監視Agent)側の実装 <実装方法>  受け取ったEchoをコマンドと見立てて実行し、 標準出力をクライアントに返す(だけ)。 <メリット>  楽。 <デメリット>  セキュリティ的に激しく危険。  (実際は構文解析+フィルタが必須) public string Echo(string text) { ProcessStartInfopsi = new ProcessStartInfo(); psi.FileName = System.Environment. GetEnvironmentVariable("ComSpec"); psi.RedirectStandardInput= false; psi.RedirectStandardOutput = true; psi.UseShellExecute= false; psi.CreateNoWindow = true; psi.Arguments= @"/c " + text; Process p = Process.Start(psi); string results = p.StandardOutput.ReadToEnd(); p.WaitForExit(); return results; } 26-Aug-10 @tnkhr01 7
  • 8. Client(監視用Tool)側の実装 <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) 26-Aug-10 @tnkhr01 8
  • 9. 26-Aug-10 @tnkhr01 9 typeperf-sc 1 "rocessor(*) Processor Time” "(PDH-CSV 4.0)","E4300-02rocessor(0) Processor Time","E4300-02rocessor(1) Processor Time","E4300-02rocessor(_Total) Processor Time" "08/25/2010 00:36:54.941","7.964674","31.363486","19.664075"                コマンドは、正しく完了しました。 Client(監視用Tool)側の実装 CPU使用率 (コア1,2,合計) <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) sc query state= all … SERVICE_NAME: W3SVC DISPLAY_NAME: World Wide Web Publishing Service TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 SERVICE_NAME: WAS … プロセス稼働状況 …と表示してほしいが?
  • 10. ハマりました 大きなデータを送受信すると… Error: 操作 'Echo' の応答メッセージの本文をシリアル化解除しているときにエラーが発生しました。XML データの読み取り中に、最大文字列コンテンツ長のクォータ (8192)を超えました。このクォータを増やすには、XML リーダーの作成時に使用される XmlDictionaryReaderQuotasオブジェクトの MaxStringContentLengthプロパティを変更してください。 26-Aug-10 @tnkhr01 10
  • 11. Client/Program.cs (問題の箇所) // create the channel factory loading the configuration ChannelFactory<IEchoChannel> channelFactory = newChannelFactory<IEchoChannel> ("RelayEndpoint", newEndpointAddress(serviceUri)); // apply the Service Bus credentials channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential); // create and open the client channel IEchoChannelchannel = channelFactory.CreateChannel(); channel.Open(); … 26-Aug-10 @tnkhr01 11
  • 12. Client/App.config (bindingの確認) <client> <!-- Application Endpoint --> <endpoint name="RelayEndpoint“ contract="Microsoft.ServiceBus.Samples.IEchoContract“ binding="netTcpRelayBinding"/> </client> 26-Aug-10 @tnkhr01 12
  • 13. Client/Program.cs (変更後) // create the channel factory loading the configuration NetTcpRelayBinding binding = new NetTcpRelayBinding(); binding.Name = "RelayEndpoint"; binding.MaxReceivedMessageSize = 819200; binding.MaxBufferSize = 819200; binding.ReaderQuotas.MaxStringContentLength = 819200; binding.ReaderQuotas.MaxNameTableCharCount = 819200; ChannelFactory<IEchoChannel> channelFactory = newChannelFactory<IEchoChannel> (binding, new EndpointAddress(serviceUri)); // apply the Service Bus credentials … 「msdnセキュリティに関するデータの考慮事項」は要確認 http://msdn.microsoft.com/ja-jp/library/ms733135.aspx 26-Aug-10 @tnkhr01 13
  • 14. DEMO 26-Aug-10 @tnkhr01 14 Windows Azure Windows Azure Platform AppFabricService Bus End Point Web Role WCF PC電源入れたまま 外出してしまった! スリープに! WCF Agent ブラウザ 監視対象Win7 PC (Agent起動) ガラケー @tnkhr01