0 Replies Latest reply on Aug 21, 2017 9:24 PM by zhou long'fei

    how to restart host-controller in domain mode efficiently without risks?

    zhou long'fei Newbie

      My companay uses wildfly 8.1.0.Final for middleware and the production system mode is in domain.


      For some reason we have to restart the host-controller before auto-deploy.

      To resolve this, my workmates always take two ways:

      1. kill all java processes , and run the $wildfly_home/start.sh

          In this way all processes are restarted, but it really takes long.

      2. use cli to restart the host-controller with the command: "shutdown --host=master --restart=true" .

          This is the common way in out auto-deploy scripts, but takes long either.


      Then I was wondering how to restart host-controller only without restarting any other processes.

      Finally I tried out one solution: kill -9 <host-controller pid>    (the host-controller process is terminated and the process-controller process forks a new one to take the place of it.)

      In this way I successfully restarted the host-controller and I've got "--process-restarted" as a flag for it.


      before restart:

      502        454   438  0 19:06 pts/0    00:00:05 /opt/jboss/java64/jdk1.7.0_25/bin/java -D[Host Controller] -Dorg.jboss.boot.log.file=/opt/jboss/domain/log/host-controller.log -Dlogging.configuration=file:/opt/jboss/domain/configuration/logging.properties -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -jar /opt/jboss/jboss-modules.jar -mp /opt/jboss/modules org.jboss.as.host-controller -mp /opt/jboss/modules --pc-address --pc-port 43456 -default-jvm /opt/jboss/java64/jdk1.7.0_25/bin/java --backup -Djboss.home.dir=/opt/jboss


      kill -9 454


      after restart:

      502       1080   438 99 19:16 pts/0    00:00:05 /opt/jboss/java64/jdk1.7.0_25/bin/java -D[Host Controller] -Dorg.jboss.boot.log.file=/opt/jboss/domain/log/host-controller.log -Dlogging.configuration=file:/opt/jboss/domain/configuration/logging.properties -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -jar /opt/jboss/jboss-modules.jar -mp /opt/jboss/modules org.jboss.as.host-controller -mp /opt/jboss/modules --pc-address --pc-port 43456 -default-jvm /opt/jboss/java64/jdk1.7.0_25/bin/java --backup -Djboss.home.dir=/opt/jboss --process-restarted


      I've used this way for several weeks and it seems to work well. So I discussed with my workmates if we could rewrite this restart logic for deploy.

      But they wonder if the process-controller will fail to fork a new Host Controller.  Will it happen?


      Could any one please tell me if this way have any risk?

      If don't could I use it in the auto-deploy scripts?