Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo status is UNKOWN #100

Closed
ghost opened this issue Apr 9, 2018 · 6 comments
Closed

dubbo status is UNKOWN #100

ghost opened this issue Apr 9, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2018

Description

After checking the dubbo service working correctly, then added the dependency of spring-boot-actuator to enable actuator and checked http://localhost:9091/health, it shows the status of dubbo is UNKOWN.
dubbo_status_unknown

Is it normal? a bug? or the configuration is incorrect ?

Thanks

Configurations

pom.xml

    <!-- spring boot starter -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <!-- mvc -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!-- actuator -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <!-- lombok -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.at.spring</groupId>
      <artifactId>dubbo-spring-boot-demo-api</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    </dependency>
    
    <!-- dubbo-spring-boot-starter
            0.1.x => spring-boot 1.x
            0.2.x => spring-boot 2.x
    -->
    <dependency>
      <groupId>com.alibaba.boot</groupId>
      <artifactId>dubbo-spring-boot-starter</artifactId>
      <version>0.1.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter</artifactId>
        </exclusion>
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.101tec</groupId>
      <artifactId>zkclient</artifactId>
      <version>0.10</version>
    </dependency>
    

application.properties

# Spring boot application
spring.application.name = dubbo-provider-demo
server.port = 9090
management.port = 9091

# Base packages to scan Dubbo Components (e.g., @Service, @Reference)
dubbo.scan.basePackages  = com.at.spring.service.impl

# Dubbo Config properties
## ApplicationConfig Bean
dubbo.application.id = dubbo-spring-boot-demo-provider
dubbo.application.name = dubbo-spring-boot-demo-provider

## ProtocolConfig Bean
dubbo.protocol.id = dubbo
dubbo.protocol.name = dubbo
dubbo.protocol.port = 12345

## RegistryConfig Bean
dubbo.registry.id = zookeeper
dubbo.registry.address = zookeeper://127.0.0.1:2181



### actuator

## Available values: registry, spring, datasource, memory, load, server, threadpool
#management.health.dubbo.status.defaults = memory,load
management.health.dubbo.status.defaults = registry,memory,load

## Override management.health.dubbo.status.defaults, separated by comma
#management.health.dubbo.status.extras = 
#management.health.dubbo.status.extras = 

## Not available in 0.1.0
#management.health.dubbo.enabled = false
#management.health.dubbo.enabled = true

## dubbo endpoint
#endpoints.dubbo.enabled = false
endpoints.dubbo.enabled = true
#endpoints.dubbo.sensitive = true
endpoints.dubbo.sensitive = false
## Spring Security
#management.security.enabled = true
management.security.enabled = false
@mercyblitz
Copy link
Contributor

Please take a look at load item in this endpoint

@ghost
Copy link
Author

ghost commented Apr 10, 2018

@mercyblitz Hi, thanks for your response. But what does it mean? How could I find the info of the load item?

@mercyblitz
Copy link
Contributor

@alphatan
Please reference code of com.alibaba.dubbo.common.status.support.LoadStatusChecker

@ghost
Copy link
Author

ghost commented Apr 20, 2018

@mercyblitz Thanks for the tips. But I think this is still a problem. Why should it be closed ?


My research of this problem.

According to this answer of the question "Alternate of getSystemLoadAverage() for Windows?", the method getSystemLoadAverage of java.lang.management.OperatingSystemMXBean would return -1 in Windows.

It'd be suggested to use com.sun.management.OperatingSystemMXBean and its getSystemCpuLoad() and getProcessCpuLoad() instead.

So, the conclusion (of my original questions) is:

  1. This is a normal behavior, and it's a windows-specific issue.
  2. It can be better if it can be implemented in a different way.
  3. The configuration is correct.

@mercyblitz
Copy link
Contributor

@alphatan Thanks for your advise, LoadStatusChecker would be changed the algorithm of load.

@mercyblitz
Copy link
Contributor

Issue trace on apache/dubbo#1641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant