3. Copyright 2015 Bit-isle Inc. All Rights Reserved
Troveのミッション
スケーラブルで信頼できるDB をサービスとして提供する
RDBもnoSQLもどちらも対象
全てオープンソースで
[原文]The OpenStackOpen Source Database as a Service Mission: To
provide scalable and reliable Cloud Database as a Service provisioning
functionality for both relational and non-relational database engines, and
to continue to improve its fully-featured and extensible open source
framework.
3
https://wiki.openstack.org/wiki/Trove
4. Copyright 2015 Bit-isle Inc. All Rights Reserved
Troveの機能と各DBの対応状況
Feature MySQL Redis Cassandra MongoDB PostgreSQL Couchbase
Launch ✔ ✔ ✔ ✔ ✔ ✔
Reboot ✔ ✔ ✔ ✔ ✔ ✔
Terminate ✔ ✔ ✔ ✔ ✔ ✔
Resize ✔ ✔ ✔ ✔ ✔ ✔
Backup ✔ ✔ ✔** ✔ ✔ ✔
Restore ✔ ✔ ✔** ✔ ✔ ✔
Replication ✔ - - - ✔** -
Clustering - ✔** ✔** ✔ - ✔**
4
** = Datastore supports it -- but it is currently Work in Progress in Trove.
https://wiki.openstack.org/wiki/Trove/DatastoreCompatibilityMatrix
5. Copyright 2015 Bit-isle Inc. All Rights Reserved
Tesora社のサポートマトリクス
Database Version Certification Level
MySQL 5.5, 5.6 Production Ready
Percona 5.5, 5.6 Production Ready
MariaDB 5.5, 10.0 Development
Couchbase 2.2 Development
Cassandra 2.1 Development
Redis 2.8 Development
MongoDB 2.4 Development
PostgreSQL 9.3 Preview
Oracle 12c Preview
Oracle 11g Q2 2015
DB2 2015
CouchDB 2015
5
http://www.tesora.com/openstack-trove-certified-databases/
6. Copyright 2015 Bit-isle Inc. All Rights Reserved
アーキテクチャ(Create DB instance)
Glance上のDBイメージを使用してインスタンスを起動
Cinder 上に作成したボリューム上にDBデータ領域を作成
インスタンスはNeutron 上のネットワークに接続
6
OpenStack Iaas
Trove - host
Nova
Cinder
SwiftGlance
DB-instance
DB-volume
DB backupDB image
Keystone
Neutron
MQDB
trove-api
trove-
taskmanager
trove-conductor
trove-guestagent
Private
Network
Created by
the DB
image
Attached
to the DB
volume
Connected
to tenant network
Trove
Component
Iaas
Component
legend
7. Copyright 2015 Bit-isle Inc. All Rights Reserved
起動確認やDBの設定等は Message queue 経由でやり取り
※当然DBインスタンスとTrove hostの双方から同一MQへの通信経路が必要
アーキテクチャ(Setup/Update DB instance)
7
OpenStack Iaas
Trove - host
Nova
Cinder
SwiftGlance
DB-instance
DB-volume
DB backupDB image
Keystone
Neutron
MQDB
trove-api
trove-
taskmanager
trove-conductor
trove-guestagent
Private
Network
Direction through the
message queue
Trove
Component
Iaas
Component
legend
8. Copyright 2015 Bit-isle Inc. All Rights Reserved
バックアップを支持するとGuest Agentがバックアップを取得し、Swift のコン
テナにアップロードします。レプリケーションを行う場合はこれを使用してレプ
リカインスタンスを起動します。
アーキテクチャ(Backup and replica DB instance)
8
OpenStack Iaas
Trove - host
Nova
Cinder
SwiftGlance
DB-instance
DB-volume
DB backupDB image
Keystone
Neutron
MQDB
trove-api
trove-
taskmanager
trove-conductor
trove-guestagent
Private
Network
GuestAgent get backup for
DB-volume by defined
strategy and upload to the
Swift container.
Trove
Component
Iaas
Component
legend
backup-strategy
23. Copyright 2015 Bit-isle Inc. All Rights Reserved
コマンドの実行
パッケージのインストールと環境変数の設定後コマンドが
実行可能になります。
23
# 環境変数が設定されていれば trove コマンドを実行することができます。
$ trove list
/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object
is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For
more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
+--------------------------------------+---------------+-----------+-------------------+--------+-----------+------+
| ID | Name | Datastore | Datastore Version | Status | Flavor ID | Size |
+--------------------------------------+---------------+-----------+-------------------+--------+-----------+------+
| 16833bab-5d7b-462d-8774-9b8ad926d6f9 | testing | mysql | mysql5.5 | ACTIVE | 2 | 5 |
| 4057e51f-ec0d-44b3-aa7c-b8b4465bff61 | test-database | mysql | mysql5.5 | ACTIVE | 2 | 3 |
+--------------------------------------+---------------+-----------+-------------------+--------+-----------+------+
# コマンドのヘルプは help オプションで確認できます。
$ trove help
usage: trove [--version] [--debug] [--os-auth-system <auth-system>]
[--service-type <service-type>] [--service-name <service-name>]
[--bypass-url <bypass-url>]
[--database-service-name <database-service-name>]
[--endpoint-type <endpoint-type>]
<以下略>
コマンドのバージョンによってはこのようなWarningが出ま
すが動作には問題ありません
25. Copyright 2015 Bit-isle Inc. All Rights Reserved
データベースとユーザの権限設定(Glant)
データベースとユーザの権限設定を以下のコマンドで実施
できます。
25
# trove user-grant-accessの利用オプション
usage: trove user-grant-access <instance> <name> <databases> [<databases> ...]
[--host <host>]
Grants access to a database(s) for a user.
Positional arguments:
<instance> ID or name of the instance.
<name> Name of user.
<databases> List of databases.
Optional arguments:
--host <host> Optional host of user.>]
# (実行例)
$ trove user-grant-access 16833bab-5d7b-462d-8774-9b8ad926d6f9 newuser mydb
26. Copyright 2015 Bit-isle Inc. All Rights Reserved
データベースの設定変更(設定可能項目の確認)
データベースには予め設定可能なパラメータが定義されています。設
定可能な項目の変更はホスト側の変更を伴います。
26
# trove configuration-parameter-listの利用オプション
usage: trove configuration-parameter-list <datastore_version>
[--datastore <datastore>]
Lists available parameters for a configuration group.
Positional arguments:
<datastore_version> Datastore version name or ID assigned to the
configuration group.
# (実行例)
$ trove configuration-parameter-list 69d79599-fc27-4751-8a4c-3f4178b6d7f2
+--------------------------------+---------+----------+----------------------+------------------+
| Name | Type | Min Size | Max Size | Restart Required |
+--------------------------------+---------+----------+----------------------+------------------+
| auto_increment_increment | integer | 1 | 65535 | False |
| auto_increment_offset | integer | 1 | 65535 | False |
| autocommit | integer | 0 | 1 | False |
| bulk_insert_buffer_size | integer | 0 | 18446744073709547520 | False |
| character_set_client | string | | | False |
| character_set_connection | string | | | False |
(以下略)
27. Copyright 2015 Bit-isle Inc. All Rights Reserved
データベースの設定変更(Config Groupの作成)
データベースの設定を変更するにはまず設定グループを作
成します。
27
# (実行例)
$ trove configuration-create DemoConfig '{"connect_timeout":30,"autocommit":1}' --
datastore_version mysql5.5 --datastore mysql
+------------------------+------------------------------------------+
| Property | Value |
+------------------------+------------------------------------------+
| created | 2015-07-07T07:41:18 |
| datastore_name | mysql |
| datastore_version_id | f4439df1-2776-4669-824d-2d3a41f86d19 |
| datastore_version_name | mysql5.5 |
| description | None |
| id | 279842bc-ba9a-4277-b86f-e6187dc43767 |
| instance_count | 0 |
| name | DemoConfig |
| updated | 2015-07-07T07:41:18 |
| values | {"autocommit": 1, "connect_timeout": 30} |
+------------------------+------------------------------------------+
28. Copyright 2015 Bit-isle Inc. All Rights Reserved
データベースの設定変更(Config Groupのアタッチ)
作成したConfigを インスタンスにアタッチすることで設定
を反映することができます。
28
# trove configuration-attachの利用オプション
$ trove help configuration-attach
usage: trove configuration-attach <instance> <configuration>
Attaches a configuration group to an instance.
Positional arguments:
<instance> ID of the instance.
<configuration> ID of the configuration group to attach to the instance.
# (実行例)
$ trove configuration-attach d3842076-3a84-4c7b-afc6-3d604f3d6685 279842bc-ba9a-4277-b86f-
e6187dc43767