1

我正在尝试远程连接到 Quartz 调度程序,因此我可以获得计划运行的作业列表。在服务器应用程序上,我使用了以下代码:

    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(); 

并将其作为服务安装并运行,然后从我使用的另一个应用程序远程连接到它:

    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”我错过了什么?我正在使用带有 RamJobStore 的 Quartz.net 1.1 版,并且我的防火墙已关闭。我认为那是我使用错误的端口。任何帮助表示赞赏

4

1 回答 1

3

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:

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

于 2009-09-28T21:38:46.640 回答