Book Image

Microsoft Windows Server AppFabric Cookbook

Book Image

Microsoft Windows Server AppFabric Cookbook

Overview of this book

Windows Server AppFabric provides a set of integrated capabilities that extend IIS and the Windows Server platform making it easier to build, scale and manage composite applications today. Windows Server AppFabric delivers the first wave of innovation within an exciting new middleware paradigm which brings performance, scalability and enhanced management capabilities to the platform for applications built on the .NET Framework using Windows Communication Foundation and Windows Workflow Foundation.'Microsoft Windows Server AppFabric Cookbook' shows you how to get the most from WCF and WF services using Windows Server AppFabric leveraging the capabilities for building composite solutions on the .NET platform. Packed with over 60 task-based and immediately reusable recipes, 'Microsoft Windows Server AppFabric Cookbook' starts by showing you how to set up your development environment to start using Windows Server AppFabric quickly. The book then moves on to provide comprehensive coverage of the most important capabilities provided by Windows Server AppFabric, diving right in to hands-on topics such as deploying WCF and WF applications to Windows Server AppFabric and leveraging the distributed caching, scalable hosting, persistence, monitoring and management capabilities that Windows Server AppFabric has to offer, with recipes covering a full spectrum of complexity from simple to intermediate and advanced.
Table of Contents (16 chapters)
Microsoft Windows Server AppFabric Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Configuring Windows Server AppFabric (hosting and monitoring)


There are a number of configuration options available when configuring Windows Server AppFabric, and in this recipe we will go through them. At this point, we should appreciate Microsoft's efforts in designing Windows Server AppFabric, as it allows a fair bit of customization.

Getting ready

Configuring Windows Server AppFabric is available via the Windows Server AppFabric Configuration wizard. It is a fairly simple task, but it requires careful consideration of a number of options and possibilities. We will need the following items ready in order to configure Windows Server AppFabric:

  • Service accounts to run (with administrative privileges)

    • AppFabric Hosting's Event Collection service

    • AppFabric Hosting's Persistence service

  • SQL server database for:

    • (SQL server based) monitoring provider

    • (SQL server based) persistence provider

    • AppFabric caching store service provider (if your machine is part of a domain)

  • UNC file share for Windows Server AppFabric Caching service configuration provider (if the host machine is running in a workstation mode)

  • Information on cluster set up (for a high-availability scenario)

    Note

    When HA (High Availability) is enabled Windows Server AppFabric Cache stores a copy of each cached object or region in a separate cache host. HA is discussed in detail in Chapter 7, Monitoring Windows Server AppFabric Deployment.

  • Unique port numbers for cache, cluster, arbitration, and replication

    Note

    It should be noted that when you run the Windows Server AppFabric Configuration wizard and make changes to the configuration, it will overwrite any existing values.

How to do it...

To launch the Window Servers AppFabric Configuration wizard, go to All programs under the Start menu, find AppFabric, and then select Configure AppFabric.

