How-To: Migrating from server.jar to Launcher Startup

LogScale's previous deployment and startup model required starting the server.jar directly with the required options. This model has been updated and there is now a launcher script, humio-server-start.sh that automatically configures reasonable defaults for memory, as a starting point for tuning for your specific environment.

Verifying if a migration is required:

In a LogScale/Humio terminal, open the service file: /etc/systemd/system/humio.service and see if your ExecStart section contains humio-server-start.sh.

  • If it exists, you can skip reading this KB article further.

  • If it contains server.jar, use the steps below to switch.

    If you have deployed a multi node setup, follow the below steps in every single node.

Migration Guide

  1. Find the version of LogScale that is running on the node and download the respective version in tarball format from the Maven repository

  2. Extract the file under /opt/humio directory (the same directory where you have your current server.jar).

    shell
    $ cd /opt/humio/
    $ wget https://repo.humio.com/repository/maven-releases/com/humio/server/1.136.0/server-1.136.0.tar.gz
    $ tar xzf /opt/humio/server-1.136.0.tar.gz
  3. Change the permission of this humio directory to the humio user and group.

    shell
    $ chown -R humio:humio /opt/humio/humio
  4. Open /etc/systemd/system/humio.serviceand identify the following line

    Current old value that uses server.jar to start

    shell
    ExecStart=/usr/bin/java -server \
         -XX:+UseParallelOldGC -Xms4G -Xmx32G
         -XX:MaxDirectMemorySize=8G -Xss2M \
         --add-exports java.base/jdk.internal.util=ALL-UNNAMED \
         -XX:CompileCommand=dontinline,com/humio/util/HotspotUtilsJ.dontInline \
         -Xlog:gc*,gc+jni=debug:file=/var/log/humio/gc_humio.log:time,tags:filecount=5,filesize=102400 \
         -Dhumio.auditlog.dir=/var/log/humio \
         -Dhumio.debuglog.dir=/var/log/humio -jar /opt/humio/server.jar

    Note

    The above may be on one line, or may be spread over multiple lines.

    Replace it with the below line as detailed in Setting Up a Service

    New value that uses startup script will look like this

    shell
    ExecStart=/opt/humio/humio/bin/humio-server-start.sh
  5. If you have configured custom JVM flags in humio service, it is not necessary to set most of the old flags anymore. This is because the launcher script will figure out reasonable defaults for most of it. In order to check what flags the launcher script suggests for a given host environment, you may run the below command or add DRY_RUN=true as an environment variable as detailed in Launcher Script.

    shell
    $ DRY_RUN=true /opt/humio/humio/bin/humio-server-start.sh

    However, you may add them explicitly in /etc/humio/server.conf. A few of the old flags should not be set by users, so they are not moved to this file.

    ini
    HUMIO_OPTS=-Dhumio.auditlog.dir=/var/log/humio -Dhumio.debuglog.dir=/var/log/humio
    HUMIO_JVM_LOG_OPTS=-Xlog:gc*,gc+jni=debug:file=/var/log/humio/gc_humio.log:time,tags:filecount=5,filesize=102400

    Alternatively, the values can be added to HUMIO_JVM_ARGS in server.conf:

    ini
    HUMIO_JVM_ARGS=-XX:+UseParallelOldGC -Xms4G -Xmx32G -XX:MaxDirectMemorySize=8G -Xss2M --add-exports java.base/jdk.internal.util=ALL-UNNAMED -XX:CompileCommand=dontinline,com/humio/util/HotspotUtilsJ.dontInline -Xlog:gc*,gc+jni=debug:file=/var/log/humio/gc_humio.log:time,tags:filecount=5,filesize=102400 -Dhumio.auditlog.dir=/var/log/humio -Dhumio.debuglog.dir=/var/log/humio

    Using HUMIO_JVM_ARGS disables most of the automation in the launcher script, and just passes through the flags that have been set. It is recommend that you try the automation provided in the script before deciding to use HUMIO_JVM_ARGS.

    Important

    Once you confirm that everything is working as expected, it is recommended to remove /opt/humio/server.jar and /opt/humio/server-1.136.0.jar to avoid any confusion in future as they are no longer necessary.