apolloconfig / apollo.net

Apollo .Net Client
Apache License 2.0
481 stars 167 forks source link

net core 版本怎么跳过meta service #54

Closed CsharpLeague closed 5 years ago

pengweiqhca commented 5 years ago

说具体点

CsharpLeague commented 5 years ago

我在appsetting里面配置了MetaServer,因为开发环境放在了公有云上,本地调用的时候地址就转换成公有云的内网地址,怎么才能用公网地址呢

CsharpLeague commented 5 years ago

这是日志 12:40:29 [Debug] refresh config services 12:40:29 [Debug] refresh config for namespace: application 12:40:30 [Debug] Loading config from http://172.16.224.186:9080/configs/InfrastructureService/dev/application?ip=192.168.1.16 12:40:35 [Warn] Could not complete get operation - Could not complete get operation [Cause: The operation has timed out.] 12:40:36 [Warn] refresh config error for namespace: application 12:40:36 [Debug] Long polling from http://172.16.224.186:9080/notifications/v2?appId=InfrastructureService&cluster=dev&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D&ip=192.168.1.16 12:40:36 [Warn] Sync config from upstream repository Com.Ctrip.Framework.Apollo.Internals.RemoteConfigRepository failed, reason: Load Apollo Config failed - appId: InfrastructureService, cluster: dev, namespace: application, url: http://172.16.224.186:9080/configs/InfrastructureService/dev/application?ip=192.168.1.16 [Cause: Could not complete get operation [Cause: The operation has timed out.]] 12:40:36 [Warn] Loading config from local cache file C:\opt\data\InfrastructureService\config-cache\InfrastructureService+dev+application.json failed - Loading config from local cache file C:\opt\data\InfrastructureService\config-cache\InfrastructureService+dev+application.json failed [Cause: Could not find file 'C:\opt\data\InfrastructureService\config-cache\InfrastructureService+dev+application.json'.]

pengweiqhca commented 5 years ago

https://github.com/ctripcorp/apollo/wiki/%E9%83%A8%E7%BD%B2&%E5%BC%80%E5%8F%91%E9%81%87%E5%88%B0%E7%9A%84%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98#6-客户端多块网卡造成获取ip不准如何解决

CsharpLeague commented 5 years ago

不太明白您上面那个链接实现,在分布式部署里面的网络策略不是有这么一句话吗,在netcore中怎么实现 如果Apollo部署在公有云上,本地开发环境无法连接,但又需要做开发测试的话,客户端可以升级到0.11.0版本及以上,然后通过-Dapollo.configService=http://config-service的公网IP:端口来跳过meta service的服务发现

pengweiqhca commented 5 years ago

建议使用https://github.com/ctripcorp/apollo/wiki/%E9%83%A8%E7%BD%B2&%E5%BC%80%E5%8F%91%E9%81%87%E5%88%B0%E7%9A%84%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98#方案二强制指定admin-server和config-server向eureka注册的ip 跳过meta service的功能还没有实现,后面再添加

pengweiqhca commented 5 years ago

功能已经添加 https://github.com/ctripcorp/apollo.net/pull/55 ,更新最新的包

CsharpLeague commented 5 years ago

好的

jinwenming commented 5 years ago

是不是只需要在appsettings.json中加入这一行就可以了?"ConfigServer": "http://192.168.1.113:8080",但我加入后还是获取不到数据

CsharpLeague commented 5 years ago

"ConfigServer": ["http://106.12.25.204:8080/"]少了中括号