Openstack Trove探究(1)- 从API认识trove

来源:互联网 发布:网络成瘾诊断标准 编辑:程序博客网 时间:2024/05/18 00:18

背景

Trove是Openstack官方的database-as-a-service项目,最初大家都以Amazon的RDS与之比较,现在开来,小看了Trove的野心,trove的代码中已经开始支持很多NoSQL数据库的管理。不再多说,这里先从API和功能上来认识trove。

API中涉及的资源和操作

resourceoperationdb_instance list all database instances create a new database instance get information about a specific database instance delete a specific database instancedb_instance_actionrestart a specific database instance resize a specific database instance resize the volume of a specific databse instancedatabasecreate a new database on an instance list database on a instance delete a databse on an instanceusercreate a new user list users change users' password get details for user list users' database add database privileges to user  remove database privileges for user enable root user get the status of root user delete userflavorlist all flavors get aspecific flavorsecurity_grouplist all security groups get details for a specific security group create a new rule for a security group delete a specific security group rulebackuplist all backups get details for a pecific backup create a backup for an instance restore a backup to instance delete a backupdatastorelist all datastores get detailfs for a specific datastoredatastore_versionlist all versions for a datastore get details for a datastore versionconfigurationget a list of defined configuration groups for the tenant get the specified configuration group get a list of instances that are associated with the configuration create a new configuration group update configuration items replace all configuration items delete a configuration groupconfiguration_parameterget a list of configration parameters get the details of a configuration paramterdb_instance_log(规划中)get a list of all available database logging files for all datastore version get a list of all available database logging files per givern datastore version create and save database logging file entry


API解读

1.这里的datastore和datastore_version是指存储数据的数据库管理程序和它的版本。例如trove现在支持的数据库管理程序有MySQL、cassandra、mongodb,datastore就是指的是这些。而datastore_version是指这些数据库管理程序的版本,例如5.1,还是5.5之类的。这里可以看到对于datastore和datastore_version,只有查询操作,这也是很正常的,对于DBaaS的服务来说,也只能支持指定的若干数据库类型。这两个resource用来在create db instance的时候供用户选择。

2.flavor是从nova中获取的预先设定好的几种虚拟机规格,只提供查询操作,供用户选择。


3.configuration是指数据库程序配置文件中一堆的配置项,这些配置项由key-value的形式组成;
而configuration_parameter是对配置项key的详细信息的记录,它包括配置参数的默认值、是否应该配置、是否可以动态生效以及数据类型是什么。


4.从API我们可以看到security group的操作中没有创建操作,这是因为数据库安全组的目前的设计原则决定的。trove对于security group的目前的设计是:每个数据库实例对应一个安全组,用户不能直接操作安全组,只能添加或删除安全组的规则。未来这个设计可能改变,同时会在加入默认的安全规则集。


5.数据库日志文件可以被保存并上传到swift上。


总结

从Trove的REST API来看,基本上与Amazon的RDS提供的基本功能类似,带有鲜明的关系数据库管理的特征。


疑问

这套API用来管理专门用来处理大数据的NoSQL数据库到底是怎样的?由于database是在instance之下管理的资源,那么创建一个跑在单个虚拟机实例上的Cassandra数据库,有什么用呢?


参考资料

http://docs.hpcloud.com/api/v13/dbaas/#ds_resource-jumplink-span

https://github.com/openstack/database-api/blob/master/openstack-database-api/src/markdown/database-api-v1.md

https://wiki.openstack.org/wiki/Trove/Configurations

https://wiki.openstack.org/wiki/Trove/trove-security-groups

https://wiki.openstack.org/wiki/Trove/trove-versions-types

https://wiki.openstack.org/wiki/Trove/DBInstanceLogOperation








0 0
原创粉丝点击