spring-boot-admin icon indicating copy to clipboard operation
spring-boot-admin copied to clipboard

no application

Open zlj66888 opened this issue 8 years ago • 10 comments

I use the 1.5 version of Eureka,Can't find application. image

zlj66888 avatar May 30 '18 10:05 zlj66888

Please provide more details, with this little information I can't help you. Are there any errors in the logs? Did you add the Eureka Discovery Client to the SBA server? Is it configured properly?

joshiste avatar May 30 '18 14:05 joshiste

I have the same problem。

132456

debug:

Server

2018-06-04 11:57:40.313 ERROR 10220 --- [nio-8764-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] threw exception
java.io.IOException: 您的主机中的软件中止了一个已建立的连接。
	at sun.nio.ch.SocketDispatcher.write0(Native Method) ~[na:1.8.0_144]
	at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51) ~[na:1.8.0_144]
	at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_144]
	at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_144]
	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[na:1.8.0_144]
	at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:134) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:157) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1267) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.tomcat.util.net.SocketWrapperBase.doWrite(SocketWrapperBase.java:670) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking(SocketWrapperBase.java:607) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.tomcat.util.net.SocketWrapperBase.flush(SocketWrapperBase.java:597) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.flush(Http11OutputBuffer.java:646) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.coyote.http11.filters.ChunkedOutputFilter.flush(ChunkedOutputFilter.java:169) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:252) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1560) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:285) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.coyote.Response.action(Response.java:173) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:317) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:284) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:118) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297) ~[na:1.8.0_144]
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141) ~[na:1.8.0_144]
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) ~[na:1.8.0_144]
	at org.springframework.util.StreamUtils.copy(StreamUtils.java:121) ~[spring-core-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:103) ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:43) ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:230) ~[spring-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitterReturnValueHandler$HttpMessageConvertingHandler.sendInternal(ResponseBodyEmitterReturnValueHandler.java:199) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitterReturnValueHandler$HttpMessageConvertingHandler.send(ResponseBodyEmitterReturnValueHandler.java:189) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter.sendInternal(ResponseBodyEmitter.java:175) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter.send(ResponseBodyEmitter.java:169) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.SseEmitter.send(SseEmitter.java:125) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler$SseEmitterSubscriber.send(ReactiveTypeHandler.java:341) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler$AbstractEmitterSubscriber.run(ReactiveTypeHandler.java:283) ~[spring-webmvc-5.0.4.RELEASE.jar:5.0.4.RELEASE]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]

pom.xml

<dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server-ui</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </dependency>
            <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
        </dependency>
    </dependencies>

application.yml

spring:
     application:
         name: gaia-monitor
server:
        port: 8764 #启动端口
eureka:
      instance:
         statusPageUrlPath: /actuator/info
         healthCheckUrlPath: /actuator/health
         home-page-url-path: /actuator
        # docker 部署开启
         prefer-ip-address: true
        ip-address: ${INSTANCE_IP_ADDRESS:127.0.0.1}
      client:
         registerWithEureka: true
         fetchRegistry: true
         serviceUrl:
           defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8761}/eureka/,http://${EUREKA_HOST:192.168.31.63}:${EUREKA_PORT:8761}/eureka/

Application.java

@SpringBootApplication
@EnableAdminServer
@EnableEurekaClient
public class MonitorBootstrapApplication {
    public static void main(String[] args) {
        SpringApplication.run(MonitorBootstrapApplication.class, args);
    }
}

Client:

pom.xml:

<dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>2.0.0</version>
</dependency>

application.yml

spring:
    application:
        name: gaia-auth
    boot:
      admin:
        url: http://localhost:8764/

thank you for your help.

junxinzhang avatar Jun 04 '18 04:06 junxinzhang

The same problem here:

build.gradle

 dependencies {
	compile('de.codecentric:spring-boot-admin-server:2.0.1-SNAPSHOT')
	compile('de.codecentric:spring-boot-admin-server-ui:2.0.1-SNAPSHOT')
	compile('de.codecentric:spring-boot-admin-server-ui-hystrix:1.5.8')
	compile('de.codecentric:spring-boot-admin-server-ui-turbine:1.5.8')
	runtime("org.springframework.boot:spring-boot-properties-migrator")
	compile('org.springframework.cloud:spring-cloud-starter-eureka:2.0.0.M2')
	compile('org.springframework.cloud:spring-cloud-starter-netflix-turbine:2.0.0.RC1')
	compile('org.springframework.boot:spring-boot-starter-security')
	testCompile('org.springframework.boot:spring-boot-starter-test')
}

