简体   繁体   English

无法访问基本Fabric Azure WebAPI OWIN无状态服务

[英]Can't access a basic Fabric Azure WebAPI OWIN stateless service

After following the tutorial , I've succeeded running it on localhost:8534/simpleprime/api/values/ * having the same result as the tut. 在完成本教程之后 ,我已成功在localhost:8534/simpleprime/api/values/ *上运行它,其结果与tut相同。

Later publishing the solution to a remote cloud cluster, I couldn't access it using www.clusterurl:8534/api/values , timing out each time. 稍后将解决方案发布到远程云集群,我无法使用www.clusterurl:8534/api/values访问它,每次都超时。 Even though I got reassuring event diagnostics from Visual Studio during the deploy. 即使我在部署期间从Visual Studio获得了令人放心的事件诊断。

I've also tried each of the nodes seperetly, going to http://node_ip:8543/simpleprime/api/values , without any luck 我也尝试了每个节点,转到http://node_ip:8543/simpleprime/api/values ,没有任何运气

一堆令人放心的诊断

  • simpleprime is the appRoot simpleprime是appRoot

If you want to access your service with OWIN listener on Azure, you should define ports that will be used by your application for the LoadBalancer during cluster creation. 如果要在Azure上使用OWIN侦听器访问服务,则应在群集创建期间定义应用程序将用于LoadBalancer的端口。

If you for some reason forgot you can do it later by: 如果您出于某种原因忘记了以后可以通过以下方式完成:

SERVICE PART 服务部分

  1. Go to PackageRoot/ ServiceManifest.xml of your service with OWIN Listener 使用OWIN Listener转到服务的PackageRoot / ServiceManifest.xml
  2. Define your endpoint directly (so SF will use your definied port number) (in my example 8081) 直接定义您的端点(因此SF将使用您的定义端口号)(在我的示例8081中) 在此输入图像描述

  3. Re-publish application to Azure. 将应用程序重新发布到Azure。

AZURE PART AZURE PART

  1. Go to Azure Portal 转到Azure门户
  2. Find the Load Balancer that is assigned to your SF (LB-nameofyourSF-namofNodeSet) 找到分配给SF的负载均衡器(LB-nameofyourSF-namofNodeSet)
  3. In LoadBalancer settings go to Probes and add new probe like on the image below with your Port defined in ServiceManifest.xml ( on my example 8081 ) and Protocol TCP 在LoadBalancer设置中,转到探针并添加新探针,如下图所示,使用ServiceManifest.xml在我的示例8081上 )和Protocol TCP中定义的端口 在此输入图像描述
    1. Add new Load balancing rule with your port and probe defined earlier and the correct port mapping (in my example 8081): 使用前面定义的端口和探针以及正确的端口映射添加新的负载平衡规则 (在我的示例8081中):

在此输入图像描述

  1. Save and now you should be able to access your service on Azure via browser. 保存,现在您应该可以通过浏览器访问Azure上的服务。

Finally solved it, inside the service port config (aka ServiceManifest.xml ) there is a port setting. 最后解决了它,在服务端口config(又名ServiceManifest.xml )里面有一个端口设置。 After changing it to 19080 - the default http port my cluster was listening to, everything started working. 将其更改为19080 (我的群集正在侦听的默认http端口)后,一切都开始工作了。

ServiceManifest.xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM