GLassFish v4 新特性介紹

 

GFv4 總目標

GlassFish 4.0 將實現 Java EE 7 特性, 致力於 Java EE 7 參考實現。此版本主要要實現以下2個特性:

  1.  對虛擬化的支持
  2.  PaaS的實現

PaaS

PaaS是Platform-as-a-Service的縮寫,意思是平臺即服務。 把服務器平臺作爲一種服務提供的商業模式。雲計算時代相應的服務器平臺或者開發環境作爲服務進行提供就稱爲PaaS。PaaS實現的功能是,一個程序在多臺機器(包括虛擬機)間運行。PaaS可以看做是增加了虛擬特性的擴展DAS。

在GFv4中,實現PaaS 牽涉到4個服務:

PaaS簡化了application的配備、管理和集羣的創建。包含以下特性:

Simplify application deployment by

1.   allowing services that are required by an application to be inferred from the application

2.   allowing services to be used by an application to be specified as part of the application deployment plan,

3.   providing the ability to provision the services for an application based on virtual machines allocated from a cloud,

4.   deploying an application to a cluster that is created for the application,

5.   configuring the application to use the provisioned services.

Simplify application management by

1.   providing application auto-scaling by monitoring application performance and adjusting the resources that are available to the application automatically,

2.   providing the ability to customize the decision making process regarding auto-scaling,

3.   providing complete application services such as backup, backing up not just the domain data, but the service data too.

4.   extending cloud-based application management to the complete application lifecycle (list, enable, disable, undeploy).

Simplify domain creation by

1.   allocating a virtual machine and deploying a DAS to it on behalf of a user,

2.   support the ability to run the PaaS feature itself in the cloud.

 

PaaS把Java EE平臺作爲一項服務提供給用戶,用戶不必關注nodes, clusters, instances, resources, services等等,而是把注意力集中在Java EE application的運行上。

以上特性需要滿足下面要求

能兼容各種底層物理設備作爲IaaS服務和虛擬服務的提供者。

1.      OVM

2.      Amazon Web Services

3.      VirtualBox

4.      Xen

5.      KVM

etc

兼容Java EE applications用到的各種服務。

1.      Java EE container (GlassFish only)

2.      JMS (OpenMQ only)

3.      load balancer (various vendors)

4.      database (various vendors)

etc

 

Architectural Components

Orchestrator

Orchestrator 是最頂層服務,實現將application 配備到cloud上,我把它理解成application運行環境搭建的過程。Orchestrator 運用一系列服務插件,實現在applications上配備各種服務,如database, JMS等。

主要職責:

  • Service Dependency Discovery

確定application配備的必須服務(provisioned services)。既可以通過隱性依賴(implicit dependencies)也可通過顯性依賴(explicit dependencies)的clould.xml文件定義必須服務(provisioned services)。

  • Service Provisioning

向虛擬化管理層(virtualization management layer)申請需要的虛擬機或服務,以及提供虛擬機上的必須服務(provisioned services)。

  • Service Association

根據定義文件(defining resources)把必須服務(provisioned services)和GlassFish上的application關聯起來。

  • Deployment

運用必須服務(provisioned services)把application配備到GlassFish上。

Elasticity Manager

Elasticity manager負責部署到服務器上的application的性能,利用監測數據調整資源利用策略。

主要功能:

Metric collection – 數據蒐集。蒐集有關application使用狀況和機器資源狀況的數據,作爲decision making process的依據。

Scaling decisions – 制定決策。決策包括增加/刪除instances數量,or other methods of scaling such as informing users.

Action execution –執行決策。策略制定後,Elasticity manager必須執行此決策。

IaaS Management Service (IMS)

Infrastructure as a Service (IaaS) management service爲GlassFish提供API管理雲端IaaS。是對application在雲端的物理資源層面的管理。

IaaS management Service負責執行Elasticity manager和Orchestrator的決策。如果IaaS提供VM-level的監控服務,那麼IaaS management service將蒐集到的IaaS決策 (比如轉移一個VM)的信息,交給Elasticity manager,Elasticity manager將這些數據運用Elasticity算法均衡virtual machines在groups間的分配。但是IaaS management Service只能在本virtual machines運行的實體機上執行決策。

Groups

主機被分成group。Groups可以是按地理位置確定,也可以是基於網絡邊界的。這些groups 由實體機組成,共享同樣的虛擬服務(libvirt, jclouds..)。It is unclear how well such groups will map to public clouds offerings (at worst I suppose you have a single group).

IaaS management service 提供的以下APIs 可以管理group。

1.      組管理 (增/刪machines).

2.      啓動/暫停machines.

3.      預定義模版安裝virtual machines

4.      分配/釋放virtual machines

5.      監控分配出的virtual machines,提供監控數據

IaaS management service不維護clusters和已部署的applications列表,這是DAS的功能。他主要職責是在實體機上運行虛擬機The IaaS management service for libvirt should be implemented on top of GlassFish nucleus distribution.

Domains Manager

Domains Manager負責自動在cloud中創建domain。Domains manager 可以是命令行的形式,也可以是提供一個 GUI 控制界面,也可以是用於配備application 的APIs。Domains manager是可選的,原因是PaaS管理員可以手動分配VM,在上面創建GlassFish domain,配置domain啓用IMS。

Domains Manager包含以下功能:

爲GlassFish用戶:

1.      創建賬戶/登陸控制檯

2.      選擇要運用的cloud,蒐集cloud證書(credentials)存入IaaS management service中。

3.      創建Java EE domain。利用IaaS management service創建VM,在VM上創建Java EE domain,在Java EE domain上安裝GlassFish,創建domain,將IaaS management service地址傳給domain。(後臺進行了虛擬機的選擇,如OS類型、web/full版本etc)

4.      domain控制檯

5.      顯示用戶創建的domains列表

6.      刪除domain

7.      提供一體化的控制檯。能直接將applications配備到domain上,在接口中隱藏domains的存在。

8.      與PaaS infrastructure相適應的任務調度。

9.      物理資源監控報告、利用監聽器在cloud需求達到極限的時候發出資源枯竭警告。

爲PaaS管理員

1.      查看GlassFish用戶(擁有GlassFish用戶所有權限)

2.      決定使用哪個IaaS management service

3.      爲IaaS management service提供UI (tdb—IaaS management service可以有自己的UI)

Domains manager類似於PaaS用戶的一個接入點。它可以爲DAS創建VM。但是它不處理applications, 不爲集羣化的instances和其他服務創建虛擬機。它沒有爲服務提供商提供可插入接口。

運行在GlassFish的DAS上的Domains manager

Domains manager的生命週期開始於手動安裝包含PaaS機能的GlassFish。需要運行在另一個GlassFish domain上,區別於其他被管理的domains。如果GlassFish domain 運行在cloud內部,cloud infrastructure 的工具手動創建domain 的VM。

Domains Manager Data Store

Domains manager存儲一下信息:

1.      用戶存儲配置 (如何鑑別用戶)

2.      IaaS management service配置信息(IaaS Management Service在Domains manager何處使用)

3.      per-user domain配置信息

DAS在哪裏 (console URL, VM地址)

哪個IaaS management service被使用

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章