远程连接到Quartz调度 [英] Remotely connect to Quartz Scheduler
问题描述
我试图连接到Quartz调度远程,这样我就可以得到被调度运行的作业列表。在服务器应用程序我用下面的code:
I am trying to connect to the Quartz scheduler remotely, so I can get a list of jobs that are scheduled to run. On the server application I used the below code:
NameValueCollection properties = new NameValueCollection();
properties.Add("quartz.scheduler.instanceName", "OlScheduler");
properties.Add("quartz.scheduler.instanceId", "Ol");
properties.Add("quartz.threadPool.type", "Quartz.Simpl.SimpleThreadPool, Quartz");
properties.Add("quartz.threadPool.threadCount", "5");
properties.Add("quartz.threadPool.threadPriority", "Normal");
properties.Add("quartz.scheduler.registryPort", "1099");
properties.Add("quartz.scheduler.rmi.export", "true");
properties.Add("quartz.scheduler.rmi.registryHost", "localhost");
properties.Add("quartz.scheduler.rmi.registryPort", "1099");
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();
和安装并运行它作为一个服务,然后再从另一个应用程序我用远程连接到它:
and install and run it as a service, then to connect remotely to it from another application I used:
properties["quartz.scheduler.instanceName"] = "RemoteClient";
properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";
properties["quartz.scheduler.proxy"] = "true";
properties["quartz.scheduler.proxy.address"] = "http://170.20.20.17:1099/OIService";
IScheduler sched = new StdSchedulerFactory(properties).GetScheduler();
这是我得到的错误是:
无法连接到远程服务器和无连接可以作出,因为目标机器积极地拒绝它172.22.22.17:1099
我错过了什么?我使用Quartz.net版本1.1 RamJobStore和我的防火墙是关闭的。
我认为这是我现在用的是错误的端口。任何帮助AP preciated
The error that I get is: "Unable to connect to the remote server" and "No connection could be made because the target machine actively refused it 172.22.22.17:1099" What did I miss? I am using Quartz.net version 1.1 with RamJobStore and my firewall is off. I think that's the port which I am using the wrong one. Any help is appreciated
推荐答案
免责声明:我不知道Quartz调度的东西! :)
disclaimer: I don't know anything about Quartz Scheduler! :)
不过,如果你怀疑你可能有错误的端口号,如果您可以登录到远程服务器,并在命令行中运行
However, if you suspect you might have the wrong port number, if you can log into the remote server and run from a command line
netstat -b
这将会打印出是由过程使用的端口。希望这将让你验证的端口号。
This will print out the ports that are in use by process. Hopefully that will allow you to verify the port number.
如果端口号是正确的,但你仍然无法与远程服务器通信,你可以尝试几件事情:
If the port number is correct, but you still can't communicate with the remote server you can try a couple of things:
- 运行
ping.exe的[xxx.xxx.xxx.xxx]
在命令行中,看看远程服务器响应(*) - 验证远程服务器上的防火墙具有Quartz调度过程中的异常
- 尝试运行
tracert命令[xxx.xxx.xxx.xxx]
来看看,如果你有两个服务器之间的路由
- run
ping.exe [xxx.xxx.xxx.xxx]
from the command line to see if remote server responds(*) - verify the firewall on remote server has an exception for the Quartz Scheduler process
- try running
tracert [xxx.xxx.xxx.xxx]
to see if you have a route between the two servers
(*)这并不总是确凿作为远程服务器,或者在中间网络硬件,可能被配置为不响应
(*) this is not always conclusive as the remote server, or networking hardware in the middle, might be configured not to respond.
这篇关于远程连接到Quartz调度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!