Quartz.NET,“与远程调度程序通信时出错。”
我无法让 Quartz.NET 的客户端/服务器实现正常工作。
我在 ServerA 上有一个 SQL Server,一个运行 Quartz 作为服务的服务器 (ServerB) 和一个托管 ASP.NET 应用程序的服务器 (ServerC)。
我已经遵循了所有教程并深入研究了代码,但我看不出我做错了什么。服务器肯定正在监听,我可以看到 ServerC 的端口已打开。不涉及防火墙。
ServerB 正在运行下载包中包含的服务 (Quartz.Server.Service),具有以下配置文件设置:
<quartz>
<add key="quartz.server.serviceName" value="quartz" />
<add key="quartz.server.serviceDisplayName" value="Job Scheduler" />
<add key="quartz.scheduler.instanceName" value="RemoteServer" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz" />
<add key="quartz.scheduler.exporter.port" value="5656" />
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler" />
<add key="quartz.scheduler.exporter.channelType" value="tcp" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" />
<add key="quartz.jobStore.tablePrefix" value="qrtz_" />
<add key="quartz.jobStore.dataSource" value="db" />
<add key="quartz.dataSource.db.provider" value="SqlServer-20" />
<add key="quartz.dataSource.db.connectionString" value="Data Source=ServerA;Initial Catalog=dev;User ID=dev;Password=dev" />
<add key="quartz.jobStore.useProperties" value="true" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" />
</quartz>
ASP.NET 应用程序具有以下配置:
<quartz>
<add key="quartz.scheduler.instanceName" value="RemoteClient" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="5" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.scheduler.proxy" value="true" />
<add key="quartz.scheduler.proxy.address" value="tcp://ServerB:5656/QuartzScheduler" />
</quartz>
我已经尝试了很多方法。有时我会收到一条错误消息,指出调度程序已经存在,而不是问题标题中的调度程序。
我在其他地方读到,由于线程问题,我应该在单例中创建调度程序,我已经这样做了:
private static readonly ISchedulerFactory _schedulerFactory;
private static readonly IScheduler _scheduler;
static JobScheduleService() {
_schedulerFactory = new StdSchedulerFactory();
_scheduler = _schedulerFactory.GetScheduler();
}
public static IScheduler GetScheduler() {
return _scheduler;
}
我错过了什么? TIA
如果我在 Web 服务器上打开一个 telnet 框并连接到quartz 服务器,那么该服务肯定会响应。如果我输入几个字符,Quartz 就会出现错误。
这有帮助吗?即这不是连接问题?
I'm having trouble getting a client/server implementation of Quartz.NET working.
I have a SQL Server on ServerA, a server running Quartz as a service (ServerB) and a server which hosts an ASP.NET application (ServerC).
I have followed all the tutorials and delved into the code a fair amount but I can't see what I'm doing wrong. The server is definitely listening and I can see the port is open from ServerC. No firewalls involved.
ServerB, which is running the service included in the download package (Quartz.Server.Service) has the following config file settings:
<quartz>
<add key="quartz.server.serviceName" value="quartz" />
<add key="quartz.server.serviceDisplayName" value="Job Scheduler" />
<add key="quartz.scheduler.instanceName" value="RemoteServer" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz" />
<add key="quartz.scheduler.exporter.port" value="5656" />
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler" />
<add key="quartz.scheduler.exporter.channelType" value="tcp" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" />
<add key="quartz.jobStore.tablePrefix" value="qrtz_" />
<add key="quartz.jobStore.dataSource" value="db" />
<add key="quartz.dataSource.db.provider" value="SqlServer-20" />
<add key="quartz.dataSource.db.connectionString" value="Data Source=ServerA;Initial Catalog=dev;User ID=dev;Password=dev" />
<add key="quartz.jobStore.useProperties" value="true" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" />
</quartz>
The ASP.NET app has the following config:
<quartz>
<add key="quartz.scheduler.instanceName" value="RemoteClient" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="5" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.scheduler.proxy" value="true" />
<add key="quartz.scheduler.proxy.address" value="tcp://ServerB:5656/QuartzScheduler" />
</quartz>
I have tried numerous things. Occasionally I get an error that the scheduler already exists instead of the one in the question title.
I have read elsewhere that due to threading issues I should create the scheduler in a singleton, which I have done:
private static readonly ISchedulerFactory _schedulerFactory;
private static readonly IScheduler _scheduler;
static JobScheduleService() {
_schedulerFactory = new StdSchedulerFactory();
_scheduler = _schedulerFactory.GetScheduler();
}
public static IScheduler GetScheduler() {
return _scheduler;
}
What have I missed? TIA
If I open up a telnet box on the web server and connect to the quartz server then the service is definitely responding. If I type a few characters I get an error from Quartz.
Does this help? I.e. it's not a connectivity issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试不设置任何quartz.threadpool.xxxxxx 属性。
Try NOT setting any of the quartz.threadpool.xxxxxx properties.
事实证明,该错误消息只是有点误导。错误根本不在与服务器的通信中。问题是缺少 DLL 文件,该文件未作为部署的一部分进行复制。根本错误是由于调度程序无法找到 DLL。
It turns out that the error message is just a bit misleading. The error wasn't in the communication with the server at all. The problem was a missing DLL file that wasn't being copied as part of the deployment. The underlying error was due to the schedulers inability to find the DLL.