chen-gliu / nacos-consul-adapter

This project contains a Spring Boot Starter that registers HTTP endpoints on a Spring Cloud Nacos server to support Prometheus's service discovery mechanism for Consul (<consul_sd_config>)
MIT License
87 stars 36 forks source link

管理端口和服务端口不一致,无法工作 #2

Closed chinfeng2github closed 2 years ago

chinfeng2github commented 2 years ago

因为我 指定了和server.port不一样的管理端口

management:
  server:
    # 管理端点的端口
    port: 10002

这样在prometheus中配置的端口就是

  - job_name: 'prometheus-springcloud-gateway'
    metrics_path: '/actuator/prometheus'
    consul_sd_configs:
    - server: gateway1:10002
      services: []

最后 https://github.com/chen-gliu/nacos-consul-adapter#%E7%89%B9%E6%80%A7 特性中四个接口 访问不到

chen-gliu commented 2 years ago

@chinfeng2github 如果管理端口和服务端口不一致是会出现访问不到的那四个接口,现在在也没有特别好的处理方式,你可以在nginx中做一下反向代理,将特性中的四个接口反代到正确的端口。