EgeriaのHands-On Labをやってみた 〜サーバー管理者編〜

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

本記事では、メタデータ・ガバナンスを実現するOSSプロジェクトEgeriaのハンズオンを実施していきます。Egeriaの概要やセットアップ方法は下記事を参照ください。

2021年6月現在の最新バージョンEgeria 2.10では、5つのハンズオンが用意されており、組織内でどういう立場の人が実施すべきかペルソナが用意されています。

  • Administration Labs
    • Gary Geeke(ITインフラのリーダー)
    • Egeriaのプラットフォームとサーバーをどのように管理していくか?
  • Asset Management Labs
    • Peter Profile(アナリスト)、Erin(アーキテクト)
    • Coco Pharmaceuticalのアセットのカタログを構築・管理
    • Callie Quartile(データ・サイエンティスト)
    • 必要なアセットの場所を特定して分析に使用するために、カタログを使用する
  • Information Architecture Labs
    • Erin
    • Coco Pharmaceuticalsの情報標準をセットアップする
  • Conformance Testing Labs
    • Polly Tasker(テスター)
    • Egeriaの適合テスト(conformance test)を実施し、メタデータサーバーがEgeriaのオープンメタデータプロトコルに適合するか確認する
  • Asset UI Labs
    • Callie Quartile
    • メタデータのフローを理解するために、EgeriaのUIを利用して調査を実施す

今回はAdministration Labsを実施していきます。EgeriaのハンズオンはJupyter Notebookで進められるようにできているので、本記事ではコードは掲載しません。どんなことが書いてあるのか?や、何がわかったのか?などを中心にダイジェストをまとめていきます。

準備

上記事のセットアップを完了させ、以下のログが表示されていることを確認して下さい。

%run common/environment-check.ipynb

Checking OMAG Server Platform availability...
    Core Platform is active
        Checking OMAG Server cocoMDS2
           ... cocoMDS2 is configured
           ... cocoMDS2 is active - ready to begin
        Checking OMAG Server cocoMDS3
           ... cocoMDS3 is configured
           ... cocoMDS3 is active - ready to begin
        Checking OMAG Server cocoMDS5
           ... cocoMDS5 is configured
           ... cocoMDS5 is active - ready to begin
        Checking OMAG Server cocoMDS6
           ... cocoMDS6 is configured
           ... cocoMDS6 is active - ready to begin
    Data Lake Platform is active
        Checking OMAG Server cocoMDS1
           ... cocoMDS1 is configured
           ... cocoMDS1 is active - ready to begin
        Checking OMAG Server cocoMDS4
           ... cocoMDS4 is configured
           ... cocoMDS4 is active - ready to begin
        Checking OMAG Server cocoView1
           ... cocoView1 is configured
           ... cocoView1 is active - ready to begin
    Dev Platform is active
        Checking OMAG Server cocoMDSx
           ... cocoMDSx is configured
           ... cocoMDSx is active - ready to begin
Done.

Administration Labs

Administration Labsでは、以下の4つを実施していきます。

  • Managing Servers
  • Understanding Server Configuration
  • Understanding Platform Services
  • Understanding Cohorts

Managing Servers

ITインフラのGaryは、OMAGサーバーをセットアップし、正常に稼働しているか監査ログを確認していきます。

  • 初期セットアップで上記のようにセットアップしたサーバー・プラットフォームに対して、ホスト名とポート番号を定義
  • Data Lake OMAG Server Platform上で、cocoMDS1を起動させる
Starting server cocoMDS1 ...
POST https://datalake:9443/open-metadata/admin-services/users/garygeeke/servers/cocoMDS1/instance
Response: 
{
    "class": "SuccessMessageResponse",
    "relatedHTTPCode": 200,
    "successMessage": "Sun Jun 20 23:29:35 GMT 2021 cocoMDS1 is running the following services: [Open Metadata Repository Services (OMRS), Connected Asset Services, Asset Catalog OMAS, Asset Consumer OMAS, Asset Manager OMAS, Asset Owner OMAS, Community Profile OMAS, Glossary View OMAS, Discovery Engine OMAS, Data Engine OMAS, Data Manager OMAS, Governance Engine OMAS]"
}
  • cocoMDS1の保存されている設定ドキュメントをAPIから取得し、監査ログ情報auditTrailを出力してみる
Retrieving stored configuration document for cocoMDS1 ...
GET https://datalake:9443/open-metadata/admin-services/users/garygeeke/servers/cocoMDS1/configuration
Server configuration for cocoMDS1 has been retrieved

