System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article describes how to configure Internet
Information Services (IIS) 7.0 FTP 7.5 site in a Windows Server 2008
failover cluster. The procedures in this article apply only to the FTP service.
For more information about how to configure Web services in a failover cluster, click the following article number to view the article in the Microsoft Knowledge Base:
970759
(http://support.microsoft.com/kb/970759/
)
Configuring IIS 7.0 in a Microsoft Windows Server 2008 failover cluster
In earlier versions of Internet Information Services,
Microsoft provided generic resource monitor components to support high
availability Web server instances by using the Microsoft Clustering
infrastructure. However, custom code was needed to fully realize the potential
of this solution. Also, the generic scripts that Microsoft provided did not
satisfy customer needs. To configure IIS 7.0 in a clustered environment by using
Windows Server failover clustering, you have to use a custom (scripting) code
to enable such a high availability scenario. When you do this, users can
customize the setup to meet their requirements. This gives them full control
over the high availability integration of Web applications. Additionally, the
script interfaces for administration and monitoring that were introduced in IIS
7.0 provide a richer environment than the scripts that were previously provided.
Note The IIS 7.0 installation files incorrectly include the
Clusweb.vbs and Clusftp.vbs script files that are used in IIS 6.0 for IIS
cluster administrative tasks. Do not use these scripts with IIS
7.0.
We recommend that administrators carefully evaluate the use of
Network Load Balancing (NLB) instead of using failover clustering as the primary and preferred method for improving
the scalability and availability of Web applications that have multiple servers
that are running IIS 7.0. One benefit of
NLB is that all servers can actively participate in the concurrent handling
of incoming HTTP requests. Another benefit is that in an NLB IIS environment,
it can be much easier to support rolling updates and rollbacks while still
providing high availability of Web applications. For more information about
how to use IIS 7.0 in an NLB environment, visit the following Microsoft Web
sites:
To configure high availability for IIS FTP servers using Failover
Clustering:
Install the Web Server role on all cluster nodes. If you
are installing on Windows Server 2008, do not include the "FTP Server" role. If
you are installing on Windows Server 2008 R2, include the in-box "FTP Server"
role. For more information about IIS 7 deployment guide, visit the following Web
site:
Set up a file share that will be used for IIS Shared
Configuration.
Configure IIS Shared Configuration on all cluster
nodes.
Configure Offline Files for IIS Shared Configuration on all
cluster nodes.
Configure the FTP site and specify the location of its
content on one cluster node.
Configure highly availability for your FTP site by creating
a generic script in Failover Clustering.
Set up a file share that will be used for IIS shared configuration
Create a user who will access the share that will be used
for the IIS shared configuration.
Create the file share. This share will be used to store the
IIS shared configuration that will be shared between IIS on all cluster nodes.
There are multiple options:
On a stand-alone server that is not part of any failover
cluster, create a file share.
On another Windows Server failover cluster, create a
high availability file share. For more information, visit the following Microsoft Web
site:
On the same failover cluster that will host the high
availability FTP site, create a high availability file share. For more information,
visit the following Microsoft Web site:
Set the permissions on the share that you created in step
2. Give the user who you created in step 1 Full Control permissions to the
file share and NTFS permissions.
Confirm that all cluster nodes can browse to the
file share. The path of the file share is
\\<fileservername>\<sharename>.
Configure the IIS shared configuration on all cluster nodes
On one of the cluster nodes, export the shared configuration
to the file share:
Navigate to Administrative Tools, and then
click Internet Information Services (IIS) Manager.
In the left pane, click the server name node.
Double-click the Shared Configuration
icon.
On the Shared Configuration page, click Export
Configuration in the Actions pane (the right pane) to
export the configuration files from the local computer to another location.
In the Export Configuration dialog box,
type the path of the file share
(\\<fileservernae>\<sharename>)
in the Physical path box.
Click Connect As, and then type the user
name and the password for the user account that has access to the share in
which the shared configuration is stored, and then click OK.
This account will be used to access the share. You should use a restricted
Active Directory account that is not the domain administrator.
In the Export Configuration dialog box,
type a password that will be used to protect the encryption keys, and then
click OK.
On the Shared Configuration page, click to
select the Enable shared configuration check box.
Type the physical path, the user account, and the password
that you entered previously, and then click Apply in the
Actions pane.
In the Encryption Keys Password dialog
box, type the encryption key password that you set earlier, and then click
OK.
In the Shared Configuration dialog box, click
OK.
Click OK.
On each of the other cluster nodes, use the shared
configuration that you just exported to the file share:
Navigate to Administrative Tools, and then
click Internet Information Services (IIS) Manager.
Click the server name node.
Double-click the Shared Configuration
icon.
On the Shared Configuration page, click to
select the Enable shared configuration check box.
Type the physical path of the file share
(\\<fileservername>\<sharename>), the user account, and the
password that you entered previously, and then click Apply in
the Actions pane.
In the Encryption Keys Password dialog
box, type the encryption key password that you set earlier, and then click
OK.
In the Shared Configuration dialog box, click
OK.
Click OK.
Note For more information about how to set up shared configurations in
IIS, visit the following Microsoft Web site:
Browse to the file server from the computer. Right-click
the share that contains the IIS shared configuration, and then click
Always Available Offline.
Note If you set up the file share to be highly available on the same
failover cluster that hosts IIS nodes, the Always Available Offline option will
not appear when you right-click the share if the cluster node that you are on is
hosting the highly available file server. You will have to move the high
available file server application to another node.
In Control Panel, open Offline
Files. Click Open Sync Center, and then click
Schedule.
Schedule an offline file sync for every day or according to
the requirement. You can also configure the offline sync to run every few
minutes. Even if you do not set up a scheduler, when you change something in
the Applicationhost.config file, the change is reflected on the Web server.
Note For more information about how to configure offline files for a
shared configuration in IIS, visit the following Microsoft Web site:
Configure the FTP site and specify the location of its content on one
cluster node
Find the cluster node that owns the cluster
disk resource where the FTP site content files will reside:
Navigate to Administrative Tools, and then
click Failover Cluster Manager.
Connect to the cluster. If you are on one of the cluster
nodes, the cluster will appear on the list automatically.
Under Storage, find the disk resource on
which the FTP site content will reside. To do this, expand the storage tree for
the disk resource. Make sure that the storage is not used by any other high
availability application on the cluster. You will find the storage under
Available Storage.
Note the cluster node on which this resource is online. You
will configure IIS on that cluster node.
Note the cluster disk resource name. You will use this for
the content files.
On the cluster node on which the resource is online,
configure the FTP server to use the shared disk for FTP site content:
Navigate to Administrative Tools, and then
click Internet Information Services (IIS) Manager.
In the left pane, expand the server name node.
Expand Sites, right-click
Sites, and then click Add FTP Site.
In the Add FTP Site dialog box, type the site
name. For the content directory, type the location where the FTP site
content files are located. This is the location of the cluster disk resource
that you noted in step 5 of the previous procedure.
Configure remaining FTP site settings.
Click Finish.
Configure high availability for your FTP site by creating a generic script in Failover Cluster Manager
For the last step to configure high availability for FTP
site, set up the generic script resource that will be used to monitor the FTP
service:
On each cluster node, copy the script at the end of this
article to Windows\System32\inetsrv\Clusftp7.vbs.
Navigate to Administrative Tools, and then
click Failover Cluster Manager.
Connect to the cluster. If you are on one of the cluster
nodes, the cluster will appear on the list automatically.
Right-click the cluster, and then click Configure a
Service or Application. A wizard creates the high availability
workload.
Click Generic Script.
Select the script file from the following path:
%systemroot%\System32\Inetsrv\Clusftp7.vbs
Set the Client Access Point (CAP) name to the FTP site name
that clients will use to connect to the high availability FTP site. Specify the
static IPs to use for the FTP site CAP. If you are using Dynamic Host Configuration Protocol (DHCP), this option will
not be displayed.
On the Select Storage step, select the
cluster shared disk on which the FTP site content files reside. The storage
should be unused by any other high availability application on the cluster.
If the file share that is used for the IIS shared configuration is
hosted on the same cluster, a different disk resource should be used here.
After you confirm the settings, the wizard will create the
cluster group, cluster resources, and the dependencies between the resources,
and then bring the resources online.
Note To host multiple high availability FTP sites on the same failover
cluster, follow the same steps that are mentioned earlier. You can point to the same script file
for all FTP sites on the cluster if you did not customize the script. However,
if you make changes that are specific to the individual FTP sites, use a
different script file for each FTP site and different clustered shared storage.
For example, in %systemroot%\System32\Inetsrv, use Clusftp7.vbs for the first
FTP site, Clftp7-2.vbs for the second, Clftp7-3.vbs for the third, and so on.
Each script file monitors a different FTP site.
'This script provides high availability for IIS FTP websites
'The script is applicable to:
' - Windows Server 2008: Microsoft FTP Service 7.5 for IIS 7.0 (available for download from microsoft.com)
' - Windows Server 2008 R2: FTP Service in the box
'More thorough and application-specific health monitoring logic can be added to the script if needed
Option Explicit
'Helper script functions
'Start the FTP service on this node
Function StartFTPSVC()
Dim objWmiProvider
Dim objService
Dim strServiceState
Dim response
'Check to see if the service is running
set objWmiProvider = GetObject("winmgmts:/root/cimv2")
set objService = objWmiProvider.get("win32_service='ftpsvc'")
strServiceState = objService.state
If ucase(strServiceState) = "RUNNING" Then
StartFTPSVC = True
Else
'If the service is not running, try to start it
response = objService.StartService()
'response = 0 or 10 indicates that the request to start was accepted
If ( response <> 0 ) and ( response <> 10 ) Then
StartFTPSVC = False
Else
StartFTPSVC = True
End If
End If
End Function
'Cluster resource entry points. More details here:
'http://msdn.microsoft.com/en-us/library/aa372846(VS.85).aspx
'Cluster resource Online entry point
'Make sure the FTP service is started
Function Online( )
Dim bOnline
'Make sure FTP service is started
bOnline = StartFTPSVC()
If bOnline <> True Then
Resource.LogInformation "The resource failed to come online because ftpsvc could not be started."
Online = False
Exit Function
End If
Online = true
End Function
'Cluster resource offline entry point
'On offline, do nothing.
Function Offline( )
Offline = true
End Function
'Cluster resource LooksAlive entry point
'Check for the state of the FTP service
Function LooksAlive( )
Dim objWmiProvider
Dim objService
Dim strServiceState
set objWmiProvider = GetObject("winmgmts:/root/cimv2")
set objService = objWmiProvider.get("win32_service='ftpsvc'")
strServiceState = objService.state
if ucase(strServiceState) = "RUNNING" Then
LooksAlive = True
Else
LooksAlive = False
End If
End Function
'Cluster resource IsAlive entry point
'Do the same health checks as LooksAlive
'If a more thorough than what we do in LooksAlive is required, this should be performed here
Function IsAlive()
IsAlive = LooksAlive
End Function
'Cluster resource Open entry point
Function Open()
Open = true
End Function
'Cluster resource Close entry point
Function Close()
Close = true
End Function
'Cluster resource Terminate entry point
Function Terminate()
Terminate = true
End Function