0 Replies Latest reply on Dec 1, 2017 12:41 PM by Matt Schultz

    Run 2 Instances of Wildfly as a Service on RHEL7

    Matt Schultz Newbie

      I have a domain managed instance of Wildfly 10.1 running as a service on RHEL7 using the init.d scripts. I would like to run a second domain manged instance of Wildfly with different ports on the same machine. We are trying to split up our applications into their own containers without having to manage more RHEL instances. I am also considering upgrading to Wildfly 11 basically using the same process of having 2 JVMs running simultaneous.

       

      The issue appears to be that wildfly will not respect the JBOSS_PIDFILE configuration. To keep my two instances separate, I named one service WIDLFLY and the second WIDLFRY. When I run WILDFLY, all works correctly. When I run WILDFRY, the service will not start because the PIDFILE does not exist (See RHEL systemctl output below). In my wildfly.conf, I have set (JBOSS_PIDFILE="/var/run/wildfry/wildfry.pid"). I have modified the init.d script directly to also reference the "wildfry.pid". In any case, the system still defaults to "/var/run/wildfly/wildfly.pid". I cannot find where to set this effectively. I see that the JVM starts fully otherwise based on the console logs, but since the PID file check is timing out, the JVM is forced to shutdown.

       

      wildfry.service - SYSV: WildFly startup script

         Loaded: loaded (/etc/rc.d/init.d/wildfry; bad; vendor preset: disabled)

         Active: failed (Result: timeout) since Fri 2017-12-01 11:23:52 CST; 19s ago

           Docs: man:systemd-sysv-generator(8)

        Process: 15233 ExecStop=/etc/rc.d/init.d/wildfry stop (code=exited, status=0/SUCCESS)

        Process: 15468 ExecStart=/etc/rc.d/init.d/wildfry start (code=exited, status=0/SUCCESS)

      Main PID: 13698

         CGroup: /system.slice/wildfry.service

                 ├─15485 /bin/sh /apps/wildfry/bin/domain.sh --domain-config=domain.xml --host-config=host.xml --properties=/etc/wildfry/wildfly.properties

                 ├─15584 /apps/java/bin/java -D[Process Controller] -server -Djava.net.preferIPv4Stack=true -Xms512m -Xmx1024m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=1024m -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+Use...

                 ├─15600 /apps/java/bin/java -D[Host Controller] -Dorg.jboss.boot.log.file=/apps/wildfry/domain/log/host-controller.log -Dlogging.configuration=file:/apps/wildfry/domain/configuration/logging.properties -server -Djava.net.pr...

                 └─15649 /apps/java/bin/java -D[Server:sit-server-two-15] -Xms256m -Xmx1024m -agentlib:jdwp=transport=dt_socket,address=18787,server=y,suspend=n -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djboss.bind.address=1...

       

       

      Dec 01 11:18:52 Consortiex-VM15.redplaid.com systemd[1]: Starting SYSV: WildFly startup script...

      Dec 01 11:18:52 Consortiex-VM15.redplaid.com runuser[15483]: pam_unix(runuser:session): session opened for user appuser by (uid=0)

      Dec 01 11:18:52 Consortiex-VM15.redplaid.com runuser[15483]: pam_unix(runuser:session): session closed for user appuser

      Dec 01 11:18:52 Consortiex-VM15.redplaid.com wildfry[15468]: Starting wildfry: /

      Dec 01 11:19:01 Consortiex-VM15.redplaid.com wildfry[15468]: [  OK  ]

      Dec 01 11:19:01 Consortiex-VM15.redplaid.com systemd[1]: PID file /var/run/wildfly/wildfly.pid not readable (yet?) after start.

      Dec 01 11:23:52 Consortiex-VM15.redplaid.com systemd[1]: wildfry.service start operation timed out. Terminating.

      Dec 01 11:23:52 Consortiex-VM15.redplaid.com systemd[1]: Failed to start SYSV: WildFly startup script.

      Dec 01 11:23:52 Consortiex-VM15.redplaid.com systemd[1]: Unit wildfry.service entered failed state.

      Dec 01 11:23:52 Consortiex-VM15.redplaid.com systemd[1]: wildfry.service failed.

       

      Thank you everyone in advance.