Book Image

Mastering Spring Boot 2.0

By : Dinesh Rajput
Book Image

Mastering Spring Boot 2.0

By: Dinesh Rajput

Overview of this book

Spring is one of the best frameworks on the market for developing web, enterprise, and cloud ready software. Spring Boot simplifies the building of complex software dramatically by reducing the amount of boilerplate code, and by providing production-ready features and a simple deployment model. This book will address the challenges related to power that come with Spring Boot's great configurability and flexibility. You will understand how Spring Boot configuration works under the hood, how to overwrite default configurations, and how to use advanced techniques to prepare Spring Boot applications to work in production. This book will also introduce readers to a relatively new topic in the Spring ecosystem – cloud native patterns, reactive programming, and applications. Get up to speed with microservices with Spring Boot and Spring Cloud. Each chapter aims to solve a specific problem or teach you a useful skillset. By the end of this book, you will be proficient in building and deploying your Spring Boot application.
Table of Contents (23 chapters)
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
Index

Running microservices on AWS EC2


In this section, we will set up account and customer microservices on the EC2 instance. We are using Spring Boot 2.0 in this example:

  1. We have to install Java 8 as well our EC2 instance using the following command:
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie

You can also refer to the following link:

http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

The preceding command will download a jdk-8u131-linux-x64.tar.gz file. We extract this file using the following command:

$ sudo tar -xvf jdk-8u131-linux-x64.tar.gz
  1. After untar, let's set up the JAVA_HOME and PATH environment variables, as follows:
$ JAVA_HOME=/home/ec2-user/jdk1.8.0_131
$ PATH=/home/ec2-user/jdk1.8.0_131/bin:$PATH
$ export JAVA_HOME PATH

Let's check the Java version, using the following command:

  1. As you can see, we have set up Java 8 in the EC2 instance. Let's run a microservice on this EC2 instance.

Execute the following...