当前位置: 首页 > 知识库问答 >
问题:

在运行多个Payara域时,如何防止服务器重启时出现争用情况?

汪胡非
2023-03-14

我试图在每台视窗2019服务器上运行4个Payara域(我也有几个在2016年运行)。我现在只能使用Payara5.1.9.1或5.1.9.4,因为我托管的这个特定应用程序的两个版本支持这两个。我每个域只部署了一个应用程序。

Payara域配置为视窗服务,设置为网络服务运行。我将两个生产域设置为立即启动,将两个测试域设置为使用视窗服务启动选项中的“延迟启动”启动。

在这种环境下,服务器计划每周日自动运行窗口更新,必要时在凌晨3点左右重新启动。我的问题是,当服务器重新启动更新时,可能每个服务器上只有一两个域会出现。在将两个测试域设置为延迟启动之前,通常没有一个域会出现。或者只有四分之一会出现。

每台服务器有两个核心和12 GB RAM。这些是我从警察局得到的记录,所以我承认我不确定这是否足够,我只是在用他们说的话。CPU在启动域的过程中是固定的,但在运行应用程序的时候似乎是正常的。即使我一次只启动一个域,它仍然会尖峰/钉住,但如果我试图非常接近地启动两个或更多个域,情况就不会那么糟糕了。

Windows服务错误是这样的:子进程[4120-D:/…/payara/194/payara5/glassfish/lib/nadmin.bat start domain--watchdog--domaindir D:\…\payara\domains(域名)]以1结尾

所以即使只是试图同时启动两个域也太过分了。我完全承认对Payara不熟悉,所以也许我在问为什么水是湿的,但是...为什么我不能在服务器重新启动时让它们都启动呢?域内是否有我需要的配置选项来让它们很好地运行?在一台服务器上运行四个Payara域是个坏主意吗?

为什么每个Payara域需要这么长时间才能启动?这四个域启动和加载应用程序可能需要10分钟,有时还需要一两分钟才能加载允许我登录应用程序的所有组件。在另一台类似的服务器上,使用Payara5.1.7.1不同的应用程序,从重新启动服务器到启动所有域并加载应用程序(该服务器上只有3个域)几乎需要15分钟。

我是不是对我所要做的事情极度缺乏动力?我是不是在尝试做一些不适合我的事情?我只是在配置中遗漏了一些明显的东西吗?

编辑

如果没有在域中部署任何应用程序,并且所有4个服务都设置为自动(无延迟),当我重新启动服务器时,我仍然会得到一个没有出现的域。这是其中的错误。我将再重新启动几次,看看它是否能持续这样做。

[2020-06-21T17:35:20.612-0400] [Payara 5.194] [SEVERE] [NCLS-CORE-00016] [javax.enterprise.system.core] [tid: _ThreadID=24 _ThreadName=RunLevelControllerThread-1592775310830] [timeMillis: 1592775320612] [levelValue: 1000] [[
  Startup service failed to start
MultiException stack 1 of 2
java.lang.IllegalStateException: Payara Microprofile Config needs running server environment to work. Either it's not running, or you're experiencing a race condition
    at fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverSync.await(ConfigProviderResolverSync.java:55)
    at fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverSync.getConfig(ConfigProviderResolverSync.java:77)
    at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:93)
    at fish.payara.microprofile.healthcheck.HealthCheckService.postConstruct(HealthCheckService.java:119)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1268)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:309)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:351)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
MultiException stack 2 of 2
java.lang.IllegalStateException: Unable to perform operation: post construct on fish.payara.microprofile.healthcheck.HealthCheckService
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:369)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
]]

[2020-06-21T17:35:20.952-0400] [Payara 5.194] [INFO] [] [javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775320952] [levelValue: 800] [[
  JTS5014: Recoverable JTS instance, serverId=[100]]]

[2020-06-21T17:35:21.633-0400] [Payara 5.194] [WARNING] [] [org.glassfish.grizzly.config.GenericGrizzlyListener] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775321633] [levelValue: 900] [[
  Unable to construct HTTP/2 Addon
java.lang.NoClassDefFoundError: org/glassfish/grizzly/npn/AlpnServerNegotiator
    at org.glassfish.grizzly.config.GenericGrizzlyListener.configureHttp2Support(GenericGrizzlyListener.java:806)
    at org.glassfish.grizzly.config.GenericGrizzlyListener.configureHttpProtocol(GenericGrizzlyListener.java:782)
    at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.configureHttpProtocol(GlassfishNetworkListener.java:212)
    at org.glassfish.grizzly.config.GenericGrizzlyListener.configureSubProtocol(GenericGrizzlyListener.java:456)
    at org.glassfish.grizzly.config.GenericGrizzlyListener.configureProtocol(GenericGrizzlyListener.java:445)
    at org.glassfish.grizzly.config.GenericGrizzlyListener.configure(GenericGrizzlyListener.java:341)
    at com.sun.enterprise.v3.services.impl.GrizzlyProxy.initialize(GrizzlyProxy.java:126)
    at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:664)
    at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:586)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:303)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:351)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneLevel.run(CurrentTaskFuture.java:762)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.glassfish.grizzly.npn.AlpnServerNegotiator
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:1179)
    at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1618)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1548)
    at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 23 more
]]

[2020-06-21T17:35:22.408-0400] [Payara 5.194] [INFO] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775322408] [levelValue: 800] [[
  Network Listener http-listener-1 started in: 732ms - bound to [/0.0.0.0:21080]]]

[2020-06-21T17:35:22.409-0400] [Payara 5.194] [INFO] [NCLS-CORE-00058] [javax.enterprise.system.core] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775322409] [levelValue: 800] [[
  Network listener http-listener-2 on port 21081 disabled per domain.xml]]

[2020-06-21T17:35:22.426-0400] [Payara 5.194] [WARNING] [] [org.glassfish.grizzly.config.GenericGrizzlyListener] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775322426] [levelValue: 900] [[
  HTTP/2 (enabled by default) is unsupported with port unification and will be disabled for network listener admin-listener.]]

[2020-06-21T17:35:23.631-0400] [Payara 5.194] [INFO] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775323631] [levelValue: 800] [[
  Network Listener admin-listener started in: 1,194ms - bound to [/0.0.0.0:21048]]]

[2020-06-21T17:35:23.633-0400] [Payara 5.194] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1592775310829] [timeMillis: 1592775323633] [levelValue: 800] [[
  Grizzly 2.4.3 started in: 8,174ms - bound to [http-listener-1:21080, admin-listener:21048]]]

[2020-06-21T17:35:24.106-0400] [Payara 5.194] [SEVERE] [NCLS-CORE-00014] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1592775324106] [levelValue: 1000] [[
  Shutdown required
MultiException stack 1 of 1
MultiException stack 1 of 2
java.lang.IllegalStateException: Payara Microprofile Config needs running server environment to work. Either it's not running, or you're experiencing a race condition
    at fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverSync.await(ConfigProviderResolverSync.java:55)
    at fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverSync.getConfig(ConfigProviderResolverSync.java:77)
    at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:93)
    at fish.payara.microprofile.healthcheck.HealthCheckService.postConstruct(HealthCheckService.java:119)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1268)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:309)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:351)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
MultiException stack 2 of 2
java.lang.IllegalStateException: Unable to perform operation: post construct on fish.payara.microprofile.healthcheck.HealthCheckService
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:369)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)
    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
]]

[2020-06-21T17:35:24.110-0400] [Payara 5.194] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1592775324110] [levelValue: 1000] [[
  Failed to start, exiting]]

[2020-06-21T17:35:24.118-0400] [Payara 5.194] [INFO] [] [] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1592775324118] [levelValue: 800] [[
  FileMonitoring shutdown]]

[2020-06-21T17:35:24.564-0400] [Payara 5.194] [INFO] [] [org.hibernate.validator.internal.util.Version] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1592775324564] [levelValue: 800] [[
  HV000001: Hibernate Validator 6.0.16.Final]]

