【问题标题】:Remotely connect to Quartz Scheduler远程连接到 Quartz Scheduler
【发布时间】:2009-09-28 17:22:52
【问题描述】:

我正在尝试远程连接到 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 版,并且我的防火墙已关闭。 我认为那是我使用错误的端口。任何帮助表示赞赏

【问题讨论】:

    标签: asp.net quartz-scheduler


    【解决方案1】:

    免责声明:我对 Quartz Scheduler 一无所知! :)

    但是,如果您怀疑自己的端口号错误,如果您可以登录远程服务器并从命令行运行

    netstat -b
    

    这将打印出进程正在使用的端口。希望这将允许您验证端口号。

    如果端口号正确,但您仍然无法与远程服务器通信,您可以尝试以下方法:

    • 从命令行运行ping.exe [xxx.xxx.xxx.xxx]查看远程服务器是否响应(*)
    • 验证远程服务器上的防火墙是否存在 Quartz 调度程序进程异常
    • 尝试运行 tracert [xxx.xxx.xxx.xxx] 以查看两台服务器之间是否有路由

    (*) 这并不总是决定性的,因为远程服务器或中间的网络硬件可能被配置为不响应。

    【讨论】:

      猜你喜欢
      • 2016-06-16
      • 1970-01-01
      • 1970-01-01
      • 2017-08-12
      • 2012-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多