You are on page 1of 5

2013 International Conference on Mechatronic Sciences, Electric Engineering and Computer (MEC)

Dec 20-22, 2013, Shenyang, China

A Unified API Gateway


for High Availability Clusters
Qian Zhang#*, Hanyue Chu* Mingyu Li*, Xiaohui Hu*
# *
Institute of Software Chinese Academy of Sciences Sci. and Tech. on Integrated Info. System Laboratory
University of Chinese Academy of Sciences Institute of Software Chinese Academy of Sciences
Beijing, China Beijing, China
{zhangqian11, hanyue}@iscas.ac.cn {mingyu, hxh}@iscas.ac.cn

Abstract—High-availability (HA) clusters are widely used to occurs when a company intends to integrate legacy
provide high availability services. Recently, many HA cluster applications.
solutions and products have been proposed or developed by
different organizations. However, each HA cluster system has its
own administrative tool and application programming interface
(API). Besides, vendor lock-in makes customers dependent on the
specific vendors’ own high availability clusters. Therefore, it is
very complicated to simultaneously manage various HA clusters.
To solve this problem, a novel SOA-based Unified API Gateway
for high-availability Clusters (UAGC) is proposed in this paper.
Under UAGC, cluster services are conveniently managed in a
unified way, which is independent of platforms or programming
languages. Six web service interfaces are implemented in UAGC
to cover most cluster functions. A UAGC-based web service
(UAGCService) is implemented with WCF. The experimental
results show that UAGCService has good performances.

Keywords—SOA-based; API gateway; administrative tool;


Fig. 1. Unified Management of HA Clusters
Cluster Consolidation
In order to solve the practical and emerging problem, a
I. INTRODUCTION unified API gateway for HA clusters is proposed in this paper.
With the growing use of services in cloud computing, the With the Unified API Gateway for Clusters (UAGC), the
high availability of services becomes increasingly important public interfaces and operations are provided to manage
[1]. Any little downtime of services will cause great economic different cluster services, and therefore to enhance convenience
losses. High-availability (HA) cluster minimize the downtime and efficiency.
of critical services or applications when there comes system or The rest of this paper is organized as follows: Section II
server failure. Today, many cluster service providers developed gives a brief overview of related works; Section III and Section
their own high-availability cluster software and management IV presents the design and implementation of UAGC; Section
tools, such as RoseHA, NEC HA, Microsoft Cluster Service V states the results of experiments; The paper is concluded in
(MSCS) [2] and Linux-HA [3]. Each cluster service solution Section VI.
defines its own particular APIs, and makes it not easy to
consolidate different cluster services.
II. RELATED WORK
Without a unified management tool, services running on
different HA clusters are maintained separately with private A. High-Availability Cluster
APIs or tools provided by different vendors. Configuration is High-availability clusters [4], namely failover clusters or
complicated because the operations and interactive methods HA clusters are a set of computers that guarantee availability
vary among solutions and products. There is a scenario. As goals with minimum downtime for services and applications.
shown in Figure 1, a company has multiple applications HA clusters utilize redundant computers in groups that
running on Windows, Linux and other platforms. Different HA maintain services when system fails. The configurations of
cluster solutions must be studied in order to construct HA high-availability clusters are categorized into three models:
clusters on different platforms to guarantee the high availability active/active, active/passive, and multi active/passive. Cluster
of critical services. It is necessary to integrate user interfaces of administrative tools are usually backend GUI or command-line
different cluster solutions. Meanwhile, vendor lock-in is components. Cluster administrative tools run on each cluster
created by commercial solution providers for business or sale node to manage and configure the complete cluster server or
considerations. The above-mentioned problem frequently manage and configure a set of services. Nowadays, there are
many HA cluster management products and solutions from
This work was supported by the National High Technology Research
and Development Program of China (863 Program) No.2012AA011206
and Beijing Municipal Natural Science Foundation No.4133092.

978-1-4799-2565-0/13/$31.00 ©2013 IEEE 2321


