Create a spring boot application and following dependencise in pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Add following @EnableAdminServer in our main Server class
@SpringBootApplication
@EnableAdminServer
public class SiddhuSpringBootAdminServerApplication {
public static void main(String[] args) {
SpringApplication.run(SiddhuSpringBootAdminServerApplication.class, args);
}
}
Add following lines in your admin configuration properties
server.port = 9090
spring.application.name = adminserver
Compile the server and run the application
java -jar C:\Latest_workspace-sts-3.9.6.RELEASE\siddhu-spring-boot-admin-server\target\siddhu-spring-boot-admin-server-0.0.1-SNAPSHOT.jar
![Image1](https://shdhumale.files.wordpress.com/2019/09/image1-2.jpg)
![Image2](https://shdhumale.files.wordpress.com/2019/09/image2-3.jpg)
![Image3](https://shdhumale.files.wordpress.com/2019/09/image3-3.jpg)
![Image4](https://shdhumale.files.wordpress.com/2019/09/image4-3.jpg)
And hit url
http://localhost:9090/#/
![Image5](https://shdhumale.files.wordpress.com/2019/09/image5-3.jpg)
Now lets create the spring boot application admin client. Create an spring boot application and following dependencise in pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@SpringBootApplication
public class SiddhuSpringBootAdminClientApplication {
public static void main(String[] args) {
SpringApplication.run(SiddhuSpringBootAdminClientApplication.class, args);
}
}
Add following lines in your admin configuration properties
spring.boot.admin.url=http://localhost:9090/
![Image6](https://shdhumale.files.wordpress.com/2019/09/image6-3.jpg)
![Image7](https://shdhumale.files.wordpress.com/2019/09/image7-3.jpg)
![Image8](https://shdhumale.files.wordpress.com/2019/09/image8-3.jpg)
![Image9](https://shdhumale.files.wordpress.com/2019/09/image9-2.jpg)
java -Dserver.port=8888 -jar C:\Latest_workspace-sts-3.9.6.RELEASE\siddhu-spring-boot-admin-client\target\siddhu-spring-boot-admin-client-0.0.1-SNAPSHOT.jar
Compile the server and run the application and hit url
http://localhost:9090/#/
![Image10](https://shdhumale.files.wordpress.com/2019/09/image10-2.jpg)
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Add following @EnableAdminServer in our main Server class
@SpringBootApplication
@EnableAdminServer
public class SiddhuSpringBootAdminServerApplication {
public static void main(String[] args) {
SpringApplication.run(SiddhuSpringBootAdminServerApplication.class, args);
}
}
Add following lines in your admin configuration properties
server.port = 9090
spring.application.name = adminserver
Compile the server and run the application
java -jar C:\Latest_workspace-sts-3.9.6.RELEASE\siddhu-spring-boot-admin-server\target\siddhu-spring-boot-admin-server-0.0.1-SNAPSHOT.jar
![Image1](https://shdhumale.files.wordpress.com/2019/09/image1-2.jpg)
![Image2](https://shdhumale.files.wordpress.com/2019/09/image2-3.jpg)
![Image3](https://shdhumale.files.wordpress.com/2019/09/image3-3.jpg)
![Image4](https://shdhumale.files.wordpress.com/2019/09/image4-3.jpg)
And hit url
http://localhost:9090/#/
![Image5](https://shdhumale.files.wordpress.com/2019/09/image5-3.jpg)
Now lets create the spring boot application admin client. Create an spring boot application and following dependencise in pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@SpringBootApplication
public class SiddhuSpringBootAdminClientApplication {
public static void main(String[] args) {
SpringApplication.run(SiddhuSpringBootAdminClientApplication.class, args);
}
}
Add following lines in your admin configuration properties
spring.boot.admin.url=http://localhost:9090/
![Image6](https://shdhumale.files.wordpress.com/2019/09/image6-3.jpg)
![Image7](https://shdhumale.files.wordpress.com/2019/09/image7-3.jpg)
![Image8](https://shdhumale.files.wordpress.com/2019/09/image8-3.jpg)
![Image9](https://shdhumale.files.wordpress.com/2019/09/image9-2.jpg)
java -Dserver.port=8888 -jar C:\Latest_workspace-sts-3.9.6.RELEASE\siddhu-spring-boot-admin-client\target\siddhu-spring-boot-admin-client-0.0.1-SNAPSHOT.jar
Compile the server and run the application and hit url
http://localhost:9090/#/
![Image10](https://shdhumale.files.wordpress.com/2019/09/image10-2.jpg)
No comments:
Post a Comment