-
Notifications
You must be signed in to change notification settings - Fork 4
Deployment on RHEL based distro
-
Make sure you have
mysqlinstalled and setup on your system. If not, you can getmysqlusing package manager, and follow the setup instructions given on the official documentation.# dnf install community-mysql-server -
Download the file 01_init.sql from the budlib-api repository, and execute it.
$ mysql -u root -h localhost -p > source 01_init.sql > exit -
Enable the
mysqlserver to run on startup# systemctl enable mysqld.service
-
Make sure you have
jdkinstalled and setup on your system. If not, you can getjdkfrom https://adoptium.net/temurin/releases. -
Download the latest JAR of budlib-api from https://github.com/budlib/budlib-api/releases into your system, and put it in the below location.
/usr/local/bin/budlib-api/api-<version>.jar -
Create a script that would run the downloaded JAR file
# touch /usr/local/bin/budlib-api.sh # chmod +x /usr/local/bin/budlib-api.sh -
Add the following content in the file created in Step 3. Make sure to update the path to your installed
jdkin the below content (jdkpath our case the path is/opt/jdk-11.0.11+9/bin)#!/bin/bash export PATH="${PATH}:/opt/jdk-11.0.11+9/bin" nohup `which java` -jar /usr/local/bin/budlib-api/api-<version>.jar -
Create a service file for the budlib-api, that would run the API on system start-up
# touch /etc/systemd/system/budlib-api.service -
Add the content in the file created in Step 5, as shown:
[Unit] Description=REST API for BudLib Wants=network.target mysqld.service After=syslog.target network-online.target mysqld.service [Service] Type=simple User=$USER ExecStart=/usr/local/bin/budlib-api.sh Restart=on-failure RestartSec=10 KillMode=mixed [Install] WantedBy=multi-user.targetNote: replace
$USERwith your system username, orroot -
Enable the budlib-api to run on system startup
# systemctl daemon-reload # systemctl enable budlib-api.service