[2020-06-21T17:35:26.944-0400] [Payara 5.194] [WARNING] [] [fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverImpl] [tid: _ThreadID=29 _ThreadName=payara-executor-service-task] [timeMillis: 1592775326944] [levelValue: 900] [[
  Timeout out waiting for Microprofile Config startup
java.lang.IllegalStateException: Payara Microprofile Config needs running server environment to work. Either it's not running, or you're experiencing a race condition
    at fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverSync.await(ConfigProviderResolverSync.java:55)
    at fish.payara.nucleus.microprofile.config.spi.ConfigProviderResolverSync.getConfig(ConfigProviderResolverSync.java:77)
    at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:93)
    at org.eclipse.microprofile.metrics.MetricID.<init>(MetricID.java:121)
    at fish.payara.microprofile.metrics.impl.MetricRegistryImpl.register(MetricRegistryImpl.java:314)
    at fish.payara.microprofile.metrics.jmx.MBeanMetadataHelper.registerMetadata(MBeanMetadataHelper.java:118)
    at fish.payara.microprofile.metrics.MetricsService.initMetadataConfig(MetricsService.java:241)
    at fish.payara.microprofile.metrics.MetricsService.bootstrap(MetricsService.java:453)
    at fish.payara.microprofile.metrics.MetricsService.lambda$init$0(MetricsService.java:144)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
]]

共有1个答案

邵捷
2023-03-14

我面临着一个类似的问题,在我的情况下,我必须删除热交换库才能再次运行服务器,它只是从一天到下一天停止工作。我还注意到域中的变化。xml,我没有这么做。

<context-service object-type="system-all" jndi-name="concurrent/__defaultContextService"></context-service>
<managed-thread-factory object-type="system-all" jndi-name="concurrent/__defaultManagedThreadFactory"></managed-thread-factory>

<resource-ref ref="concurrent/__defaultContextService"></resource-ref>
<resource-ref ref="concurrent/__defaultManagedThreadFactory"></resource-ref>

<microprofile-openapi-configuration></microprofile-openapi-configuration>
<ejb-container>
  <ejb-timer-service></ejb-timer-service>
</ejb-container>
<rest-config></rest-config>
<environment-warning-configuration></environment-warning-configuration>
<cdi-service></cdi-service>
<jdbc-config-source-configuration></jdbc-config-source-configuration>

我有2个Payaras(4.1.2和5.2021),都抛出相同的错误

 类似资料:
  • 问题内容: 我正在尝试使用mgo将objectid字符串转换为bson ObjectId格式, idk为什么,但是如果我输入了错误/无效的输入字符串,我的应用程序就会出现运行时恐慌 我该如何预防呢?谢谢 问题答案: 文档,如果您传递无效的对象ID将恐慌: ObjectIdHex从提供的十六进制表示形式返回ObjectId。 以无效的十六进制表示形式调用此函数将导致运行时恐慌。 请参见IsObjec

  • 这是控制台中打印的日志。 当我创建一个名为entity的包并在应用程序中添加一些配置时,错误就出现了。yml公司 application.yml长这样 我尝试使用“mvn干净安装”重建项目,我尝试从maven依赖项中删除所有*. jar,并使用maven funcion的“更新项目”。 我的pom。xml如下所示: 我是Springmvc、maven和Spring靴的新手。任何帮助都将非常感谢。

  • 问题内容: 众所周知,许多Android应用在首次聚焦之前都会非常短暂地显示白屏。在以下情况下会出现此问题: 扩展全局类并在其中执行主要初始化的Android应用。该 对象总是在第一个对象之前创建(这可以在调试器中观察到),因此这很有意义。这是我的案件延误的原因。 在初始屏幕之前显示默认预览窗口的Android应用。 设置显然在这里不起作用。我也无法将初始屏幕的父主题设置为此处所述,因为[不幸的是

  • 我希望payara服务器作为服务运行。我以sudo的身份登录asadmin,并使用create-service命令。给出了以下输出。 这将在 /etc/init.d/ 文件夹中创建payara_production脚本,但一旦重新启动计算机,就不会执行此脚本。我必须手动启动payara才能运行它。 “您已经创建了服务,但是您需要自己启动它”是什么意思,我在之前使用的GlassFish版本中没有类似

  • 我有一个Dockerfile来在容器中安装MySQL server,然后我这样开始: 但MySQL服务不会自动启动,我必须手动运行(从容器内): 如何在运行docker容器时自动启动MySQL服务?

  • 问题内容: 我有一个Dockerfile将MySQL服务器安装在一个容器中,然后我开始像这样: 但是MySQL服务不会自动启动,我必须手动运行(从容器内部): 运行docker容器时如何自动启动MySQL服务? 问题答案: 首先,有一个 问题, 在您的: Docker映像不会保存正在运行的进程。因此,您的命令仅在阶段执行,并在构建完成后停止。相反,您需要使用或如下所示的命令在启动容器时指定命令: