Metadata service with service grouping
Current implementation of metadata service only allows posting
username,password,hostname to metadata service. This works for MySQL,
however this might not be the case all the time. A cluster have multiple
dependent clusters. For instance SugarCRM depends on MySQL and PHP. So
SugarCRM cluster depends on both MySQL cluster and PHP cluster. Details
exposed by MySQL and PHP varies. MySQL publishes its username,password,ip
where as PHP might publishes some other infromation such as hostIp. So it
is better to have them as generic key value pairs.
AutoScaler publishes
dependencies of a cluster
properties of all clusters
to metadata service using metadata APIs. Cartridge agent within instances
can retrive the properties using metadata API. Below I listed done draft
REST APIs of metadata.
Please note that API endpoint are not yet finalized.
*Get all dependencies of a cluster*
GET /metadata/application/<app_id>/cluster/<cluster_id>/dependencies
c1, c2,c3
*Get properties of a cluster*
GET /metadata/application/<app_id>/cluster/<cluster_id>/properties
username=udara, hostip=192.268.16.90,password=password
*Get a specific property of a cluster*
GET /metadata/application/<app_id>/cluster/<cluster_id>/properties/host
192.168.12.34
GET /metadata/application/<app_id>/cluster/<cluster_id>/properties/password
temp123
*Add dependencies*
POST /metadata/application/<app_id>/cluster<cluster_id>/dependencies
"dependencies":[
{cluster=c1,dependson=c2},
{cluster=c1,dependson=c3},
{cluster=c2,dependson=c4}
]
*Add properties*
POST /metadata/application/<app_id>/cluster/<cluster_id>/properties
"properties":[
{name=host,value=192.168.12.34},
{name=username,value=udara},
{name=password,value=temp123}
]
*Add a property*
POST /metadata/application/<app_id>/cluster/<cluster_id>/properties/username
udara
--
Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware
web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897