Deploying with systemd

Prerequisites

On the server, you will need:

  • JDK 25 or newer

  • Elasticsearch version 8.2.x

  • MongoDB

  • A built “deployable jar” version of Phoebus Olog, see Building for more information.

Creating the systemd service file

You can put the systemd service file in /usr/local/lib/systemd/system/phoebus-olog.service.

Make sure you replace everything that’s inside [] brackets.

/usr/local/lib/systemd/system/phoebus-olog.service
[Unit]
Description=Phoebus Olog service
After=elasticsearch.service mongodb.service

[Service]
Environment=OLOG_DEPLOYABLE_JAR=/opt/service-olog-[version].jar
Environment=OLOG_CONFIG=/etc/phoebus-olog.properties
DynamicUser=true
ExecStart=[/path/to/your/jdk25]/bin/java -jar $OLOG_DEPLOYABLE_JAR --spring.config.location=file://${OLOG_CONFIG}

[Install]
WantedBy=multi-user.target

Make sure to create the /etc/phoebus-olog.properties file.

Then, enable and start the service with systemctl enable --now phoebus-olog.service.

Check if service is running

Once the service is running, the service consists of a welcome page http://localhost:8080/Olog

$ curl http://localhost:8080/Olog
{
  "name" : "Olog Service",
  "version" : "5.0.0-SNAPSHOT",
  "elastic" : {
    "status" : "Connected",
    "clusterName" : "elastic-nasa",
    "clusterUuid" : "QNeYpFlWRueYPH3uXGUiGw",
    "version" : "co.elastic.clients.elasticsearch._types.ElasticsearchVersionInfo@79c2137f",
    "elasticHost" : "localhost",
    "elasticPort" : "9200"
  },
  "mongoDB" : "{type=STANDALONE, servers=[{address=localhost:27017, type=STANDALONE, roundTripTime=1.2 ms, state=CONNECTED}]",
  "serverConfig" : {
    "maxFileSize" : 50.0,
    "maxRequestSize" : 100.0
  }
}

This will provide information about the version of the Olog service running, along with information about the version and connection status of the elastic and mongo backends.

An example for testing the creation of a single test log entry with the demo credentials

curl --location --insecure --request PUT 'https://localhost:8181/Olog/logs' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic YWRtaW46YWRtaW5QYXNz' \
    --data '{
             "owner": "test-owner",
             "source": "This is an test entry",
             "title": "Tes title",
             "level": "Info",
             "logbooks": [{"name": "operations","owner": "olog-logs"}]
         }'

Configuration

To configure the Phoebus Olog service, edit the /etc/phoebus-olog.service file.

For more information on how to configure, see Configuring.