Skip to main content

How to install AIQ as a service in Linux

The etc/rc.local method should NOT be used as it will use the default 1024 limit for open file handles which is too low.

systemctl is a command-line utility used to interact with the systemd system and service manager. It allows you to manage and control system services and units.

Here are some of the key functions you can perform with systemctl:

  • Start a service: systemctl start [service_name]

  • Stop a service: systemctl stop [service_name]

  • Restart a service: systemctl restart [service_name]

  • Check the status of a service: systemctl status [service_name]

  • Enable a service to start at boot: systemctl enable [service_name]

  • Disable a service from starting at boot: systemctl disable [service_name]

  • Reload a service’s configuration: systemctl reload [service_name]

Steps:

  1. Download and extract the aiq distribution zip file to aiq_distribution into the /opt/aiq/aiq_distribution folder.

  2. Make sure the aiq_distribution folder has the execution flag turned on using the command : chmod -R +x aiq_distribution

  3. Make sure that you download a recent GraalVM JDK 11 version with a command like:
    cd /opt
    wget https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-amd64-22.3.3.tar.gz


    You can unpack the above file using:
    tar -xzf graalvm-ce-java11-linux-amd64-22.3.3.tar.gz

  4. Enable the graalvm javascript engine executing the command:
    cd /opt/graalvm-ce-java1-22.3.3/bin
    ./gu install js

  5. As the root user, create a text file named appvance.service inside the folder /etc/systemd/system.
    Note that the ‘User’ value of ec2-user applies to Amazon Linux, this should be changed to ubuntu for Ubuntu OS. Validate that PATH and JAVA_HOME are set to the right graalvm path.
    Example file: /etc/systemd/system/appvance.service

    [Unit]
    Description=Start Appvance IQ services
    After=syslog.target
    [Service]
    Environment=PATH=/opt/graalvm-ce-java11-22.3.3/bin:/sbin:/bin:/usr/sbin:/usr/bin
    Environment=JAVA_HOME=/opt/graalvm-ce-java11-22.3.3
    User=ec2-user
    Type=simple
    LimitNOFILE=10000000
    LimitNPROC=20000
    ExecStart=/bin/bash /opt/aiq/aiq_distribution/TestNode/startup.sh
    WorkingDirectory=/opt/aiq/aiq_distribution/TestNode
    TimeoutStartSec=0
    [Install]
    WantedBy=multi-user.target
  6. Execute the following commands as root user to have the appvance.service file enabled to start at boot:
    systemctl daemon-reload
    systemclt enable appvance

  7. Once above steps have been completed, AppvanceIQ will automatically start when the instances is rebooted.


Last updated: September 24, 2024

If you have any feedback on this topic, please contact us at documentation@appvance.ai