Logwise Orchestrator — Self-Hosted Setup
Follow these steps to run Logwise Orchestrator as a standalone self-hosted application using the JAR file.
Prerequisites
- Java 11 or higher (JRE or JDK) installed
- Maven 3.6+ installed (for building the application)
- MySQL 8.0+ running and accessible
- Access to required external services (AWS, GCP, Kafka, etc.) based on your configuration
1) Setup Database
Create the MySQL database and initialize schema:
mysql -u root -pCREATE DATABASE IF NOT EXISTS log_central CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'logcentral'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON log_central.* TO 'logcentral'@'localhost';
FLUSH PRIVILEGES;Initialize the database schema by running the following SQL script:
USE log_central;
DROP TABLE IF EXISTS service_details;
CREATE TABLE `service_details` (
`environmentName` varchar(128) NOT NULL,
`componentType` varchar(50) NOT NULL,
`serviceName` varchar(50) NOT NULL,
`retentionDays` mediumint unsigned NOT NULL,
`tenant` enum('ABC') NOT NULL,
`lastCheckedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `environmentName` (`environmentName`,`componentType`,`serviceName`,`tenant`)
)2) Build the Application
Navigate to the project directory and build the fat JAR:
cd logwise/orchestrator
mvn clean packageThe fat JAR will be created at target/log-central-orchestrator-<version>-all.jar.
For example: target/log-central-orchestrator-0.0.1-SNAPSHOT-all.jar
Verify the JAR exists:
ls -lh target/log-central-orchestrator-*-all.jar3) Configure Environment Variables
Set the required environment variables. Create a .env file or export them in your shell:
# Database Configuration (Required)
export DB_MASTER_HOST=localhost
export DB_USERNAME=logcentral
export DB_PASSWORD=your_secure_password
export DB_SLAVE_HOST=localhost # Optional, same as master if not using replication
# Application Environment (Optional - defaults to "dev" if not set)
# Set as system property: -Dapp.environment=local
# Or export: export app.environment=local
# Spark Configuration (Required if using Spark features)
export SPARK_MASTER_HOST=your_spark_master_host
export SPARK_JAR_PATH=your_spark_jar_path
export LOG4J_PROPERTIES_FILE_PATH=your_log4j_path
# AWS Configuration (Required if using AWS services like S3, Athena)
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
# S3 Endpoint Override
export S3_ENDPOINT_OVERRIDE=http://localhost:4566If using a .env file, source it:
source .envImportant
The database name is fixed as log_central. Ensure your MySQL database is created with this exact name. The application will connect to this database using the credentials specified in DB_USERNAME and DB_PASSWORD.
4) Run the Application
Run the JAR file directly:
java -jar target/log-central-orchestrator-<version>-all.jarFor example:
java -jar target/log-central-orchestrator-0.0.1-SNAPSHOT-all.jarTo specify the application environment explicitly:
java -Dapp.environment=local -jar target/log-central-orchestrator-<version>-all.jar::: note Note If app.environment is not set, it defaults to "dev". The application will look for configuration files matching the environment name (e.g., application-local.conf, connection-local.conf). :::
Important
To change the default port, set the system property: -Dhttp.default.port=<port> when running the JAR.
Verifying the Application
Check if the application is running:
bashps aux | grep log-central-orchestratorTest the health check endpoint:
bashcurl http://localhost:8080/healthcheck
Troubleshooting
Database Connection Failed
- Verify MySQL is running:
systemctl status mysqlormysqladmin ping - Check database credentials in environment variables (
DB_USERNAME,DB_PASSWORD,DB_MASTER_HOST) - Verify database exists:
mysql -u root -p -e "SHOW DATABASES;"(should showlog_central) - Ensure database name is exactly
log_central(case-sensitive) - Test connection manually:
mysql -u logcentral -p -h localhost log_central
JAR File Not Found
- Verify the JAR file exists:
ls -lh target/*-all.jar - Ensure you're using the
-all.jarfile (fat JAR), not the regular JAR - Rebuild if necessary:
mvn clean package