application.yml

server:
  port: 8009


## Actuator Configuration
management:
  server:
    port: 10286
  endpoints:
    web:
      exposure:
        include: "*"
  health:
    defaults:
      enabled: true

spring:
  application:
    name: "admin"
  boot:
    admin:
      context-path: /admin
      turbine:
          clusters: "X"
eureka:
  client:
    serviceUrl:
      defaultZone: http://127.0.0.1:8761/eureka
      
turbine:
  aggregator:
    clusterConfig: "${spring.boot.admin.turbine.clusters}" #the same clusters that are shown in the turbine view, must be configured
  appConfig: "service1,service2" # application.name without stage
  clusterNameExpression: "appGroupName" #clusters are build by the property eureka.instance.app-group-name value of the service
  combineHostPort: true 

AdminApplication

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.turbine.EnableTurbine;
import org.springframework.cloud.netflix.turbine.TurbineProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

import com.netflix.discovery.EurekaClient;
import com.netflix.turbine.discovery.InstanceDiscovery;

import de.codecentric.boot.admin.server.config.EnableAdminServer;

@EnableAdminServer
@SpringBootApplication
@EnableDiscoveryClient
@EnableTurbine
public class AdminApplication {

	public static void main(String[] args) {
		SpringApplication.run(AdminApplication.class, args);
	}

	@Configuration
	@ConditionalOnClass(EurekaClient.class)
	protected static class EurekaTurbineConfiguration {

		@Bean
		@ConditionalOnMissingBean
		public InstanceDiscovery instanceDiscovery(TurbineProperties turbineProperties, EurekaClient eurekaClient) {
			return new XentryEurekaInstanceDiscovery(turbineProperties, eurekaClient);
		}

	}

	@Configuration
	public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {

		@Override
		protected void configure(HttpSecurity http) throws Exception {
			http.authorizeRequests().anyRequest().permitAll().and().csrf().disable();
		}
	}
}

Some information is hidden because are sensitive and It cannot be published.

v-escobar avatar Jun 04 '18 13:06 v-escobar

screenshot from 2018-06-05 03-02-32

I got the same problem here, and there are no errors on the log. I'm using SBA integrate with eureka server to monitor my business services. Both eureka server and SBA are independent.

I use spring boot 2.0.2 for my SBA (admin server 2.0.0), Eureka server, and Eureka client.

Are there anything wrong with my configuration?

application.properties (SBA)

eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.health-check-url-path=/actuator/health
eureka.client.registry-fetch-interval-seconds=5
spring.application.name=server-admin
eureka.client.service-url.defaultZone=${EUREKA_SERVICE_URL:http://127.0.0.1:8761}/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true

application.properties (Eureka client)

spring.application.name=service-x
eureka.client.service-url.defaultZone=http://127.0.0.1:8761/eureka
eureka.instance.prefer-ip-address=true
eureka.instance.metadata-map.user.name=${username}
eureka.instance.metadata-map.user.password=${password}
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.health-check-url-path=/actuator/health
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=false

wiratamap avatar Jun 04 '18 20:06 wiratamap

Same here after Update to SBA 2

marbon87 avatar Jun 05 '18 14:06 marbon87

It seems, it tries to connect to an /applications url but I am not sure. Whereas Eureka exposes an /apps URI

jripault avatar Jun 05 '18 15:06 jripault

I also have the same problem, SBA server as eureka client can not automatically find other APP client, but after updating the spring boot and spring cloud version, according to https://codecentric.github.io/spring-boot-admin/current/ , SBA server can automatically find other clients.

spring-boot-version:2.0.1.RELEASE spring-cloud-version:Finchley.RC2 spring-boot-admin-version:2.0.1-SNAPSHOT

ycg000344 avatar Jun 06 '18 14:06 ycg000344

My problem was that i missed to migrate the properties for the server-url, they were changed with sba 2.0. Now the client-registration is working. Have a look at http://codecentric.github.io/spring-boot-admin/2.0.0/#_changes_with_2_x For example: spring.boot.admin.url is now spring.boot.admin.client.url

marbon87 avatar Jun 06 '18 14:06 marbon87

For Spring Cloud Discovery support you need to use 2.0.1-SNAPSHOT as Spring Cloud Finchley is not released yet and the Spring Boot Admin 2.0.0 lacks support for it. Sorry the docs are missing this point.

joshiste avatar Jun 07 '18 16:06 joshiste

@joshiste is it possible to use 2.0.1 release?

n0mer avatar Jun 25 '18 17:06 n0mer