The Service Discovery allows all microservices composing the application to register dynamically in a global repository and to find another instances on demand.
You need to have the following tools installed and configured:
- Java SE 1.8+
- Maven 3.0+
In order to run the service discovery, follow these steps:
- Run the Configuration Server.
- Clone the latest production version of this repository from the
masterbranch. - Navigate to the cloned repository and install all dependencies by typing:
mvn install
- Run the built
*.jarfile passing the location of configuration files by typing:
java -jar target/service-discovery-1.0-SNAPSHOT.jar --spring.config.location=classpath:pl/edu/agh/iet/dts/discovery/
When the *.jar file is successfully built, a Docker image for the production environment may be created by applying
following steps:
- Enter the root directory of this repository.
- Build the Docker image by typing:
docker build . -t service-discovery
- In order to run the image, type:
docker run -p 8080:8080 -p 44341:44321 -p 44343:44323 -e CONFIGURATION_SERVER_IP=[CONFIGURATION SERVER HOST IP ADDRESS] -e EUREKA_IP=[EUREKA HOST IP ADDRESS] -t service-discovery
Please note that this docker container uses the Performance Co-Pilot (PCP) tool to gather data for system monitoring
metrics. These values are accessed via the 44341 and 44343 ports. In order to visualize performance of this
microservice, please enter the [CONTAINER IP ADDRESS]:44343 value in the Hostname field placed in the Netflix Vector
dashboard.
In order to test the application locally, run the built *.jar file by typing:
java -jar target/service-discovery-1.0-SNAPSHOT.jar --spring.profiles.active=test --spring.config.location=classpath:pl/edu/agh/iet/dts/discovery/
and then execute specific tests.