Managing Farm Solutions

Deploying a solution package to a SharePoint server farm consists of two distinct operations: Add and Deploy. The Add operation uploads the solution file into SharePoint's configuration database where it can be accessed by each server in the farm. Deploying a solution refers to installing the files contained in the solution into various file system directories on each server in the farm.

Adding a Solution to the Farm Store

Adding a solution to the farm solution store can be done only by a farm administrator. There is no page in Central Administration that allows a package to be uploaded. This step must be accomplished using a command-line tool. Solutions can also be added programmatically using the SharePoint API.

To use the STSADM tool to add the package, use a command such as the following:

stsadm -o addsolution -filename MySolution.wsp

To perform the same operation using Windows PowerShell, use a command such as the following:

Add-SPSolution -LiteralPath MySolution.wsp

Once the Add operation is complete, the package will appear on the Solution Management page of the Central Administration site as shown in Figure 13-4. The package file has now been uploaded, but its features are not yet ready to use. At this point, the solution files have not been installed on each SharePoint server.

images

Figure 13-4. The farm solution store

Deploying a Solution to the Farm

Now that you have added the package to the farm solution store, you are ready to deploy it to the farm. There are two ways to deploy a package from the farm store: local deployment and via a timer job.

Performing a local deployment installs the solution files on one server in the farm. This type of deployment can only be done from the command line and only affects the server on which it is run. The solution will not be usable until it is deployed on all of the farm's servers. Therefore, it will be necessary to execute the command on each server.

The more common type of deployment uses the SharePoint Timer Service. This type of deployment can be performed using either the command line or the Central Administration web site. When the deployment is started, a timer job is created that will run on each server in the farm. This has the same effect, in one step, of performing local deployments on each server. (See Figure 13-5.)

images

Figure 13-5. Local vs. timer job deployment

In addition to allowing deployment in a single step, timer job deployments also automate the process of restarting the IIS worker processes. This is necessary to enable the new solution's files to be recognized properly by SharePoint. There may be a brief outage experienced when the IIS worker process is restarted but it will be no more than a few seconds in most cases.

To perform a farm deployment from the command line, you can use either the -deploysolution option on the STSADM tool or the Install-SPSolution cmdlet in Windows PowerShell.

images Note No, that is not a typo. The PowerShell cmdlet is called Install-SPSolution, not Deploy-SPSolution, for some unknown reason.

Both of these commands have a -local flag to perform a local deployment. To use a timer job that will run at a given time, you can use the -time option on either command. To use a timer job that executes immediately after the command is entered, use the -immediate option on STSADM or just leave the -local and -time options off of the Windows PowerShell command.

Several other options can be specified when deploying a farm solution. Here are a few of the most important:

  • Web Application: Some solutions contain resources that need to be deployed within the IIS web application directory structure. When deploying a solution, you can select a set of web applications to target for these resources.
  • Global Assemblies: If the solution package contains assemblies that need to be deployed to the Global Assembly Cache (GAC), an option is required to prevent the administrator from unknowingly deploying fully-trusted code.
  • Code Access Security: CAS policies control the permissions granted to partially-trusted code running in the farm. If a solution package contains new CAS policies, a flag must be supplied to ensure that the administrator is aware of their presence.

You can also deploy a solution from the Central Administration web site. Select System Settings from the left menu. Then, select Manage Farm Solutions. A freshly added package will be displayed with a status of Not Deployed. Click the package name and the screen shown in Figure 13-6 will be displayed.

images

Figure 13-6. Manage Farm Solutions (Central Administration)

This page contains a lot of useful information about the package including whether it contains items that require special handling during deployment like fully-trusted assemblies or CAS policies. Clicking the Deploy Solution link will display a form that can be used to start a timer job for deployment (see Figure 13-7). Local deployments cannot be performed through the web interface.

images

Figure 13-7. Deploy Solution (Central Administration)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.238.20