远程连接到 Quartz Scheduler

发布于 2024-08-05 13:14:22 字数 1566 浏览 2 评论 0原文

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

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

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

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

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

发布评论

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

评论(2

人间不值得 2024-08-12 13:14:22

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

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

netstat -b

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

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

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

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

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.

无敌元气妹 2024-08-12 13:14:22

你有不止一个问题。

  1. 客户端和服务器端的实例名称必须相同。
    属性["quartz.scheduler.instanceName"] = "RemoteClient";
  2. 双属性.Add("quartz.scheduler.rmi.registryPort", "1099");
    (这不是问题,但可以删除。)

You have more than one problem.

  1. Instance name must be same on client and server side.
    properties["quartz.scheduler.instanceName"] = "RemoteClient";
  2. Double properties.Add("quartz.scheduler.rmi.registryPort", "1099");
    (it's not problem, but can be removed.)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文