Using Services

View as Markdown

HEAVY.AI features two system services: heavydb and heavy_web_server. You can start these services individually using systemd.

Starting and Stopping HeavyDB Using systemd

For permanent installations of HeavyDB, HEAVY.AI recommends that you use systemd to manage HeavyDB services. systemd automatically handles tasks such as log management, starting the services on restart, and restarting the services if there is a problem.

In addition, systemd manages the open-file limit in Linux. Some cloud providers and distributions set this limit too low, which can result in errors as your HEAVY.AI environment and usage grow. For more information about adjusting the limits on open files, see Why am I seeing the error “Too many open files…erno24” in the Troubleshooting and Monitoring Solutions section of our knowledgebase.

Initial Setup

You use the install_heavy_systemd.sh script to prepare systemd to run HEAVY.AI services. The script asks questions about your environment, then installs the systemd service files in the correct location. You must run the script as the root user so that the script can perform tasks such as creating directories and changing ownership.

$cd $HEAVYAI_PATH/systemd
$sudo ./install_heavy_systemd.sh

The install_heavy_systemd.sh script asks for the information described in the following table.

VariableUseDefaultNotes
HEAVYAI_PATHPath to HeavyDB installation directoryCurrent install directoryHEAVY.AI recommends heavyai as the install directory.
HEAVYAI_BASEPath to the storage directory for HeavyDB data and configuration filesheavyaiMust be dedicated to HEAVY.AI. The installation script creates the directory HEAVYAI_STORAGE/data,generatesanappropriateconfigurationfile,andsavesthefileasHEAVYAI\_STORAGE/data, generates an appropriate configuration file, and saves the file as HEAVYAI_STORAGE/heavy.conf.
HEAVYAI_USERUser HeavyDB is run asCurrent userUser must exist before you run the script.
HEAVYAI_GROUPGroup HeavyDB is run asCurrent user’s primary groupGroup must exist before you run the script.

Starting HeavyDB Using systemd

To manually start HeavyDB using systemd, run:

$sudo systemctl start heavydb
$sudo systemctl start heavy_web_server

Restarting HeavyDB Using systemd

You can use systemd to restart HeavyDB — for example, after making configuration changes:

$sudo systemctl restart heavydb
$sudo systemctl restart heavy_web_server

Stopping HeavyDB Using systemd

To manually stop HeavyDB using systemd, run:

$sudo systemctl stop heavydb
$sudo systemctl stop heavy_web_server

Enabling HeavyDB on Startup

To enable the HeavyDB services to start on restart, run:

$sudo systemctl enable heavydb
$sudo systemctl enable heavy_web_server

Using Configuration Parameters

You can customize the behavior of your HEAVY.AI servers by modifying your heavy.conf configuration file. See Configuration Parameters.