You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by "Imesh Gunaratne (JIRA)" <ji...@apache.org> on 2013/12/09 04:45:07 UTC

[jira] [Resolved] (STRATOS-123) Implement Support for Multi-Tenancy

     [ https://issues.apache.org/jira/browse/STRATOS-123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Imesh Gunaratne resolved STRATOS-123.
-------------------------------------

    Resolution: Fixed

Changes have been committed with commit revision: 57cccfbf83c3c3b7a322cd6b3124a74eae08ce29.

How it works:
- According to the discussions had on Multi-Tenancy support, Stratos Manager publishes tenant information to the message broker via a topic. 
- A sample complete tenant event message:
{"tenants":[{"tenantId":1,"tenantDomain":"foo.org","serviceNameMap":{"app-server":true}},{"tenantId":2,"tenantDomain":"abc.org","serviceNameMap":{"app-server":true}}]}
- Events: CompleteTenantEvent, TenantCreatedEvent, TenantUpdatedEvent, TenantRemovedEvent, TenantSubscribedEvent, TenantUnSubscribedEvent.
- These event messages are received by load balancer and a corresponding tenant data model is maintained.
- Multi-tenancy is enabled in load balancer and tenant identifier is specified either as tenant-id or tenant-domain. 
- Then tenant identifier regular expression is defined: default: t/([^/]*)/. This is used to scan the request URL and find the tenant identifier value.
- Load balancer maintains two hash maps:
  - Map<HostName, Cluster>: map hostname to cluster
  - Map<HostName, Map<TenantId, Cluster>>: map hostname, tenant id to cluster
- When a request is received if multi-tenancy is disabled it will use Map<Hostname, Cluster> map to identify the service cluster and forward the request to the next available member.
- If multi-tenancy is enabled: it will scan the request URL using the regular expression given and find the tenant identifier value.
- Then the matching cluster will be identified using Map<HostName, Map<TenantId, Cluster>>.

> Implement Support for Multi-Tenancy
> -----------------------------------
>
>                 Key: STRATOS-123
>                 URL: https://issues.apache.org/jira/browse/STRATOS-123
>             Project: Stratos
>          Issue Type: Sub-task
>            Reporter: Imesh Gunaratne
>            Assignee: Imesh Gunaratne
>             Fix For: 4.0.0 M5
>
>
> To provide support for multi-tenant applications, the load balancer needs to identify the host name (or mapped domain name if available) and the tenant id from the incoming request and delegate that request to the next available member in the relevant cluster.
> Tenant Definition:
> - A tenant could be partitioned into clusters by defining tenant ranges for each cluster.
>   Example: (Cluster 1 - Tenant Range: 1-100, Cluster 2 - Tenant Range: 101-200, Cluster 3: Tenant Range: 201-*)
> - Each tenant needs to define an id and a domain name.
> Properties found in the Request URL:
> - Host name
> - Tenant id or tenant domain name
> Required Functionality:
> 1. If tenant id is found in the request URL identify the cluster and delegate the request to the next available member.
> 2. If tenant domain is found in the request, find the tenant id using the available tenant information and execute 1.
> Tenant Information:
> Stratos Manager (SM) needs to publish tenant information to a message broker topic so that coupling between the load balancer and SM is less. As a result the load balancer could operate in isolation just by communicating with the message broker.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)