kinds of vendors. Some components of those solutions are A. SOA-based Architecture
regarded as cluster administrative tools [5].
RedHat Cluster Suite (RHCS) [6] and Linux-HA [3] are
two typical HA cluster solutions on Linux. Pacemaker, also
known as a cluster administrative tool, is a high-availability
resource manager and Linux-HA is configured with
pacemaker. Conga is also a cluster administrative tool and
RHCS is configured with Conga. Meanwhile, there are some
commercial products and solutions on other OSs, such as
Microsoft Cluster Server (MSCS). Cluster.exe is a command-
line interface for managing MSCS.
Some solutions also have high-availability feature. For Fig. 2. Legacy Encapsulation Patterns
instance, the Linux Virtual Server (LVS) [7] is used to build
highly available and highly scalable services. The Linux Fig. 2 shows a legacy encapsulation pattern of SOA
Virtual Server built with a load balancer is a well-known Load- [12][13]. Service consumers directly invoke the legacy APIs
Balance Cluster. High-availability features in the LVS are not with the traditional implement. However, with the legacy
considered in this paper. encapsulation pattern, service consumers invoke the custom
legacy wrapped service by evolving or replacing the legacy
implementation to minimize the impact on existing service.
B. Consolidated Cluster systems
Original high-availability cluster systems need to evolve the
With the growing of the large-scale infrastructures, legacy wrapped services, and high-availability clusters
traditional clusters cannot address new challenges in the cloud consolidation are achieved. With the legacy encapsulation
age [8]. Consolidated cluster systems can be used to solve the pattern, the architecture of UAGC is extracted.
problems. Nevertheless, there are only a few studies on
heterogeneous consolidated cluster issues.
There are two typical consolidation modes: unified and
extensional. The original clusters consolidated in the unified
mode are interfered by consolidated cluster system. Mesos [9]
is a typical unified consolidated cluster system. Mesos is a
resource scheduler and distributor across different original
clusters such as Hadoop, MPI, and Spark, with modifications
of original implementation of the clusters. Yarn [10] is also a
unified consolidated cluster system. The extensional
consolidated mode is without interference from the original
clusters. Original clusters are directly integrated by the 
consolidated cluster system via existent interfaces in this mode, Fig. 3. Architecture of UAGC
such as HTCondor [11]. However, all the original clusters in
the consolidated cluster systems are high performance As shown in Fig. 3, the proposed UAGC mainly consists of
computing (HPC) clusters. Those systems are not designed for three parts: Clusters, Cluster Service API Gateway, and Web
consolidating heterogeneous HA cluster. Service Client.
Clusters, which are shown in the right part of Fig.3,
III. ARCHITECTURE OF THE PROPOSED UAGC indicate cluster service products. The part is legacy implement
In the cloud age, the large-scale infrastructures on the shown in Fig.2. MSCS (Microsoft Cluster Service), Linux-HA
clusters bring about big challenges on the management of data and other related cluster service solutions are supported.
centers. In order to minimize the total cost of business, Cluster Service API Gateway and Clusters are custom
traditional clusters are inevitable to be consolidated. Some legacy wrapped service. Cluster Service API Gateway, which is
Most legacy applications in different HA clusters are integrated shown in the middle part of Fig.3, contains a cluster service
to the consolidated clusters in data centers. However, these abstract API for Clusters and various clusters drivers. The API
applications cannot be modified. This problem can be Gateway works as a wrapper around different cluster services,
addressed by unified these applications in the unified mode. abstracts their differences, and then produces unified interfaces.
For this reason, a SOA-based uniform API gateway is proposed For each cluster service product or solution, Cluster Service
for HA clusters in this paper. API Gateway offers unified interfaces of cluster service
The rest of this section is organized as follows. First, SOA- provider’s native API. Thus, Cluster Service API Gateway
based architecture of UAGC is presented. Second, web-service frees users from dealing with the differences of each cluster’s
interfaces of UAGC are introduced. Finally, service invocation unique API. The various kinds of drivers can deal with the
mode mechanism of the UAGC is stated. differences among the clusters. Therefore, Cluster Service API
Gateway is the most critical component in the UAGC. It as an
adapter plays a major role in different HA cluster service
solutions.

