English 中文(简体)
Sharepoint Timer Job - Which server does the job execute on?
原标题:

If I install a (timer job) feature to a Sharepoint front end server within a farm, which server executes the job? All of them?

The job is locked at the job level, and the Execute method calls a web service on one specific machine on the farm, which handles all the processing. My question is whether all the front end servers will try and run this job?

Or network guys want to provide a new server in the farm, so that this job doesn t eat up the resources of the main server, but it sounds to me like we will duplicate the execution of the job.

Confused. Anyone know the answer to this question?

问题回答

The timer job can actually be deployed to a single instance (or to all of them if you like). This link provides a good answer:

Timer Job deployment via constructors

For SharePoint 2010, see How to: Run Code on All Web Servers:

MyTimerJob myTJ = new MyTimerJob(
    "contoso-job-add-mobile-adapter", 
    webApp, 
    null, 
    SPJobLockType.None);

Note the following about this code:

The third parameter can be used to specify a particular server on which the job should run. This is null when the job should run on all front-end Web servers.

The fourth parameter determines whether the job executes on all front-end Web servers. Passing SPJobLockType.None ensures that it runs on all servers on which the Microsoft SharePoint Foundation Web Application service is running. By contrast, passing SPJobLockType.Job ensures that it runs only on the first available server on which the Microsoft SharePoint Foundation Web Application service is running. (There is a third possible value. For more information, see SPJobDefinition and the topics for its constructors and other members.)





相关问题
SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

UI automated testing within SharePoint

I m looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and documents thought the web interface. It needs to be extensible enough to handle any custom ...

Enable authorization on sitemap provider

I want to enable Authorization on the Site map provider. We have enabled anonymous access to the site and we want the Site map provider to be visible only to authorized users. I tried ...

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...

热门标签