Exercise – Deploying a Spring boot Application
- This activity is about deploying a spring boot application
- The application can be downloaded from Refer Here
- Steps of configuring the machine
- Install Open jdk 11
- Download the jar file to some folder on the node
/usr/share/spc/spring-petclinic.jar - Create a user
sudo useradd spc sudo password spc sudo chown spc:spc /usr/share/spc/spring-petclinic.jar sudo chmod 500 /usr/share/spc/spring-petclinic.jar- Create a service file
/etc/systemd/system/spc.service[Unit] Description=Spring petclinic application After=network.target [Service] User=spc ExecStart=/usr/bin/java -jar /usr/share/spc/spring-petclinic.jar SuccessExitStatus=143 [Install] WantedBy=multi-user.target - Application should be accessible on http://publicip:8080
- Exercise:
- Ensure the manual steps are working
- Write a playbook to make this spring petclinic application deploy on ubuntu and then centos
- hint:
- java installation:
- ubuntu:
sudo apt update && sudo apt install openjdk-11-jdk -y - centos:
sudo yum install java-11-openjdk-devel -y
- ubuntu:
- java installation:
