IBM TechXchange Integration Group Japan

IBM TechXchange Integration Group Japan

 View Only

OpenShift環境にIBM Event Streamsを導入する

By HIDEO SAITOH posted 2 days ago

  

OpenShift環境にIBM Event Streamsを導入する

このブログでは、OpenShift 4.18の環境にIBM Event Streamsを導入する手順を紹介します。

前提:IBM Event StreamsのOperatorは導入済みであることが前提です。

導入手順

  • OpenShiftのコンソールを開きます
  • インストール済みのOperatorからEvent Streamsを選択します。
    名前の所に、IBM Event Streamsと入力したら、検索できます。
  • インスタンスの作成を選択して、作成に進みます。
  • YAMLビューで、以下を設定します。
    nameは、es-developmentに設定しています。
    licenseのacceptは、trueに設定し、受け入れます。
    listenerには、外部からアクセスできるように、externalの設定を行います。この時、SCRAM認証の設定にしています。
    ###############################################################################
    #
    # © Copyright IBM Corp. 2020, 2023, 2024
    #
    ###############################################################################
    apiVersion: eventstreams.ibm.com/v1beta2
    kind: EventStreams
    metadata:
      name: es-development
      labels:
        backup.eventstreams.ibm.com/component: eventstreams
    spec:
      version: latest
      license:
        # By installing this product you accept the license terms at https://ibm.biz/ea-license
        accept: true
        license: "L-CYBH-K48BZQ"
        use: "EventAutomationDevelopment"
      adminApi: {}
      adminUI:
        authentication:
          - type: integrationKeycloak
      apicurioRegistry: {}
      collector: {}
      restProducer: {}
      strimziOverrides:
        kafka:
          authorization:
            type: simple
          config:
            log.cleaner.threads: 6
            num.io.threads: 24
            num.network.threads: 9
            num.replica.fetchers: 3
            offsets.topic.replication.factor: 3
            default.replication.factor: 3
            min.insync.replicas: 2
            auto.create.topics.enable: 'false'
          listeners:
            - name: external
              port: 9094
              type: route
              tls: true
              authentication:
                type: scram-sha-512
            - name: tls
              port: 9093
              type: internal
              tls: true
              authentication:
                type: tls
          metricsConfig:
            type: jmxPrometheusExporter
            valueFrom:
              configMapKeyRef:
                key: kafka-metrics-config.yaml
                name: development-metrics-config
        nodePools:
          - name: kafka
            replicas: 3
            storage:
              type: ephemeral
            roles:
              - broker
              - controller

  • 作成ボタンをクリックして、インスタンスを作成します。
  • しばらくすると、Readyになります。
  • Event Streamsにアクセスするための、ユーザー情報を確認します。
    Workloadsを展開し、シークレットを開きます。
    その後、プロジェクトを選択し、ibm-common-servicesを選択します。

    フィルターで、名前の所にtempと入力し、integration-admin-initial-temporary-credentialsがあることを確認します。
  • integration-admin-initial-temporary-credentialsをひらきます。
    値を表示するをクリックして、値を確認します。
    下記のように、passwordとusernameが確認できます。このユーザー名とパスワードで、Event StreamsのUIにアクセスできます。


  • 再度、インストール済みのOperatorにもどり、Event Streamsを検索します。
  • 全てのインスタンスを開き、フィルターで、developと入力し、es-developmentのインスタンスを検索します。
  • es-developmentを開き、Event StreamsのUIのURLを見つけます。
    Admin UIのところに、URLがあります。
  • Event StreamsのURLにアクセスし、integration-adminでログインします。
  • パスワードの変更を求められるので、変更します。
  • アクセスできたら、下記のようにEvent Streamsの画面が表示されます。

スターター・プリケーションを試す

  • スターター・アプリケーションを試すをクリックします。
  • Step1で、Githubから、demo-all.jarファイルをダウンロードします。

    demo-all.jarをダウンロードします。
  • Step2で、プロパティーを生成します。
    プロパティの生成をクリックすると、右側に生成のための画面が開きます。
  • スターター・アプリケーション名と新規トピック名を入力して、生成と.zipのダウンロードを実行します。
    スターター・アプリケーション名:es-app
    新規トピック:starter
  • es-app_properties.zipがダウンロードされます。
  • コマンドプロンプトから、適当なディレクトリを作成し、es-app_properties.zipをコピーします。
  • tarコマンドで、zipファイルを展開します。

    ダウンロードした、demo-all.jarもコピーしておきます。
  • Step3に記載されているコマンドを実行します。
    java -Dproperties_path=<path-to-properties> -jar demo-all.jar
  • ブラウザから、localhost:8080にアクセスします。
    左側のMessages producedのパネルに、送信したいメッセージを入力し、Start producingをクリックします。

    下記のように、何件か送信されたら、Stop producingを押して、ストップさせます。
  • Event StreamsのUIに戻り、トピックにデータが入っているかどうか確認してみます。
    左側のトピックをクリックし、starterのトピックができているので、メッセージの中身を確認できます。

まとめ

このブログでは、OpenShift上にEvent Streamsを導入し、スターター・アプリケーションを使って、トピックにデータの送信することができることを確認しました。

#IBMEventStreams

0 comments
4 views

Permalink