简体   繁体   English

Openshift 3在线启动器和路由

[英]Openshift 3 Online Starter & Routing

I have a starter (free) tier account with Openshift online. 我有一个Openshift在线入门(免费)套餐。 I have an application consisting of two pods, a Node and a Mongo. 我有一个包含两个Pod,一个Node和一个Mongo的应用程序。 The pods build and deploy; 吊舱构建和部署; from the terminal that executes in the web console on the running Node pod I can run curl localhost:8080 and the Node process obligingly spits back my base page. 从正在运行的Node pod上的Web控制台中执行的终端上,我可以运行curl localhost:8080 ,并且Node进程会强制返回我的基本页面。

I have a route that was autogenerated; 我有一条自动生成的路线; the web console gives me a link to <myappname>.stuff.starter-east-1.openshiftapps.com and appears to correctly reference the Node service that sits on top of the running Node pod. Web控制台为我提供了指向<myappname>.stuff.starter-east-1.openshiftapps.com的链接,并且似乎可以正确引用位于正在运行的Node窗格顶部的Node服务。

However, when I point my browser at that hostname, I get the Openshift error page that tells me that either the route or path was not typed correctly, or the pod isn't running. 但是,当我将浏览器指向该主机名时,会出现Openshift错误页面,该页面告诉我路由或路径未正确键入,或者Pod未运行。

I have tried this with my own code and with the example node packages and I see the same thing. 我已经用自己的代码和示例节点包尝试了此操作,并且看到了同样的事情。

When I use the oc tool to query things about my application, I see that I don't have a router resource - but the route claims to have been exposed on a router. 当我使用oc工具查询有关我的应用程序的信息时,我发现我没有路由器资源-但该路由声称已暴露在路由器上。 So I think I'm using some kind of default router in the node, and I don't have to launch one in my project, but I'm not sure. 因此,我认为我在节点中使用某种默认路由器,而不必在我的项目中启动一个默认路由器,但我不确定。 Most of the other questions around this topic are for people using the Enterprise product and running on their own hardware, where they have more control at the admin layer over the router package; 有关该主题的其他大多数问题都是针对使用Enterprise产品并在自己的硬件上运行的人们,他们在路由器软件包的管理层拥有更多控制权; all the suggestions seem to imply that for the Online product this 'just works'. 所有建议似乎都暗示对于在线产品而言,这“行之有效”。 Any ideas what I am missing? 有什么想法我想念的吗?

Update : After some period of time, the example project did work and a browser request was serviced with the basic example page. 更新:经过一段时间后,示例项目开始运行,基本示例页面为浏览器请求提供了服务。 Looking at the two setups I cannot see any differences, or why my route (in my custome app) never gets activated but the sample project route does. 查看这两种设置,我看不到任何差异,也看不到为什么我的路线(在我的自定义应用程序中)从未激活,但示例项目路线却没有激活。

Turns out the issue was that my application (node) was listening to localhost:8080, when it needs to be listening to 0.0.0.0:8080. 原来问题是我的应用程序(节点)在监听localhost:8080时需要监听0.0.0.0:8080。 I'm not enough of a networking guy to explain why that matters to the router but it does. 我还没有足够的网络专家来解释为什么这对路由器很重要,但是确实如此。

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

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