Audit Trail: 
Sun Jun 20 23:20:29 GMT 2021 garygeeke updated configuration for local server's URL root to https://datalake:9443.
Sun Jun 20 23:20:30 GMT 2021 garygeeke updated configuration for maximum page size to 100.
Sun Jun 20 23:20:30 GMT 2021 garygeeke removed configuration for local server type name.
...
  • 設定ドキュメントはサーバーを起動した後で変更される可能性があるが、保存されている設定ドキュメントへの反映には再起動が必要
  • APIのエンドポイントに/instance/を加えることで、保存されている設定ドキュメントではなく、起動中サーバーの最新の設定ドキュメントを取得できる
Retrieving running configuration document for cocoMDS1 ...
GET https://datalake:9443/open-metadata/admin-services/users/garygeeke/servers/cocoMDS1/instance/configuration
Server configuration for cocoMDS1 has been retrieved

Audit Trail: 
Sun Jun 20 23:20:29 GMT 2021 garygeeke updated configuration for local server's URL root to https://datalake:9443.
Sun Jun 20 23:20:30 GMT 2021 garygeeke updated configuration for maximum page size to 100.
Sun Jun 20 23:20:30 GMT 2021 garygeeke removed configuration for local server type name.
...
  • DELETEリクエストで、cocoMDS1を停止する
  • DELETEリクエストの際、/instanceを外すことでサーバーを消去できる

Understanding Server Configuration

このチュートリアルでGaryは、cocoMDS1サーバーの設定ドキュメントを参照し、それによってサービスがどう稼働されているのかを把握していきます。

  • 先ほどと同様に、APIから設定ドキュメントを取得する
  • auditTrailを参照すれば、設定項目を概観できる
 Retrieving stored configuration document for cocoMDS1 ...
GET https://datalake:9443/open-metadata/admin-services/users/garygeeke/servers/cocoMDS1/configuration
Server configuration for cocoMDS1 has been retrieved

Audit Trail: 
Sun Jun 20 23:20:29 GMT 2021 garygeeke updated configuration for local server's URL root to https://datalake:9443.
Sun Jun 20 23:20:30 GMT 2021 garygeeke updated configuration for maximum page size to 100.
Sun Jun 20 23:20:30 GMT 2021 garygeeke removed configuration for local server type name.
...
  • 設定ドキュメントからは、サーバー名・ID・種類・組織名が取得可能
  • metadataCollectionIdmetadataCollectionNameは、ローカルリポジトリ内のメタデータの起源となるID
  • localRepositoryRemoteConnectionで、外部のサーバーからアクセスするためのエンドポイントを取得できる
  • エンドポイントのアドレスには、DNSを指定することも可能
Server name:   cocoMDS1
Server GUID:   b001bced-df50-403b-812c-42f2dc9099fa
Server Type:   Metadata Server
Organization:  Coco Pharmaceuticals

Local metadata collection id:     24f7d3c9-d2bb-40ac-b0a3-4ed8b92052ae
Local metadata collection name:   Data Lake Catalog

Server URL root:   https://datalake:9443
Full URL endpoint: https://datalake:9443/servers/cocoMDS1
  • メタデータ・サーバーは、データレイク上のデータやプロセスについてのメタデータを保管するローカルリポジトリが必要
  • in-memory repositorygraph repositoryの2種類のリポジトリがある
  • auditLogConnectionslocalRepositoryLocalConnection内で、コネクターの概要やクラス名が確認できる
Audit Log Destinations: 
1. description: Connector supports logging of audit log messages to stdout.
   className:   org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.console.ConsoleAuditLogStoreProvider
 
Local Repository's Local Connection: 
  description: OMRS Repository Connector that uses an in-memory store.
  className:   org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider
  • リクエストの認証に使用するuserIdpasswordも、設定ドキュメントから取得可能
  • 認可はリクエストごとに付与する。serverSecurityConnectionで参照可能
local Server UserId:   cocoMDS1npa
local Server Password: cocoMDS1passw0rd

Server's Security Connection:
{
    "class": "Connection",
    "headerVersion": 0,
    "connectorType": {
        "class": "ConnectorType",
        "headerVersion": 0,
        "connectorProviderClassName": "org.odpi.openmetadata.metadatasecurity.samples.CocoPharmaServerSecurityProvider"
    }
}
  • event bus: メタデータに関するイベントの交換を担う機能(Apache Kafka)
  • cohortsに接続し、topicsを提供する
  • eventBusConfigに設定情報が載る
Event Bus Configuration:
{
    "class": "EventBusConfig",
    "topicURLRoot": "egeria.omag",
    "configurationProperties": {
        "producer": {
            "bootstrap.servers": "kafka:9092"
        },
        "consumer": {
            "bootstrap.servers": "kafka:9092"
        }
    },
    "additionalProperties": {
        "producer": {
            "bootstrap.servers": "kafka:9092"
        },
        "consumer": {
            "bootstrap.servers": "kafka:9092"
        }
    }
}
  • サーバーは複数のcohortsに属することが可能
  • cocoMDS1cocoCohortのメンバー
  • cohortの情報はcohortConfigListで取得できる
