栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

服务器端Sentinel无法监控本机服务的问题分析及解决方案(已解决!)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

服务器端Sentinel无法监控本机服务的问题分析及解决方案(已解决!)

已解决

一开始我是使用
clientIp: localhost
然后他服务就能监控到了
但是我发现他的方法根本没办法做熔断降级等操作 等于说他就是一个假东西
我也试过使用内网穿透 并没用!!!!
后面我尝试将微服务打包部署到服务器 成功!!!
说白了就是网络不通!我也不知道怎么解决
但是本地安装一个 Sentinel 然后本地启动微服务 成功! 简单来说你本地安装一个Sentinel 等将功能做好 改下配置部署到服务器不就完美解决了吗!
这是我得到的目前最优解!!!
1.官网 下载 最新jar包:https://github.com/alibaba/Sentinel/releases
啦到最下面下载这个!
java -jar sentinel-dashboard-1.8.2.jar
cmd运行这个指令 默认端口是8080
然后你改下配置本地启动微服务 成功!!!
这是我的配置!

  application:
    name: account-service
  cloud:
    nacos:
      discovery:
        server-addr: 119.23.176.114:8848 #nacos的服务注册中心
    sentinel:
      transport:
        # sentinel服务端地址
        dashboard: localhost:8080
        port: 8719  #默认为8719 ,假如被占用会自动从8719开始依次+1扫描,直到未被占用的端口
        # 线上部署的ip  -> ip必须打开8719的端口
#        clientIp: localhost
      # 取消延迟加载
      eager: true
      datasource:
        ds:
         nacos:
          server-addr:  119.23.176.114:8848 #nacos的服务注册中心
          data-id: account-sentinel.json #这是唯一的数据id
          group-id: DEFAULT_GROUP  #nacos配置中心的组id
          rule-type: flow #规则为限流
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://119.23.176.114:3307/onlinebank?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
    username: root
    password: 123456
server:
  port: 8182
mybatis-plus:
  mapper-locations: classpath*:/mapper/*Mapper.xml
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true
  type-aliases-package: com.changan.entity
management:
  endpoint:
    web:
      exposure:
        include: '*'




转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/984920.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号