Download.microsoft.com



Hands-On Lab

Windows Server AppFabric Cache:

Lab 7 – Security and Management

Lab version: 1.0.0

Last updated: 7/27/2010

[pic]

Contents

Overview 3

Exercise 1: Monitoring the AppFabric Cache 4

Task 1 – Creating the cache for this lab 4

Task 2 – Using Performance Monitor 5

Exercise 2: Using the Cache's ETW provider 10

Task 1 – Using AppFabric Cache’s Event Tracing for Windows (ETW) provider 10

Summary 14

Overview

The purpose of this lab is to introduce you to monitoring your Windows Server App Fabric Cache installation. The Cache provides many different avenues for monitoring, and in this lab, you will learn how to use the Windows Performance Monitor to see what’s happening inside of your Cache.

The Cache also uses Event Tracing for Windows (ETW) to provide a high-performance stream of information about health and performance. In this lab, you will see how to enable this tracing, as well as one way to view this trace information.

Objectives

After this lab you should be able to:

• Use performance monitor to view Cache information

• Enable and view the Cache’s ETW stream

.

Setup

You must perform the following steps to prepare your computer for this lab:

1. Complete the Development Environment Setup lab.

Exercises

This Hands-On Lab comprises the following exercises:

1. Monitoring the AppFabric Cache

2. Using the Cache’s ETW provider

.

Estimated time to complete this lab: 45 minutes.

.

Starting Materials

This Hands-On Lab includes the following starting materials.

Exercise 1: Monitoring the AppFabric Cache

In this exercise you will use Performance monitor to view the status, health, and behaviour of the AppFabric Cache.

Task 1 – Creating the cache for this lab

. Note: If you have already started your Cache and have PowerShell open from the previous lab, you can skip this task.

2. To verify the installation and start the cache host, open PowerShell from Start | Windows Server AppFabric | Caching Administration Windows PowerShell

1. Execute the Use-CacheCluster cmdlet to bring the current machine’s cluster configuration into the context of your PowerShell session.

. PowerShell

. Use-CacheCluster

2. Execute the Get-CacheHost cmdlet to see the state of your cache cluster.

. PowerShell

. Get-CacheHost

3. You should see something that looks similar to Figure 1. Note that the Service Status is DOWN.

. [pic]

. Figure 1

. Get-CacheHost cmdlet execution results

4. If the Service Status is UP, skip to Task 2. If the Service Status is DOWN start the cache host by using the Start-CacheHost cmdlet. Start-CacheHost requires two parameters: the host name and the port number. Set the value of the Get-CacheHost cmdlet to a variable named $myhost, and then use the $myhost.HostName and $myhost.PortNo properties as the input to Start-CacheHost.

. PowerShell

. $myhost = Get-CacheHost

. Start-CacheHost $myhost.HostName $myhost.PortNo

5. Your PowerShell command screen should look similar to Figure 2. Your Service Status should now be UP.

. [pic]

.

. Figure 2

. Starting the cache host

.

Task 2 – Using Performance Monitor

1. Create a new cache for this lab named Lab7Cache by typing the following PowerShell command and pressing Enter.

. PowerShell

. New-Cache Lab7Cache

3. Open Performance Monitor by going to Start | All Programs | Control Panel | Administrative Tools | Performance Monitor.

4. Click the Add button (the green cross in the right-hand side toolbar).

5. Scroll down in the Available Counters list and expand AppFabric Caching: Host.

. [pic]

. Figure 3

. Performance Counter displaying AppFabric Caching:Host counters

6. From the list of counters, select the following (you pick a counter by selecting it in the list and pressing the Add button):

|Counters to pick |

|Total Client Requests |

|Total Get Misses |

|Total Get Requests |

|Total Object Count |

. [pic]

. Figure 4

. Added counters

7. Click OK to close the Add Counters dialog.

8. Navigate to %AppFabricTrainingKit%\Labs\cLab07\Source\Assets\AppFabricCache\Resources\ using Windows Explorer.

9. Open the AppFabricCacheApp.exe.config file found in that directory.

10. Change the name attribute value to the name of your cluster host (i.e. your machine name).

. [pic]

. Figure 5

. Host name in configuration file

11. Close the AppFabricCacheApp.exe.config file.

12. Double-click on the AppFabricCacheApp.exe.

13. Click Cancel when the Open File dialog appears (this is to load assemblies containing the types you have loaded in the cache – you won’t be using it in this lab).

14. Navigate in the left-side tree to find Lab7Cache, and select it. [pic]

. Figure 6

. Highlighting Lab7Cache

15. While Lab7Cache is still selected, go to the file menu and select File | Exercise Cache.

. [pic]

. Figure 7

. Exercise Cache menu option

16. Switch back to Performance Monitor.

17. You should see the counters start to move.

. [pic]

. Figure 8

. Performance monitor running cache counters

18. Feel free to experiment with the different counters if you wish.

.

Exercise 2: Using the Cache's ETW provider

In this exercise you will use Event Tracing for Windows (ETW) to view the status, health, and behaviour of the AppFabric Cache.

Task 1 – Using AppFabric Cache’s Event Tracing for Windows (ETW) provider

In this task, you will configure the AppFabric Cache’s ETW provider to log events. Then you will use the ETW tools to view a snapshot of those events.

19. Open a Windows Command Prompt (All Programs | Accessories | Command Prompt, then right-click and select Run as Administrator).

20. Change the directory to %AppFabricTrainingKit%\Labs\cLab07\Source\Assets\AppFabricCache using Windows Explorer.

21. Enable an ETW session by using logman.exe using the following parameters

. Command Prompt

. logman create trace MySessionName –o test.etl –p {A77DCF21-545F-4191-B3D0-C396CF2683F2} 0x5 0x0 -ets

22. The logman command creates an ETW trace session named “MySessionName” using the AppFabricCache ETW provider (the GUID). The 0x0000005 parameter sets the trace level (5 == Verbose). The ets parameter starts the trace.

23. Go to .\Resources\AppFabricCacheAppusing Windows Explorer.

24. Open the AppFabricCacheApp.exe.config.

25. Change the name attribute value to the name of your cluster host (i.e. your machine name).

. [pic]

. Figure 9

. Host name in configuration file

26. Close the AppFabricCacheApp.exe.config file.

27. Double-click on the AppFabricCacheApp.exe.

28. Click Cancel when the Open File dialog appears (this is to load assemblies containing the types you have loaded in the cache – you won’t be using it in this lab).

29. Navigate in the left-side tree to find Lab7Cache, and select it.[pic]

. Figure 10

. Highlighting Lab7Cache

30. While Lab7Cache is still selected, go to the file menu and select File | Exercise Cache.

. [pic]

. Figure 11

. Exercise cache menu

31. Switch back to your open command prompt and type the following command to stop the trace:

. command

. logman stop MySessionName –ets

32. Use the tracerpt command line tool to generate a report from the trace file.

. command

. tracerpt test.etl

33. Wait for the tracerpt tool to finish.

34. In the \Source\ AppFabricCache directory, open the summary.txt file.

. [pic]

. Figure 12

. ETW summary

35. This file shows you a summary of what’s in the log file.

36. Feel free to open the dumpfile.xml file as well (be careful however, as these files can get quite large).

. [pic]

. Figure 13

. ETW log file XML

.

Summary

In this lab you used two methods to view the performance and health of the Windows Server AppFabric Cache. First you used Windows Performance Monitor to view the Cache’s performance counters. Then you used the Cache’s ETW capabilities to turn on and off the high-performance tracing enabled by ETW.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download