Slide 1

Slide 1 text

WebLogic Server for OKE 移行の手順 WebLogic Deploy Toolingを用いたドメイン/アプリケーションの移行 日本オラクル株式会社 2023年4月

Slide 2

Slide 2 text

Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 2 この資料では、WebLogic Server for OKE (以下WLS for OKE) の基本的な運用環境を構成するための、最低限の 手順や仕組みについて言及しています。 2023年3月時点での機能に従って記載しておりますので、適宜最新のドキュメントも照らし合わせて確認してください。 【公開ドキュメント】 • Oracle WebLogic Server for OKE https://docs.oracle.com/en/cloud/paas/weblogic-container/index.html はじめに

Slide 3

Slide 3 text

• 本資料では移行プロセスにおけるアプリケーションの再デプロイを解説 • セットアップとプロビジョニングは「WebLogic Server for OKEの汎用的な構成」資料にて解説 WebLogic Server for OKE 移行の大まかなプロセス Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 3 環境のセットアップ • コンパートメント • OCI Vault (Secret) • Network (VCN, Subnet) WebLogic Server for OKEのプロビジョニング • マーケットプレイス経 由でのプロビジョニング • 監視/管理の構成 • ドメインの作成 アプリケーション移行 • 移行元からリソース を抽出 • WebLogic Server for OKEのドメインを 更新 本資料で主に解説

Slide 4

Slide 4 text

アプリケーション移行に際しての留意点 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 4 移行元の管理サーバー/管理対象サーバー ⇒ 起動中/停止中に関わらず移行可能 移行先の管理サーバー/管理対象サーバー ⇒ プリセットジョブのCreate Domainによりドメイン作成済みであることが必要 データベース ⇒ 起動中/停止中に関わらず移行可能 ※本資料では移行先のデータベースはAutonomous DB (ATP) を想定して記載しています。

Slide 5

Slide 5 text

1. WDTを移行元ドメインにインストール 2. discoverDomainによるドメイン情報/リソースの抽出 3. ドメイン情報/リソース(移行ファイル群)の編集 4. ドメイン更新の準備(ファイルのアップロード/ダウンロード、Secret作成) 5. WebLogic Server for OKEのプリセットジョブ(Update Domain)を実行 WebLogic Deploy Toolingを用いた移行WebLogic Server for OKEへの移行 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 5 Source WebLogic Domain cluster JDBC #1 App #1 App #2 JDBC #2 source.properties source.zip source.yaml Discover Domain WDT 既存のWebLogicドメイン MS1 AS MS2 編集 WebLogic Server for OKE アップロード Pod AS Pod MS1 App #1 JDBC #1 JDBC #2 Pod MS2 App #2 JDBC #1 JDBC #2 Pod File Storage Domain ジョブによるビルド

Slide 6

Slide 6 text

1. WDTの最新バージョンを確認 1. https://github.com/oracle/weblogic-deploy-tooling/releases/ 2. JAVA_HOMEが設定されているかを確認 3. WDTのダウンロードとunzip 4. スクリプトの権限変更 1. WDTを移行元のドメインにインストール Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 6 echo $JAVA_HOME wget -qO- https://github.com/oracle/weblogic-deploy- tooling/releases/download/release-<バージョン>/weblogic- deploy.zip | $JAVA_HOME/bin/jar xv chmod +x weblogic-deploy/bin/*.sh

Slide 7

Slide 7 text

1. MW_HOMEディレクトリの設定(例: /u01/app/oracle/middleware) 2. DOMAIN_HOMEディレクトリの設定 3. DOMAIN_TYPEの設定 4. discoverDomainの実行 2. 移行元でdiscoverDomainコマンドの実行 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 7 MW_HOME= DOMAIN_HOME= DOMAIN_TYPE= weblogic-deploy/bin/discoverDomain.sh ¥ -oracle_home $MW_HOME ¥ -domain_home $DOMAIN_HOME ¥ -archive_file source.zip ¥ -model_file source.yaml ¥ -variable_file source.properties ¥ -domain_type $DOMAIN_TYPE ■ discoverDomainによる成果物 • source.zip • wlsdeploy/applications/.war のようなディレクトリ構造 • source.yaml • ドメインのメタデータ • source.properties • source.yamlで利用する変数を記載 • 環境変数やパスワードなどに利用

