假装客户端无法拨打电话 - Kubernetes

2024-02-21

我已经在 Windows 的 docker-desktop 上部署了微服务,并且 feign 无法调用另一个服务。

个人MS通过假装呼叫组织MS。 我可以在 person pod 的日志中看到

 2019-11-10 12:58:34.000  INFO [personservice,13631e6ef2efe358,15c75b9a4006485a,true] 6 --- [ionThreadPool-1] c.p.service.OrganizationServiceData      : Get the value from the organization ms hystrix-organizationThreadPool-1
2019-11-10 12:58:34.293  INFO [personservice,13631e6ef2efe358,e0bbcecf5f7c349f,true] 6 --- [zationservice-1] c.netflix.config.ChainedDynamicProperty  : Flipping property: organizationservice.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2019-11-10 12:58:34.319  INFO [personservice,13631e6ef2efe358,e0bbcecf5f7c349f,true] 6 --- [zationservice-1] c.netflix.loadbalancer.BaseLoadBalancer  : Client: organizationservice instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=organizationservice,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
2019-11-10 12:58:34.332  INFO [personservice,13631e6ef2efe358,e0bbcecf5f7c349f,true] 6 --- [zationservice-1] c.n.l.DynamicServerListLoadBalancer      : Using serverListUpdater PollingServerListUpdater
2019-11-10 12:58:34.535  INFO [personservice,13631e6ef2efe358,e0bbcecf5f7c349f,true] 6 --- [zationservice-1] c.netflix.config.ChainedDynamicProperty  : Flipping property: organizationservice.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2019-11-10 12:58:34.556  INFO [personservice,13631e6ef2efe358,e0bbcecf5f7c349f,true] 6 --- [zationservice-1] c.n.l.DynamicServerListLoadBalancer      : DynamicServerListLoadBalancer for client organizationservice initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=organizationservice,current list of Servers=[10.1.0.190:8085],Load balancer stats=Zone stats: {unknown=[Zone:unknown; Instance count:1;       Active connections count: 0;       Circuit breaker tripped count: 0;       Active connections per server: 0.0;]
},Server stats: [[Server:10.1.0.190:8085;       Zone:UNKNOWN;   Total Requests:0;       Successive connection failure:0;        Total blackout seconds:0;       Last connection made:Thu Jan 01 00:00:00 GMT 1970;
First connection made: Thu Jan 01 00:00:00 GMT 1970;    Active Connections:0;   total failure count in last (1000) msecs:0;     average resp time:0.0;  90 percentile resp time:0.0;    95 percentile resp time:0.0;       min resp time:0.0;      max resp time:0.0;      stddev resp time:0.0]
]}ServerList:org.springframework.cloud.kubernetes.ribbon.KubernetesServerList@5bae3a6b
2019-11-10 12:58:35.345  INFO [personservice,,,] 6 --- [erListUpdater-0] c.netflix.config.ChainedDynamicProperty  : Flipping property: organizationservice.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2019-11-10 12:58:35.502  INFO [personservice,13631e6ef2efe358,15c75b9a4006485a,true] 6 --- [ionThreadPool-1] c.p.service.OrganizationServiceData      : calling fallback method to get the organization data for id 1

Ribbon 客户端获取运行组织服务的 Pod 的 IP 地址。当前服务器列表=[10.1.0.190:8085]

这是我的个人服务 application.yml

spring:
  cloud:
    kubernetes:
      ribbon:
          mode: SERVICE
organizationservice:
        ribbon:
            MaxAutoRetries: 2
            MaxAutoRetriesNextServer: 0
            OkToRetryOnAllOperations: true
            ServerListRefreshInterval: 2000
            ConnectTimeout: 10000
            ReadTimeout: 1000

人女士依赖性

compile "org.springframework.cloud:spring-cloud-starter-kubernetes-all"
compile('org.springframework.cloud:spring-cloud-starter-netflix-ribbon')

检查组织 pod 的日志后。尚未接到任何电话。

Edit 1:在更改假装服务的日志级别后,我发现 JWT 令牌默认开始传递。我使用过滤器解决了这个问题,但是当我不使用 Spring Cloud kubernetes 时,相同的应用程序正在使用过滤器。


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

假装客户端无法拨打电话 - Kubernetes 的相关文章

随机推荐