Sharepoint 计时器作业 - 该作业在哪台服务器上执行?

发布于 2024-08-11 17:18:16 字数 241 浏览 4 评论 0原文

如果我将(计时器作业)功能安装到场内的 Sharepoint 前端服务器,哪台服务器执行该作业?他们全部?

该作业在作业级别锁定,并且 Execute 方法调用场中一台特定计算机上的 Web 服务,该计算机负责所有处理。我的问题是所有前端服务器是否都会尝试运行此作业?

或者网络人员想要在服务器场中提供一个新服务器,以便该作业不会耗尽主服务器的资源,但在我看来,我们将重复执行该作业。

使困惑。有人知道这个问题的答案吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉宸 2024-08-18 17:18:16

计时器作业实际上可以部署到单个实例(如果您愿意,也可以部署到所有实例)。此链接提供了一个很好的答案:

通过构造函数进行计时器作业部署

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

看轻我的陪伴 2024-08-18 17:18:16

对于 SharePoint 2010,请参阅如何:在所有 Web 服务器上运行代码

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

请注意有关此代码的以下几点:

第三个参数可用于指定作业应运行的特定服务器。当作业应在所有前端 Web 服务器上运行时,此值为空。

第四个参数确定作业是否在所有前端Web服务器上执行。传递 SPJobLockType.None 可确保它在运行 Microsoft SharePoint Foundation Web 应用程序服务的所有服务器上运行。相比之下,传递SPJobLockType.Job 可确保它仅在运行 Microsoft SharePoint Foundation Web 应用程序服务的第一个可用服务器上运行。 (还有第三个可能的值。有关详细信息,请参阅 SPJobDefinition 及其构造函数和其他成员的主题。)

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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文