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
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:
- Run the Configure AppFabric wizard.
- Accept the User Account Control (UAC) dialog, confirming that you will allow this program to make changes to your host machine:
- Click on Next at the bottom of the screen to start the configuration of Windows Server AppFabric.
- Once you are at the Configure Hosting Services screen, select the box titled Set monitoring configuration:
- Select the service account required to run the AppFabric Event Collection service by clicking on Change.
- 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.
- 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.
- 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.
- Select Register AppFabric monitoring store in root web.config.
- Select Initialize monitoring store.
- Under Connection String, provide the SQL Server name, for example,
<HostServerName>\<SQLInstanceName>
. - Provide the Database name for the SQL Server.
- The first half of your configuration screen should appear as follows:
- 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.
- 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.
- Once you click on OK you should see a confirmation dialog asking you to validate whether you want these settings to take effect:
- 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:
- On the Configure Hosting Services screen, select Set persistence configuration.
- 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:
- 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:
- 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.
- 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.