Installation Guide (VM)
This guide will assist you in installing CAT Next Generation, supporting both Virtual Machines (VM) and container environments with JDK 17+ and MySQL 8+.
1. Prerequisites
Before proceeding with the installation, ensure your system meets the following requirements:
- Java Development Kit (JDK) 17 or higher: CAT requires JDK 17 or newer.
- MySQL 8 or higher: This will be used for storing application data.
- Docker (optional): Required if you choose to run CAT in containers.
- Docker Compose (optional): Required if you choose to manage the deployment using Docker Compose.
2. Installation Steps
Option 1: Installation on a Virtual Machine (VM)
2.1 Install JDK 17+
Download the JDK from the official website or use your system's package manager.
For example, on Ubuntu:
sudo apt update sudo apt install openjdk-17-jdk -y
Verify the installation:
java -version
2.2 Install MySQL 8+
Install MySQL using your system's package manager or download it from the official website.
For example, on Ubuntu:
sudo apt update sudo apt install mysql-server -y
Start the MySQL service:
sudo systemctl start mysql
Secure your MySQL installation:
sudo mysql_secure_installation
Log into MySQL:
mysql -u root -p
Create a database for CAT:
CREATE DATABASE cat; CREATE USER 'cat_user'@'localhost' IDENTIFIED BY 'cat_password'; GRANT ALL PRIVILEGES ON cat.* TO 'cat_user'@'localhost'; FLUSH PRIVILEGES;
2.3 Install CAT
Download the latest CAT release from the official repository.
Extract the downloaded archive and navigate to the CAT directory.
Run CAT:
java -jar cat.jar
Option 2: Installation Using Docker
2.1 Install Docker
If Docker is not installed, follow these steps:
sudo apt update
sudo apt install docker.io -y
sudo systemctl start docker
sudo systemctl enable docker
2.2 Install Docker Compose
If Docker Compose is not installed, you can install it with the following command:
sudo apt update
sudo apt install docker-compose -y
2.3 Create Docker Compose Configuration
- Create a
docker-compose.yml
file in your project directory with the following content:
version: '3'
services:
mysql:
image: mysql:8
container_name: cat-mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: cat
MYSQL_USER: cat_user
MYSQL_PASSWORD: cat_password
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
networks:
- cat-network
cat-server:
build: .
container_name: cat-server
ports:
- "8080:8080"
environment:
JAVA_OPTS: "-Xms512m -Xmx1024m"
depends_on:
- mysql
networks:
- cat-network
volumes:
mysql-data:
networks:
cat-network:
2.4 Create a Dockerfile for CAT
In the same directory, create a Dockerfile
for building the CAT service Docker image:
FROM eclipse-temurin:17-jre
WORKDIR /app
COPY cat-home/target/cat.jar /app/cat.jar
EXPOSE 8080
CMD ["java", "-jar", "/app/cat.jar"]
2.5 Start CAT Using Docker Compose
- In the directory containing your
docker-compose.yml
, run the following command to start CAT and MySQL:
docker-compose up -d
- To view logs and ensure the services are running smoothly, use:
docker-compose logs -f
3. Conclusion
You have successfully installed CAT Next Generation in either a Virtual Machine (VM) or a containerized environment. Follow the steps to initialize the database and access the CAT management console for monitoring and observability.