Spring Boot Admin Page

前端 未结 2 2064
暖寄归人
暖寄归人 2021-02-10 23:28

I am trying to understand how to use SBAP in my application because it is a very handy tool for development. I\'m reading their reference guide but I\'m not understanding a few

2条回答
  •  甜味超标
    2021-02-11 00:03

    1. So am I registering my application as the server and the client?

    In your example, you do. It's not problem that the admin server is a client to itself. In fact the spring-boot-admin-sample is configured this way so you get infos about the admin server itself.

    1. How do I run this application and access the admin page? They don't mention any URL to go to to see the admin page. Is it just: http://localhost:8080?

    Yes. If you don't set the spring.boot.admin.context-path the admin is served on root. So if you ship the admin along inside your business-app you should configure spring.boot.admin.context-path so that it's served elsewhere.

    1. How do I set this up for development but turn it off in production? There reference guide at the bottom says: ...

    The point is just to use two separate applications. This is the way we do it from dev-, over qa- to production-stage. We always separate the business- from the admin-server. If you want to enable the admin-server inside your business-application conditionally try this approach: Write an @Configuration-class wich is only active within a certain profile and move the @EnableAdminServer to this configuration.

    Hope this helps.

提交回复
热议问题