2322
Web Service Client, which is shown in the left part of Fig. 3) Cluster Resources
3, namely service consumers, can use any language or platform Each application is regarded as a kind of resources.
to invoke the Cluster Service API Gateway. The languages Resource management and scheduler is the key part in the
supported include C++, C#, Java, et al. Web Service Client can management of the cluster. All the operations and information
start or stop an instance of the cluster service by using the same monitoring functions of critical resources are covered by
method, no matter which OSs such as Windows or Linux are resource interfaces. For example, view resources’ availability
running. Therefore, the operations provided in Web Service status; create, delete, rename, move, online, or offline the
Client are simple. Original clients can manage cluster service resources in specified group; add, view, and remove the
from multi-platforms with a unified method. dependency between resources in a group and the owner node
of the specified resource. The properties of clusters and cluster
In summary, UAGC provides a method to maintain cluster
nodes can also be obtained and set by using the interface of the
services in a more familiar and convenient way. Meanwhile,
Cluster Resources.
UAGC preserves the compatibility amongst diverse cluster
services. Besides, UAGC supports almost all major HA cluster 4) Cluster ResourceType
services. Thus, consumers can build and manage the HA A type is one of the properties of resources. A new resource
clusters more easily with the proposed UAGC. type is created when new application frameworks are
consolidating. The type of resource can be deleted, got or set
information (the owner list and properties). Generally, these
properties include name, interval setting to judge whether the
resources is running or not , and some related files of the
resource type such as dynamic-link library in Windows,
configuration files in Linux.
5) Cluster Network
Cluster network provides a uniform interface for
communicating with the other nodes. Through the cluster
network and cluster network interface, node failures can be
 detected based on heartbeats. In fact, the cluster network is a
Fig. 4. Interfaces of Cluster Service API Gateway
supporting component in Cluster Service API Gateway. The
operations about cluster network are very simple. The main
B. Web-service Interfaces function of cluster network is to display the basic information
Cluster Service API Gateway has six types of interfaces, and status of the cluster network. Through the cluster network,
including Cluster and Cluster Node, Cluster Group, Cluster the cluster network status (connected or disconnected) can be
Resources, Cluster ResourceType, Cluster Network, and gained. Cluster network’s properties such as network name,
Cluster Network Interface, as shown in Fig. 4. network address, network address mask, network description,
and network communication role can be viewed or set by using
1) Cluster and Cluster Node Cluster Service API Gateway.
All the operations of cluster and cluster nodes are included
in the interface of the cluster/cluster Node. The status 6) Cluster Network Interface
information of monitored clusters and cluster nodes can be Cluster network interface is also a supporting component in
obtained. And clusters and cluster nodes can also be created, Cluster Service API Gateway. Cluster network interface’s
removed, stopped, started, suspended, and resumed. The status (connected or disconnected) can be obtained to
properties of clusters and cluster nodes can be got or set determine the situation of the node network. Properties of the
through the interface of the Cluster/Cluster Node. cluster network interface, including cluster network interface
name, cluster network name, cluster node name, cluster
2) Cluster Group network adapter and adapter ID, cluster network interface
Cluster Group represents resource group. Interdependent address, can also be viewed through cluster network interface.
resources are grouped into many cluster groups. For instance, a Note that the interface address is different from the network
MySQL resource group meanwhile includes database resource address. The interface address means a machine address, for
required to the services, associated network resources including example 192.168.0.123, but the network address means a
network name and IP address, and the used physical disk network address, for example 192.168.0.0. Through the status
resource. All the operations of resource groups are included in and information of cluster network and cluster network
the interface of the Cluster Group. Users can get the vital interface, cluster service can control the resource failover and
information about management of resource groups, including failback between nodes.
the status (online, offline, partially online). Users also can
create, delete, remove, start, stop, online, offline, rename the C. Service Invocation Mode
cluster group. The properties of clusters and cluster nodes can
At the web service client, making synchronous calls to
be obtained and set through the interface of the cluster group,
some cluster services can lead to failure occasionally because
including the information (failover period, failover threshold,
of time delay, because synchronous calls are blocking and
auto failback type, failback window start and end) about
some cluster services can lead to considerable delay
failover and failback.
sometimes, for example, service failover. Asynchronous