Cohort(s) that this server is a member of: 
1. name: cocoCohort
    Cohort Registry Connection: 
     description: Connector supports storing of the open metadata cohort registry in a file.
     className:   org.odpi.openmetadata.adapters.repositoryservices.cohortregistrystore.file.FileBasedRegistryStoreProvider
    Cohort Topic Connection: 
     className:   org.odpi.openmetadata.repositoryservices.connectors.omrstopic.OMRSTopicProvider
  • Open Metadata Access Services (OMASs)で利用可能な選択肢は、専用のエンドポイントを叩けば取得できる
  • 各OMASがサポートしているサービスはaccessServicesConfigから参照可能
Retrieving the registered access services ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/registered-services/access-services
Response: 
{
    "class": "RegisteredOMAGServicesResponse",
    "relatedHTTPCode": 200,
    "services": [
        {
            "serviceName": "DigitalService",
            "serviceURLMarker": "digital-service",
            "serviceDescription": "Manage a Digital Service Lifecycle",
            "serviceWiki": "https://egeria.odpi.org/open-metadata-implementation/access-services/digital-service/"
        },
        {
            "serviceName": "Data Manager",
            "serviceURLMarker": "data-manager",
            "serviceDescription": "Capture changes to the data stores and data set managed by a data manager such as a database server, content manager or file system.",
            "serviceWiki": "https://egeria.odpi.org/open-metadata-implementation/access-services/data-manager/"
        },
        ...

Configured Access Services: 
 
Asset Catalog options: {
    "SupportedZones": [
        "quarantine",
        "clinical-trials",
        "research",
        "data-lake",
        "trash-can"
    ]
}
 Asset Consumer options: {
    "SupportedZones": [
        "quarantine",
        "clinical-trials",
        "research",
        "data-lake",
        "trash-can"
    ]
}
...
  • サーバーで使用されているTopicsのリスト化も可能
List of Topics used by cocoMDS1
  egeria.omag.openmetadata.repositoryservices.cohort.cocoCohort.OMRSTopic
  egeria.omag.server.cocoMDS1.omas.assetcatalog.inTopic
  egeria.omag.server.cocoMDS1.omas.assetcatalog.outTopic
  egeria.omag.server.cocoMDS1.omas.assetconsumer.inTopic
  egeria.omag.server.cocoMDS1.omas.assetconsumer.outTopic
  egeria.omag.server.cocoMDS1.omas.assetmanager.inTopic
  egeria.omag.server.cocoMDS1.omas.assetmanager.outTopic
  egeria.omag.server.cocoMDS1.omas.assetowner.inTopic
  egeria.omag.server.cocoMDS1.omas.assetowner.outTopic
  egeria.omag.server.cocoMDS1.omas.communityprofile.inTopic
  egeria.omag.server.cocoMDS1.omas.communityprofile.outTopic
  egeria.omag.server.cocoMDS1.omas.glossaryview.inTopic
  egeria.omag.server.cocoMDS1.omas.glossaryview.outTopic
  egeria.omag.server.cocoMDS1.omas.discoveryengine.inTopic
  egeria.omag.server.cocoMDS1.omas.discoveryengine.outTopic
  egeria.omag.server.cocoMDS1.omas.dataengine.inTopic
  egeria.omag.server.cocoMDS1.omas.dataengine.outTopic
  egeria.omag.server.cocoMDS1.omas.datamanager.inTopic
  egeria.omag.server.cocoMDS1.omas.datamanager.outTopic
  egeria.omag.server.cocoMDS1.omas.governanceengine.inTopic
  egeria.omag.server.cocoMDS1.omas.governanceengine.outTopic
  • maxPageSize: リクエストに対する最大ページサイズ
Maximum records return on a REST call: 100

Understanding Platform Services

このチュートリアルでは、プラットフィーム上の稼働中のサーバーにクエリするためのコマンドについて見ていきます。

  • Originとバージョンの取得
Retrieving the OMAG Server Platform origin ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/origin
Response: 
Egeria OMAG Server Platform (version 2.10)
  • Registered Services一覧は、それぞれ以下のエンドポイントからGETで取得できる
  • https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/registered-services/
  • Common Services: ./common-services
  • Access Services: ./access-services
  • Engine Services: ./engine-services
  • Integration Services: ./integration-services
  • View Services: ./view-services
  • Governance services: ./governance-services
  • ./registered-services自体にへリクエストを飛ばせば、全サービス一覧が帰ってくる
Retrieving all of the registered services ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/registered-services
Response: 
{
    "class": "RegisteredOMAGServicesResponse",
    "relatedHTTPCode": 200,
    "services": [
        {
            "serviceName": "Open Metadata Repository Services (OMRS)",
            "serviceURLMarker": "repository-services",
            "serviceDescription": "Manages the synchronization, retrieval and maintenance of metadata stored in open metadata repositories",
            "serviceWiki": "https://egeria.odpi.org/open-metadata-implementation/repository-services/"
        },
        {
            "serviceName": "OMAG Server Operational Services",
            "serviceURLMarker": "admin-services",
            "serviceDescription": "Management of services active in an Open Metadata and governance server (OMAG Server)",
            "serviceWiki": "https://egeria.odpi.org/open-metadata-implementation/admin-services"
        },
        ...
  • ホストしているサーバー情報の取得
  • known server: プラットフォームが立ち上がってから起動されたサーバー
  • active server: 現在起動中のサーバー
Querying the known servers on platform: Data Lake Platform ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/servers
Response: 
{
    "class": "ServerListResponse",
    "relatedHTTPCode": 200,
    "serverList": [
        "cocoMDS1",
        "cocoMDS4",
        "cocoView1"
    ]
}
 
 
Querying the active servers on platform: Data Lake Platform ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/servers/active
Response: 
{
    "class": "ServerListResponse",
    "relatedHTTPCode": 200,
    "serverList": [
        "cocoMDS1",
        "cocoMDS4",
        "cocoView1"
    ]
}
  • 個々のサーバーに対して、./is-known./status./servicesなどで細かな情報を取得できる
Querying if a server is known ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/servers/cocoMDS1/is-known
Response: 
{
    "class": "BooleanResponse",
    "relatedHTTPCode": 200,
    "flag": true
}
 
 
Querying the status of a server ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/servers/cocoMDS1/status
Response: 
{
    "class": "ServerStatusResponse",
    "relatedHTTPCode": 200,
    "serverName": "cocoMDS1",
    "serverType": "Metadata Server",
    "serverStartTime": "2021-06-20T23:54:16.283+00:00",
    "serverHistory": [
        {
            "startTime": "2021-06-20T23:23:09.301+00:00",
            "endTime": "2021-06-20T23:29:34.642+00:00"
        },
        {
            "startTime": "2021-06-20T23:29:34.715+00:00",
            "endTime": "2021-06-20T23:43:56.479+00:00"
        }
    ],
    "active": true
}
 
 
Querying the services that are active a server ...
GET https://datalake:9443/open-metadata/platform-services/users/garygeeke/server-platform/servers/cocoMDS1/services
Response: 
{
    "class": "ServerServicesListResponse",
    "relatedHTTPCode": 200,
    "serverName": "cocoMDS1",
    "serverServicesList": [
        "Open Metadata Repository Services (OMRS)",
        "Community Profile OMAS",
        "Asset Consumer OMAS",
        "OMAG Server Operational Services",
        "Discovery Engine OMAS",
        "Asset Catalog OMAS",
        "Asset Owner OMAS",
        "Asset Manager OMAS",
        "Connected Asset Services",
        "Data Manager OMAS",
        "Glossary View OMAS",
        "Data Engine OMAS",
        "Governance Engine OMAS"
    ]
}

Understanding Cohorts

このハンズオンでは、OMAGサーバーと接続されているCohortsの構成について理解していきます。

  • CohortはPeer-to-peerで繋がっており、それぞれのCohortメンバーが、他のメンバーのについての情報を保有している
  • これらの情報は、Cohort registry storeに保管されている
  • queryServerCohorts()で、接続されているCohortの情報を取得できる
Cohort(s) for cocoMDS1 are [cocoCohort]
Cohort(s) for cocoMDS2 are [cocoCohort, devCohort, iotCohort]
Cohort(s) for cocoMDS3 are [cocoCohort]
Cohort(s) for cocoMDS4 are [cocoCohort]
Cohort(s) for cocoMDS5 are [cocoCohort]
Cohort(s) for cocoMDS6 are [cocoCohort, iotCohort]
Cohort(s) for cocoMDSx are [devCohort]
  • Local registration: メタデータサーバーが接続済みのCohortsとシェアしたRegistrationの情報
  • printRemoteRegistrations()で出力
Registration details for local Metadata Server cocoMDS2
 * Metadata collection id:   0d255ab2-8b50-4a9b-9902-7a71e0adf9ed
 * Metadata collection name: Governance Catalog
 * URL for metadata queries: https://core:9443/servers/cocoMDS2

次のステップ

次回は、実際にデータカタログを作成・管理・活用していくペルソナに向けた Asset Management Labsをやっていきます。