zoukankan      html  css  js  c++  java
  • Trove系列(五)—Trove的数据存储管理程序类型和版本管理功能介绍

    功能描述数据存储管理程序(Datastore)类型管理允许Trove的用户从操作者列出的名单中选择数据库存储管理程序和版本。操作者将可以控制数据库存储管理程序的类型,添加一个新的版本并去活一个老版本。为了实现这个功能,用户可以指定数据库存储管理程序类型和可选择的版本。数据库存储管理程序类型是一种数据库引擎的家族,诸如:mysql, mongodb, cassandra 等。
    数据库存储管理程序版本定义了引擎的版本以及为了实现这个引擎所包含的系统包。每种datastore类型具有几个引擎的版本,每种类型有一个缺省的版本。 版本具有激活或者未激活状态。 用户可以用激活的版本创建数据库实例。未激活的版本对用户不可见,用户不可以用未激活的版本创建数据库实例。 但是未激活的版本可以被已经运行的实例使用。
    对每种datastore类型而言,操作者可以指定运行实例的操作系统镜像。对每种类型的每个版本而言,操作者可以指定不同的镜像。这样我们可以灵活的选择镜像,数据库类型和版本。
    每个版本应该指定系统包的列表。 这些系统包提供了指定数据库的指定版本的在指定镜像上的安装。
    这里有可能只指定一个包。但是大多数情况下需要指定多个具有确切版本的包。 对于mysql 来说,你可以指定server, client, shared 和 shared-compat 包。这种情况只在你有不只一个可用版本的情况下才影响。 例如: 如果你仅仅指定 "mysql-server-5.5" 包,但是你又有mariadb 和 percona 可用, 你可以将 mysql-server-5.5, mariadb-shared-5.5, percona-client-55 安装上去。
    管理的资源至此,Trove又出现了两种新的资源:datastore_type 和 datastore_version。datastore_type允许操作者定义新的datastore 类型,datastore_type 包含以下数据:id – 一个系统定义UUID值,该值在第一次创建时赋予datastore type.name - datastore type 的名字engine – 提供操作的管理者级别的名字image_id – 镜像的UUID,该镜像将用于实例的部署default_version – 如果用户不指定版本,将使用缺省版本User can see only id and name of datastore type.用户将只能看到id 和 datastore type 的名字 datastore_version资源允许操作者定义指定数据库类型的版本。 包含以下数据。 id -一个系统定义UUID值,该值在第一次创建时赋予datastore type.版本name - datastore type版本 的名字datastore_type – 该版本从属的datastore 类型image_id -镜像的UUID,该镜像将用于实例的部署packages – 用空格隔开的系统镜像列表,该系统镜像提供了这个版本的datastoreactive - bool (1|0) – 表示这个版本是否被激活User can see only id and name, also user can see and use only active versions用户将只能看到id 和 datastore type 的名字,而且用户只能够看到和使用激活的版本。 为了实现这个功能,操作者应在数据库中定义datastore 类型 和 可用的版本。 trove-manage 将有以下命令:
     update_datastore_type name engine image_id 用指定的名字更新datastore type ,如果指定的名字不存在,则将新创建,本命令返回UUID 或者 datastore type 的新建或者更新的名字。 update_datastore_version datastore_type name image_id packages active 用指定的名字更新版本, 如果指定的名字不存在,则将新创建,本命令返回UUID 或者 datastore type 版本的新建或者更新的名字。
    API规范用户可以列出数据存储管理程序的类型和可用的版本 Datastore types list (New call)请求消息结构tGET /{tenant_id}/datastores应答消息结构{    "id": "73144fc8-f2c5-4490-a2d7-76604c4528dd",    "links": [...    ],    "name": "MongoDB"}{    "id": "e60153d4-8ac4-414a-ad58-fe2e0035704a",    "links": [...    ],    "name": "Mysql"} Show datastore type (New call)请求消息结构tGET /{tenant_id}/datastores/e60153d4-8ac4-414a-ad58-fe2e0035704a应答消息结构{    "id": "e60153d4-8ac4-414a-ad58-fe2e0035704a",    "links": [...    ],    "name": "Mysql"} Datastore type versions list (New call)请求消息结构tGET /{tenant_id}/datastores/e60153d4-8ac4-414a-ad58-fe2e0035704a/versions应答消息结构{    "id": "7d109ae8-d38f-41c8-86e4-a8e613f81be5",    "links": [...    ],    "name": "ubuntu percona-5.5.33"}{    "id": "8ae342fb-19ac-4882-8978-fe1afb38c7c7",    "links": [...    ],    "name": "fedora oracle-5.1.71"}{    "id": "94ed1f9f-6c1a-4d6e-87e9-04ecff37b64b",    "links": [...    ],    "name": "ubuntu maria-10.0.4"} Show version (New call)请求消息结构GET /{tenant_id}/datastores/versions/7d109ae8-d38f-41c8-86e4-a8e613f81be5应答消息结构{    "id": "7d109ae8-d38f-41c8-86e4-a8e613f81be5",    "links": [...    ],    "name": "ubuntu percona-5.5.33"} Create instance with specified datastore type and version (Existing call)请求消息结构POST /instances{"instance" : {      "flavorRef" : "2",      "name" : "as",      "datastore": {          "type" : "e60153d4-8ac4-414a-ad58-fe2e0035704a",          "version" : "94ed1f9f-6c1a-4d6e-87e9-04ecff37b64b"      },      "volume" : { "size" : "1" }    }}应答消息结构{    "created": "2013-10-09T10:56:56",    "flavor": {        "id": "2",        "links": [...        ]    },    "id": "86bb7492-d797-4562-b864-851c8fad7216",    "links": [...    ],    "name": "as",    "datastore": {        "type": "Mysql",        "version": "ubuntu maria-10.0.4"    },    "status": "BUILD",    "updated": "2013-10-09T10:56:56",    "volume": {        "size": 1    }} List instances (Existing call)请求消息结构tGET /instances应答消息结构{    "flavor": {        "id": "2",        "links": [...        ]    },    "id": "b1f0dff8-6303-4711-9d23-e899abc5d24d",    "links": [...    ],    "name": "as_2",    "datastore": {        "type": "Mysql"    },    "status": "ACTIVE",    "volume": {        "size": 1    }}{    "flavor": {        "id": "2",        "links": [...        ]    },    "id": "be1f10ae-afa9-4f75-808d-f7782784f363",    "links": [...    ],    "name": "as_2",    "datastore": {        "type": "Mysql"    },    "status": "ACTIVE",    "volume": {        "size": 1    }} l  Get instance (Existing call)
    请求消息结构tGET /instances/be1f10ae-afa9-4f75-808d-f7782784f363应答消息结构{    "created": "2013-10-08T09:05:45",    "flavor": {        "id": "2",        "links": [...        ]    },    "id": "be1f10ae-afa9-4f75-808d-f7782784f363",    "links": [...    ],    "name": "as_2",    "datastore": {        "type": "Mysql",        "version": "ubuntu maria-10.0.4"    },    "status": "ACTIVE",    "updated": "2013-10-08T09:05:52",    "volume": {        "size": 1    }}

  • 相关阅读:
    消息队列学习
    php加密技术
    mysql 数据库优化
    mysql 数据库设计
    mysql 存储引擎
    用python计算圆周率并用进度条并显示计算进度
    关于Turtle库的学习笔记
    Python第一周作业使用turtle库绘图
    turtle绘图的例子
    六边形的绘制
  • 原文地址:https://www.cnblogs.com/jackyzzy/p/7384388.html
Copyright © 2011-2022 走看看