Cocould Foundry (3) -- Router

Source: Internet
Author: User

I. Overview 

The router component routes all incoming requests in cloud foundry.

There are two main types of requests for accessing the router: management commands from vmcclient or STS. These requests are routed to the applife management component, also known as the cloudcontroller component; the second type is the external request to access your deployed apps. This part of requests will be routed to appexecution or DEAS components.

The system can deploy multiple routers to process the requests, but the loadbalance at the upper layer of the router is not in the Implementation scope of cloudfoundry. cloudfoundry only ensures that all requests are stateless, in this way, the upper-layer Server Load balancer has a very large selection area. It is feasible to use DNS, deploy the hardware loadbalancer, or simply set up an ngnix Server Load balancer.

Ii. Composition Architecture

The current version of the router component is a simple encapsulation of nginx. It consists of ngnix and router. RB. nginx uses the socket file (. Sock file) for input, and router. RB implements the logical encapsulation of nginx. The structure of the router component is as follows:


When the external httprequest enters the cloud foundry server, nginx receives the request first. nginx interacts with router. RB through sock (so the router component is used to process the request ). The router. RB performs logical judgment based on the input URL, user name, password, etc. Data is obtained from the cloudcontroller component or the DEA component and returned through the. Sock file connected to the network controller. Router. Rb is a logical encapsulation of nginx. Those familiar with cloudfoundry must know that cloudfoundry assigns a URL access to each app. If you directly use the cloudfoundry.com hosted by Vmware, your app URL may be xxx.cloudfoundry.com, no matter how many instances are extended to your app by using commands, they are all accessed from this URL. Here, the URL conversion route is forwarded by the router. RB implementation.

Note:: In the second version, because Ruby cannot directly process the request performance, the Lua script is used to receive the request, and then the ruby program returns the result.

Cocould Foundry (3) -- Router

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.