1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Db2 on CP4D 4.6.2 導入と構成 - 3.Db2サービス導入

Last updated at Posted at 2023-04-21

Db2 on Cloud Pak for Data 4.6.2 導入と構成

シリーズ"Db2 on CP4D 4.6.2 導入と構成"は 2023年02月の経験をベースに 次のようなCloud Pak for Data (以下CP4D)4.6.2環境へ Db2を導入デプロイする手順をご紹介します。 

  • Managed OpenShift cluster (ROKS) on IBM Cloud (VPC/"Gen2")
  • OpenShift Container Platform (OCP) 4.10 , OpenShift Data Foundation (ODF) 4.10
  • Cloud Pak for Data (CP4D) 4.6.2

本シリーズの目次はこちらです。
ここでは Db2サービスを導入します。

3.Db2サービス導入

CP4D環境にDb2を導入します。

  • Db2 オペレーターを導入します。
  • Db2 サービスを導入します。

手順

作業は踏み台マシンでおこないます。
(1) 環境変数シェルスクリプトを次のようにして実行して環境変数を定義してOpenShiftクラスターにログインしましょう。 ここで実行している$CPDOCLOGINはcpd-cli manage login-to-ocpをオプション付きで実行するようにcpd_vars.sh内で環境変数として定義しています。

# source ./cpd_vars.sh
# $CPDOCLOGIN
[INFO] 2023-02-24T15:02:06.909389Z Checking architecture: amd64
[INFO] 2023-02-24T15:02:06.909472Z Checking podman or docker
[INFO] 2023-02-24T15:02:06.999726Z Dockerexe: podman
[INFO] 2023-02-24T15:02:07.172603Z Container olm-utils-play is running already. Image: icr.io/cpopen/cpd/olm-utils:latest
[INFO] 2023-02-24T15:02:07.298690Z Processing subcommand login-to-ocp
KUBECONFIG is /opt/ansible/.kubeconfig
WARNING: Using insecure TLS client config. Setting this option is not supported!

Login successful.

You have access to 67 projects, the list has been suppressed. You can list all projects with 'oc projects'

Using project "default".
Using project "default" on server "https://c115-e.jp-tok.containers.cloud.ibm.com:31714".
[SUCCESS] 2023-02-24T15:02:30.845670Z You may find output and logs in the /home/xxxxx/cpd-cli-workspace/olm-utils-workspace/work directory.
[SUCCESS] 2023-02-24T15:02:30.845776Z The login-to-ocp command ran successfully.
#

(2) Db2 オペレーターを導入します。所要時間は10分程度です。

# cpd-cli manage apply-olm --release=${VERSION} --cpd_operator_ns=${PROJECT_CPD_OPS} --components=db2oltp
[INFO] 2023-02-24T15:02:51.745407Z Checking architecture: amd64
[INFO] 2023-02-24T15:02:51.745445Z Checking podman or docker
[INFO] 2023-02-24T15:02:51.765636Z Dockerexe: podman
[INFO] 2023-02-24T15:02:51.892157Z Container olm-utils-play is running already. Image: icr.io/cpopen/cpd/olm-utils:latest
[INFO] 2023-02-24T15:02:52.012686Z Processing subcommand apply-olm

PLAY [localhost] ****************************************************************************************************************************************************************************

TASK [include_role : utils] *****************************************************************************************************************************************************************
(省略)
TASK [debug] ********************************************************************************************************************************************************************************
skipping: [localhost]

PLAY RECAP **********************************************************************************************************************************************************************************
localhost                  : ok=123  changed=15   unreachable=0    failed=0    skipped=102  rescued=0    ignored=0

[SUCCESS] 2023-02-24T15:10:33.528626Z You may find output and logs in the /home/xxxxx/cpd-cli-workspace/olm-utils-workspace/work directory.
[SUCCESS] 2023-02-24T15:10:33.528693Z The apply-olm command ran successfully.
#

cpd-cli manage apply-olmコマンドで最後に[SUCCESS]が返されたので成功しました。 

(3) Db2サービスを導入します。 次でDb2のカスタムリソースを作成します。所要時間は20分程度です。

# cpd-cli manage apply-cr --components=db2oltp --release=${VERSION} --cpd_instance_ns=${PROJECT_CPD_INSTANCE} --license_acceptance=true
[INFO] 2023-02-24T15:17:21.162250Z Checking architecture: amd64
[INFO] 2023-02-24T15:17:21.162291Z Checking podman or docker
[INFO] 2023-02-24T15:17:21.183813Z Dockerexe: podman
[INFO] 2023-02-24T15:17:21.308209Z Container olm-utils-play is running already. Image: icr.io/cpopen/cpd/olm-utils:latest
[INFO] 2023-02-24T15:17:21.430432Z Processing subcommand apply-cr
(省略)
TASK [debug] ********************************************************************************************************************************************************************************
skipping: [localhost]

PLAY RECAP **********************************************************************************************************************************************************************************
localhost                  : ok=38   changed=5    unreachable=0    failed=0    skipped=58   rescued=0    ignored=0

[SUCCESS] 2023-02-24T15:33:00.009150Z You may find output and logs in the /home/xxxxx/cpd-cli-workspace/olm-utils-workspace/work directory.
[SUCCESS] 2023-02-24T15:33:00.009201Z The apply-cr command ran successfully.
#

cpd-cli manage apply-crコマンドで最後に[SUCCESS]が返されたので成功しました。 

(オプション) cpd-cli manage get-cr-status コマンドでカスタムリソースの状況が完了しているかどうか 確認することができます。

# cpd-cli manage get-cr-status --cpd_instance_ns=zen --components=db2oltp
[INFO] 2023-02-08T17:02:16.369442Z Checking architecture: amd64
[INFO] 2023-02-08T17:02:16.369469Z Checking podman or docker
[INFO] 2023-02-08T17:02:16.411000Z Dockerexe: podman
[INFO] 2023-02-08T17:02:16.518407Z Container olm-utils-play is running already. Image: icr.io/cpopen/cpd/olm-utils:latest
[INFO] 2023-02-08T17:02:16.618256Z Processing subcommand get-cr-status
# component,CR-kind,CR-name,status,version,creationtimestamp,reconciled-version,operator-info
db2oltp,Db2oltpService,db2oltp-cr,Completed,4.6.2,2023-02-08T07:45:16Z,4.6.2+11.5.8.0-cn1+2004,4.6.2+11.5.8.0-cn1+2004
[SUCCESS] 2023-02-08T17:02:28.274153Z You may find output and logs in the /home/xxxxx/cpd-cli-workspace/olm-utils-workspace/work directory.
[SUCCESS] 2023-02-08T17:02:28.274185Z The get-cr-status command ran successfully.
#

statusCompletedになっているので 完了していることがわかります。

参考文書

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?