2323
calling pattern of cluster services is devised to avoid this • Binding. It specifies the communication pattern,
problem. For an asynchronous call, other processes are including transport protocols , message encoding, etc.
permitted to continue before the transmission has finished. The WCF defines eleven types of bindings. Five of them are
asynchronous calls of cluster services comprise of the commonly used, namely: Basic binding, TCP binding,
following operations as shown in Table 1. IPC binding, Web Service (WS) binding, and MSMQ
binding. WS binding is used in UAGCService to ensure
TABLE I. ASYNCHRONOUS FUNCTIONS
reliability and security.
Cluster and Cluster Node Cluster Resources • Address. Each service is associated with a unique
CreateNewCluster CreateNewClusterResource address in WCF. An address in WCF consists of
CreateNewNode DeleteClusterResource transport protocols, the location of the server, the port
SetClusterProperty OnlineClusterResource and the name of the service. For instance,
StopNodeClusterService OfflineClusterResource http://uagc.ha.local:9001/UAGCService.
StartNodeClusterService SetResourceProperty
SetNodeProperty ResourceRestartAction UAGCService is configured specially in terms of security,
Cluster Group ResourceThreshold service connection, and WCF service proxy initialization.
CreateNewClusterGroup ResourceRestartPeriod
DeleteClusterGroup ResourcePendingTimeout
OnlineClusterGroup ResourceRetryPeriodonFailure
OfflineClusterGroup MoveResourceToOtherGroup
SetGroupProperty RenameResource
GroupFailoverThreshold AddResourceOwner
GroupFailoverPeriod RemoveResourceOwner
GroupAutoFailbackType SetResourceFail
GroupFailbackWindow AddResourceDependency
SetGroupOwners RemoveResourceDependencies
MoveGroupToOtherNode SetClusterQuorum
RenameGroup Cluster ResourcesType
SetClusterGroupNode CreateClusterResourceType
Cluster Network DeleteClusterResourceType
SetNetworkProperties SetResourceTypeProperties
RenameClusterNetwork Cluster Network Interface
SetNetworkInterfaceProperties
There are several kinds of results returned from the
interfaces. If parameters are entered correctly and operations
are executed successfully, then the information of the correct Fig. 5. An Implementaiton of the UAGC based on WCF
results will be returned. On the contrary, if the parameter
inputted is incorrect, the tips for input errors will be offered by Security. The endpoints of different services are invoked by
the cluster services API gateway. And if parameters are entered a client. In UAGCService, the security of communication with
correctly and the operations failed, the information of system two parties is guaranteed with the Kerberos protocol. The user
errors will be returned to remind the users. rights authentication is based on username and password. A
client cannot call the services until it passes the authentication,
IV. IMPLEMENTATION OF UAGC as shown in the right part of Figure 5.
A UAGC-based web service (UAGCService) is In this paper, six interfaces and over sixty HA cluster
implemented with Windows Communication Foundation functions are implemented in UAGCService.
(WCF).
WCF [14] is a set of tools based on .NET Framework for V. EXPERIMENTAL RESULTS
implementing Web Service applications. It is designed with The performance of UAGCService is tested for a MSCS
SOA principles for distributed and interactive applications. (Microsoft Cluster Server) Cluster running on Windows 2003
WCF-based applications commonly run on Windows, but they Servers. Three experiments are conducted: 1) the time
can also run on Linux with Mono [15]. So the Linux-HA driver consumed in connecting to UAGCService for the first time; 2)
of UAGCService is also implemented with WCF. In WCF, the time of executing some operations of MSCS with server; 3)
services are identified by endpoints which are described by the time of executing some operations of MSCS with client.
contracts, bindings and addresses, as shown in Figure 5.
Without UAGC, remote administrations of MSCS Clusters
• Contract. In WCF, contracts describe what services are usually performed with Windows Powershell and Telnet.
exposes in a platform-neutral and standard way. WCF And the operations are ultimately carried out by cluster.exe on
defines four types of contracts: service contract, data the servers. Windows Powershell is a task automation
contract, operation contract, and message contract. The framework built on .Net. Powershell controls administrative
former three types are used to outline the tasks with command-line and scripting language. Telnet
UAGCService. However, message contracts are suitable provides a command-line interface to access to a remote host.
in interoperability cases so they are not used in The result of Experiment 1 is shown in Table II. WFC service
UAGCService.

