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, 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

  • 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).

    The name used for the package depends on the version:

    • Up to 1.137.0, the file name used was server-1.147.0.tar.gz

    • From 1.138.0, use either server-linux_x64-1.147.0.tar.gz (for glibc based Linux distributions) or server-alpine_x64-1.147.0.tar.gz (for musl libc distributions).

    $ cd /opt/humio/
    $ wget
    $ tar xzf /opt/humio/server-1.147.0.tar.gz
  3. Change the permission of this humio directory to the humio user and group.

    $ 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

    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


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

    Replace it with the below line as detailed in Configuring LogScale as a Service

    New value that uses startup script will look like this

  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 LogScale Launcher Script.

    $ DRY_RUN=true /opt/humio/humio/bin/

    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.

    HUMIO_OPTS=-Dhumio.auditlog.dir=/var/log/humio -Dhumio.debuglog.dir=/var/log/humio

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

    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 -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.


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