Skip to content

emilio302/spring-2024

 
 

Repository files navigation


ISCSD

ISCSD project stub

Report Bug · Request Feature

Contents
  1. About this project
  2. Before starting
  3. Tnstallation
  4. Links to tools, libraries and used modules
  5. Contact

About this project

This is the lab project for the ISCSD course at the UOC. It is made up of 3 elements (each one in its own GIT repository):

(go up)

Made with

(go up)

Before starting

To set up the containers that are part of the basic infrastructure of the project, the following ports will be used:

  • 22181 - Apache Kafka (Zookeeper)
  • 19092 - Apache Kafka (Server)
  • 54320, 54321 - PostgreSQL
  • 18080 - Adminer
  • 18081 - Used by the productcatalog microservice
  • 18082 - Used by the user microservice

To avoid conflicts with other installed applications, the default ports of all applications have been modified. Still, if there is a conflict over a port already in use, simply modifying the ports specified in the docker-compose.yml file will fix the problem. This link to the official docker compose documentation explains how to modify this configuration using the ports: Networking in Compose option.

IMPORTANT NOTICE: The modified ports will also have to be changed in the microservices configuration (usually defined in the Spring application.properties file).

Installation

Docker Desktop / Docker Compose installation

Proceed to install Docker Compose following the steps described in the following guide: https://docs.docker.com/compose/install/ (according to your OS).

Under Windows, registration may be required, as Docker Desktop requires it for educational/personal/non-commercial projects. On the plus side, it will not be necessary to install anything else because it already includes Compose.

It is important that you carefully review the hardware and software requirements described in the installation guides. If your system fails to meet them, even after a successful installation, you will see errors when trying to start containers. An alternative for those with slightly older systems is Docker Toolbox.

Once Docker Compose is installed, we will continue with the project stub. It is recommended to set up a folder structure like so:

spring-2024
├ README.md
├ docker-compose.yml
├ spring-2024-notification
├ spring-2024-productcatalog
└ spring-2024-user

(go up)

Basic infrastructure (dockers)

  • Download the code in ZIP format or just clone the spring-2024 repository in the working folder (spring-2024 if the recommendation has been followed).

  • From the work folder, run the command:

    docker compose up
    (Win)
    docker-compose up
    (Linux)

The following containers should start:

  • spring-2024-adminer_1 - adminer, an SQL client
  • spring-2024-kafka_1 - the kafka server
  • spring-2024-productdb_1 - the postgresql database for the productcatalog service
  • spring-2024-userdb_1 - the postgresql database for the user service
  • spring-2024-zookeeper_1 - kafka zookeeper

In order to verify that all containers are up and running, we will execute the following command:

docker ps -a

We should see something like this:

Docker containers running

To check the operation, you can access the Adminer panel at http://localhost:18080/ and make a query against the PostgreSQL DB that we have just instantiated with the following connection data:

  • productdb
  • Engine: PostgreSQL
  • Server: productdb
  • User: product
  • Password: product
  • Schema: product

Adminer productdb 1

Adminer productdb 2

  • userdb
  • Engine: PostgreSQL
  • Server: userdb
  • User: user
  • Password: user
  • Schema: user

Adminer userdb 1

Adminer userdb 2

Microservices stubs

(go up)

Links to used tools, libraries and modules

Contact

Vicenç Font - [email protected]

(ir arriba)

About

For PRAC 3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published