2324
proxy is slower than PowerShell, but faster than Telnet. The SOA-based APIs that can be used to manage services on
reason is that when UAGCService is invoked for the first time, different HA clusters. Furthermore, it can be used to avoid
it needs to be initialized, which leads to time consuming. vendor lock-in and integrate heterogeneous platforms.
An implementation of UAGC, called UAGCService is
TABLE II. INITIAL CONNECTION SERVICES WITH CLIENT(TIME:S) described in this paper. The results show that UAGCService
Telnet PowerShell The Proposed Method has good performances.
10.600 0.491 0.979 In the future, the improvement of UAGC will support more
HA cluster service providers and provide the API gateway of
the load-balanced cluster management. The implementation
will be further studied to optimize cluster service management
and simplify the operations.

ACKNOWLEDGMENT
The first author would like to thank Xiaowei Yi from the
Institute of Software Chinese Academy of Sciences for his
meticulous help on language editing.

REFERENCES
[1] V. Chaurasiya, P. Dhyani, and S. Munot. “Linux Highly Available (HA)
Fault-Tolerant Servers,” Information Technology, (ICIT 2007). 10th
International Conference, pp.223-226, Dec 2007.
Fig. 6. The time of Invoking MSCS with Server
[2] W. Vogels, D. Dumitriu, K. Birman, R. Gamache, M. Massa, R. Short,
et al. "The design and architecture of the microsoft cluster service-a
In Experiment 2, the time of invoking MSCS with practical approach to high-availability and scalability," Fault-Tolerant
UAGCService is shorter than with MSCS UI on the local Computing, 1998. Digest of Papers. Twenty-Eighth Annual International
machine, as shown in Figure 6. Symposium, pp.422-431, June 1998.
[3] A. Robertson, "The evolution of the Linux-HA project," UKUUG
LISA/Winter Conference High-Availability and Reliability, June 2004.
[4] Wikipedia, “High-availability Cluster”, http://en.wikipedia.org/
wiki/High-availability_cluster.
[5] Wikipedia, “Cluster manager”, http://en.wikipedia.org/wiki/
Cluster_manager.
[6] RedHat, “Red Hat Cluster Suite Overview – CentOS”, Technical report,
http://www.centos.org/docs/5/pdf/Cluster_Suite_Overview.pdf.
[7] W. Zhang, W. Zhang, “Linux virtual server clusters.” Linux Magazine,
5.11, 2003.
[8] J. Lin, L. Zha, and Z. Xu, “Consolidated cluster systems for data centers
in the cloud age: a survey and analysis,” in Frontiers of Computer
Science, 2013, pp. 1-19
[9] B. Hindman, A. Konwinski, M. Zaharia, A. Ghodsi, A.D. Joseph, R.
Katz, et al, “Mesos: A platform for fine-grained resource sharing in the
data center.” Processdings of the 8th USENIX conference on Networked
Fig. 7. The time of Invoking MSCS with Client systems design and implementation. USENIX Association, pp.22-22,
2011.
In Experiment 3, WCF service proxy invokes [10] Murthy A C, Douglas C, Konar M, O’Malley O, Radia S, Agarwal S, V
UAGCService, and MSCS is invoked by UAGCService. V K. Architecture of next generation apache hadoop MapReduce
However, PowerShell calls MSCS on a remote host. The result, framework. Technical report, Apache Hadoop community, 2011.
shown in Figure 7, states that the WCF service proxy is faster [11] D. Duplyakin, P. Marshall, K. Keahey, H. Tufo, and A. Alzabarah,
“Rebalancing in a multi-cloud environment,” in Proceedings of the 4th
than Powershell. Because each Powershell operation ACM workshop on Scientific cloud computing, New York, New York,
establishes a connection. On the contrary, all of operations for USA, 2013, pp. 21-28.
UAGCService need to establish only one connection, so the [12] Z. Mahmood, “The promise and limitations of service oriented
WCF service proxy is better. architecture”, International Journal of Computers, vol. 1, no. 3, pp. 74 -
78, 2007.
In conclusion, the experimental results show that [13] O. Pandithurai, M. Poongodi, S.P. Kumar, C.G. Krishnan," A method to
UAGCService has better performances than Powershell and support multi-tenant as a service." Advanced Computing (ICoAC), 2011
Telnet. Third International Conference, pp.157-162, Dec. 2011.
[14] J. Lowy, Programming WCF services. O’reilly,2008.
VI. CONCLUSION [15] Mono, www.mono-project.com.
In this paper, a Unified API Gateway for high-availability
Clusters (UAGC) is proposed. UAGC provides a set of unified

2325

You might also like