The following is a sequence of steps that will take you through the configuration wizard for Windows Server AppFabric:

  1. 1. Run the Configure AppFabric wizard.

  2. 2. Accept the User Account Control (UAC) dialog, confirming that you will allow this program to make changes to your host machine:

  3. 3. Click on Next at the bottom of the screen to start the configuration of Windows Server AppFabric.

  4. 4. Once you are at the Configure Hosting Services screen, select the box titled Set monitoring configuration:

  5. 5. Select the service account required to run the AppFabric Event Collection service by clicking on Change.

  6. 6. If you do not have a ready-made account available for the event collection service, then you can leave the default value of NT Authority\Local Service, (as this can be modified later on). For more details on security, please refer to the How it works... section, as well as Chapter 9, Configuring Windows Server AppFabric Security.

  7. 7. Now select the Monitoring provider, as this will provide access to the monitoring database. (As there is only one default SQL-based implementation, select the System.Data.SqlClient option.)

    Note

    Windows Server AppFabric by design allows adding multiple providers for monitoring and persistence. Configuring multiple persistence providers is discussed in Chapter 5, More Windows Server AppFabric Hosting Features.

  8. 8. Now click on Configure to launch the SQL configuration screen to help you select/configure the SQL server instance that will be used to store monitoring information.

  9. 9. Select Register AppFabric monitoring store in root web.config.

  10. 10. Select Initialize monitoring store.

  11. 11. Under Connection String, provide the SQL Server name, for example,<HostServerName>\<SQLInstanceName>.

  12. 12. Provide the Database name for the SQL Server.

    Note

    The SQL database (specified above in steps 11 and 12) is used to store Windows Server AppFabric monitoring related information. The Initialize monitoring store option will initialize the database with the monitoring schema.

  13. 13. The first half of your configuration screen should appear as follows:

  14. 14. Now we will set up the Security Configuration to access the SQL Server database instance that we selected/created previously. For Windows authentication, if you have selected a complete install, then you will see default values for Administrators, Readers, and Writers in Security Configuration. If you already have roles defined and you have opted to initialize the Monitoring Database, then you can browse and select the appropriate roles. Otherwise, use the default values of AS_Administrators and AS_Observers as Administrators/Writers and Readers respectively. This is shown in the following screenshot:

    Note

    Windows Server AppFabric's AS_Administrators is a conceptual and administrative role. As the name implies it allows full control over AppFabric's configuration, monitoring, and persistence capabilities. Event Collection and Workflow Persistence services run under this role.

    Likewise, AS_Observer is also a conceptual and administrative role. It allows you to view the application and services configuration, monitor data, as well as view persisted instances, all without being able to modify anything.

  15. 15. However, if you wish to choose SQL Server Authentication, you will need to provide a username and password that will be used to connect to SQL Server database. In this recipe we will only use Windows authentication.

  16. 16. Once you click on OK you should see a confirmation dialog asking you to validate whether you want these settings to take effect:

  17. 17. Click on Yes, and the wizard will go ahead and create and initialize the monitoring store. Once completed, you should see a validation dialog advising you that the Monitoring store was initialized and registered successfully:

  18. 18. On the Configure Hosting Services screen, select Set persistence configuration.

  19. 19. Now, select an AppFabric Workflow Management service account. Just like the service account for monitoring, we will need a service account that has admin rights and can access the persistence provider/store. If you have an account already available for this then click on Change and select it. Otherwise, use the default value of the NT AUTHORITY\LOCAL SERVICE account:

  20. 20. From the Persistence provider dropdown, select a sqlStoreProvider and then click on Configure. Now this screen should look familiar, as it is the same one we used to set up Windows Server AppFabric Monitoring earlier on. We will once again select Register AppFabric persistence store in root web.config. We will also select Initialize persistence store and provide the SQL Server and Database names:

  21. 21. Just like we set up the Security Configuration for the Windows Server AppFabric Monitoring database, repeat the same steps and use built-in accounts for the persistence database.

  22. 22. Click on OK and proceed to confirm the changes. This will complete the configuration of the Hosting and Monitoring parts of Windows Server AppFabric.

How it works...

The configuration of Windows Server AppFabric provides contextual information to run Windows Server AppFabric services that are responsible for monitoring and hosting services. The values that we configured can be changed later, either by running the AppFabric Configuration wizard again or by using Windows Server AppFabric PowerShell commandlets (Cmdlets).

Note

Windows PowerShell is built on top of Microsoft.NET and offers a task based command-line shell and scripting language. Windows PowerShell has built in commands called Cmdlets (pronounced as commandlets). Cmdlets are lightweight commands and typically return a Microsoft.NET Framework object type to the next command in the pipeline.

It should be noted that monitoring and persistence services should be run under accounts with administrative privileges so that they can read and persist events to the preconfigured monitoring and persistence databases.