Slide 8

Slide 8 text

3.1. WDTモデルファイル(source.yaml)の編集 – resourcesとappDeployment resoucesとappDeploymentsフィールドのみを残す 1. domainInfoフィールドの全体を削除 2. topologyフィールドの全体を削除 ※ appDeploymentsのSourcePathはdicoverDomain時に 取得したsource.zip内のディレクトリ構造と同一 3. ドメイン情報/リソース(移行ファイル群)の編集 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 8 削除

Slide 9

Slide 9 text

3.2. WDTモデルファイル(source.yaml)の編集 – Targetの編集 ResourcesとappDeploymentsフィールド内のTargetを変更 • ドメイン名-cluster 3. ドメイン情報/リソース(移行ファイル群)の編集 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 9

Slide 10

Slide 10 text

3.3. WDTモデルファイル(source.yaml)の編集 – Autonomous DB と 接続 Autonomous DB (ATP)と接続するための主な設定例 • URL : 接続文字列をSecretから読込 • PasswordEncrypted : DB接続パスワードをSecretか ら読込 • User : 変数群ファイル(source.properties)から読込 • javax.net.ssl.keyStore : keystore.jksのパス • javax.net.ssl.keyStorePassword : Walletパスワード をSecretから読込 • javax.net.ssl.trustStore : truststore.jksのパス • javax.net.ssl.trustStorePassword : Walletパスワード をSecretから読込 • oracle.net.tns_admin : Walletのパス 3. ドメイン情報/リソース(移行ファイル群)の編集 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 10 https://docs.oracle.com/en/cloud/paas/weblogic-container/user/create- data-source-atp-database.html

Slide 11

Slide 11 text

3.4. WDTモデルファイル(source.properties)の編集 source.propertiesのJDBC.<データソース名>.user.value にデータベースのユーザ名を入力(変更が必要な場合) ※source.yaml内で利用しないので、ほかのフィールドは空 白、もしくは削除で良い 3. ドメイン情報/リソース(移行ファイル群)の編集 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 11

Slide 12

Slide 12 text

4.1. Admin instance経由でファイル・ストレージに移動 source.properties, source.yaml, source.zipを移行先のファイル・ストレージに移動 例) scpコマンドの実行 とはOCIの管理コンソールから確認可能 • Computeインスタンスの一覧 • 開発者サービス -> リソース・マネージャ -> ジョブ -> 対象のジョブ -> 出力 4. ドメイン更新の準備 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 12 scp -o ProxyCommand="ssh -W %h:%p opc@" ¥ source.* opc@:/u01/shared/

Slide 13

Slide 13 text

4.2. Walletをダウンロード Walletは、Admin Instance経由でファイル・ストレージに配置 1. Admin Instance に Bastion Instance 経由で SSHログイン 2. 以下のコマンドを実行 ※ は任意 (この後の手順で利用) 4.ドメイン更新の準備 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 13 ssh -i opc@ ¥ -o ProxyCommand="ssh -W %h:%p -i opc@" python /u01/scripts/utils/download_atp_wallet.shutils/oci_api_utils.py ¥ /u01/shared/atp_wallet

Slide 14

Slide 14 text

4.3. 各種Secretの作成 Admin Instance上で以下のコマンドを実行 1. DB接続用のSecretを作成 2. WalletパスワードのSecretを作成 4.ドメイン更新の準備 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 14 kubectl create secret generic <ドメイン名>-datasource-secret ¥ --from-literal=password= ¥ --from-literal=url='<接続文字列>’ ¥ -n <ドメイン名>-ns kubectl create secret generic <ドメイン名>-keystore-secret ¥ --from-literal=password= ¥ -n <ドメイン名>-ns

Slide 15

Slide 15 text

1. Jenkinsコンソールにアクセス 2. update domain ジョブ -> パラメータ付きビルド 3. 以下のように項目を入力し、「ビルド」ボタンをクリック • Domain_Name : ドメイン名 • Archive_Source : Shared File System • Archive_File_Location : /u01/shared/source.zip • Domain_Model_Source : Shared File System • Model_File_Location : /u01/shared/source.yaml • Variable_Source : Shared File System • Variable_File_Location : /u01/shared/source.properties 5. updateDomain の実行 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 15

Slide 16

Slide 16 text

No content