我开发了一个运行计划作业的Quartz.Net窗口服务,并为其设置了一个SQLite作业存储库。以下是我的AdoJobStore设置
# SQLite settings
quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
quartz.jobStore.misfireThreshold = 60000
quartz.jobStore.lockHandler.type = Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz
quartz.jobStore.useProperties = true
quartz.jobStore.dataSource = default
quartz.jobStore.tablePrefix = qrtz_
quartz.jobStore.driverDelegateType = Quartz.Impl.AdoJobStore.SQLiteDelegate, Quartz
quartz.dataSource.default.provider = SQLite-10
quartz.dataSource.default.connectionString = Data Source=.\jobs.db;Version=3在让你头疼之前,我应该说这是一个有效的解决方案!这意味着这个职业商店运作得很好!每个作业包括运行一个.exe文件,该文件将使用存储在文本文件中的连接字符串从SQL Server数据库获取参数。
因此,如果服务是自动启动的,那么一切都正常。
安装Windows服务后,我们给它一个用户名,它可以访问服务的“登录”选项卡中的目标数据库。我们将服务设置为自动启动(并尝试了自动延迟模式)。在服务的恢复选项卡中,我们还命令它重新启动,以防它崩溃。
然而,这项服务似乎并不是单独在一些机器上启动的,这让我想了好一阵子。在出现故障的机器上,当服务无法启动时,这就是我的服务记录的内容:
2015-02-13 15:09:15,674 [1] ERROR Quartz.Server.QuartzServer [(null)] - Server initialization failed:Unable to bind scheduler to remoting.
Quartz.SchedulerException: Unable to bind scheduler to remoting. ---> System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
at Quartz.Simpl.RemotingSchedulerExporter.RegisterRemotingChannelIfNeeded()
at Quartz.Simpl.RemotingSchedulerExporter.Bind(IRemotableQuartzScheduler scheduler)
at Quartz.Core.QuartzScheduler.Bind()
at Quartz.Core.QuartzScheduler.Initialize()
--- End of inner exception stack trace ---
at Quartz.Core.QuartzScheduler.Initialize()
at Quartz.Impl.StdSchedulerFactory.Instantiate()
at Quartz.Impl.StdSchedulerFactory.GetScheduler()
at Quartz.Server.QuartzServer.Initialize() [See nested exception: System.Net.Sockets.SocketException (0x80004005): No such host is known
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
at Quartz.Simpl.RemotingSchedulerExporter.RegisterRemotingChannelIfNeeded()
at Quartz.Simpl.RemotingSchedulerExporter.Bind(IRemotableQuartzScheduler scheduler)
at Quartz.Core.QuartzScheduler.Bind()
at Quartz.Core.QuartzScheduler.Initialize()]该服务安装在主机127.0.0.1端口555上,似乎不需要依赖项,因为它可以在其他机器上工作。
我有一种感觉,即在访问数据库之前或在TCP主机建立之前,该服务正试图启动自己。但是如果是这样的话,为什么它会在其他设备上工作呢?
我以前也问过同样的问题,但没有找到一个有效的答案。非常感谢来自Quartz.Net开发团队或Windows专家的任何帮助。
发布于 2015-02-25 14:35:38
免责声明。我不是Windows团队的成员,也不是Quartz.net服务方面的专家
该服务安装在主机127.0.0.1端口555上,似乎不需要依赖关系,因为它在其他一些机器上工作。
你的推理是错误的。可能是所需的服务--仅仅是--总是在其他机器上启动,但是如果不设置依赖项,就不能保证这一点。
因此,由于您收到了DNS错误,我建议您从设置服务开始,它依赖于Dnscache和Tcpip。
https://stackoverflow.com/questions/28673064
复制相似问题