Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WebLogic Server for OCI 移行の手順

WebLogic Server for OCI 移行の手順

oracle4engineer
PRO

February 01, 2023
Tweet

More Decks by oracle4engineer

Other Decks in Technology

Transcript

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

    View Slide

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

    • 監視/管理の構成
    アプリケーション移行
    • 移行元からリソース
    を抽出
    • WebLogic Server
    for OCIのドメインを
    更新
    本資料で主に解説

    View Slide

  3. 移行に際しての留意点
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    3
    移行元の管理サーバー/管理対象サーバー
    ⇒ 起動中/停止中に関わらず移行可能
    移行先の管理サーバー/管理対象サーバー
    ⇒ 管理サーバーは起動中であることが必要
    データベース
    ⇒ 起動中/停止中に関わらず移行可能

    View Slide

  4. 移行フェーズ パラメータ 補足/注意点
    環境のセットアップ WebLogicの管理パスワード OCI Vault で管理
    プロビジョニング バージョン
    ノード数 管理サーバは1つ目のノードに配置
    管理/管理対象サーバー名 _adminserver
    _server_ のように固定
    ※はノード数に応じて1, 2, 3 …のように連番
    エディション
    リソース名プレフィクス ドメイン名は_domain固定
    WebLogic管理ユーザ名
    アプリケーション移行 データベースのパスワード
    WebLogic Server for OCI 移行にまつわる主なパラメータ
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    4

    View Slide

  5. 1. WDTを移行元ドメインにインストール
    2. discoverDomainによるドメイン情報/リソースの抽出
    3. 移行先ドメインにドメイン情報/リソースを移動
    4. WDTを移行先ドメインにインストール
    5. updateDomainの実行
    WebLogic Deploy Toolingを用いた移行WebLogic Server for OCIへの移行
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    5
    Source
    WebLogic
    Domain
    cluster
    JDBC #1
    App
    #1
    App
    #2
    JDBC #1
    source.properties
    source.zip
    source.yaml
    Discover
    Domain
    Target
    WebLogic
    Domain
    cluster
    MS1
    AS
    MS2
    JDBC #1
    App
    #1
    App
    #2
    JDBC #1
    WDT
    既存のWebLogicドメイン 反映先のWebLogicドメイン
    MS1
    AS
    MS2
    Update
    Domain
    WDT
    編集

    View Slide

  6. 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

    View Slide

  7. 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で利用する変数を記載
    • 環境変数やパスワードなどに利用

    View Slide

  8. source.properties, source.yaml, source.zipを移行先のサーバに移動する
    推奨: WDTのインストールに用いたzipファイル(weblogic-deply.zip)も同時に移動
    例) 以下はscpコマンドを利用する例
    1. 移行元IPの指定
    2. 移行先IPの指定
    3. 踏台サーバIPの指定
    4. scpコマンドの実行
    3. 移行先の管理サーバへファイルを転送
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    8
    SOURCE_IP=
    ADMIN_SERVER_IP=
    BASTION_IP=
    scp -o “ProxyCommand ssh -i
    [email protected]$BASTION_IP -W %h:%p" >@${SOURCE_IP}:~/source.* [email protected]${ADMIN_SERVER_IP}:~/

    View Slide

  9. • source.propertiesのJDBC..PasswordEncryptedに
    データベースのパスワードを入力
    • source.propertiesのJDBC..user.valueにデータベースの
    ユーザ名を入力(変更が必要な場合)
    ※source.yaml内で利用しないので、ほかのフィールドは空白で良い
    4. WDTモデルファイル(source.properties)の編集
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    9

    View Slide

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

    View Slide

  11. t3sチャネルを新規作成する例
    topologyフィールドを利用して、ネットワークチャネルなどの設定を行
    うことができる
    例えばt3sチャネルを追加する場合、キャプチャのように
    • 移行先管理サーバー名
    • t3s通信に利用するポート
    • 移行先管理サーバーの内部FQDNアドレス
    • 移行先管理サーバーのIP(Privateでも可)
    を入力することで、新規チャネルを追加することができる
    参考) topologyフィールドの活用
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    11

    View Slide

  12. キャプチャの位置にStagingMode: stageの追加
    ※これを追加しない場合、移行アプリケーションをサーバーそれぞれに
    手動でデプロイを行う必要がある
    6. WDTモデルファイルの編集 – StagingModeフィールドの追加
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    12

    View Slide

  13. 移行先のWebLogicエディションに合わせTargetを編集
    • Enterprise Edition
    • クラスター名を記述
    • 例) _cluster
    • Standard Edition
    • 管理対象サーバー名を「,」で繋いで記述
    • 例) “_server_0,_1”
    • 「”」もしくは「’」で囲う
    7. WDTモデルファイルの編集 – Targetの編集
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    13

    View Slide

  14. DBCS
    接続先DBのURL / ユーザー名 / パスワードは必要に応
    じて変更
    ※@@PROP:@@の形式で、propertiesファイル内の変数
    を利用できる
    ATP
    • URLはDBCSの場合と異なり接続文字列に
    • Walletの配置先パスなど、Propertiesの値を必要に
    応じて変更
    8. WDTモデルファイル(source.yaml)の編集 – resources(JDBC)
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    14

    View Slide

  15. resoucesフィールド以下にはSelfTunigフィールドとしてワークマネー
    ジャの情報が記載されている
    ターゲットのクラスタ名など、適宜移行先の環境に合わせて修正する
    参考: ワーク・マネージャーの移行
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    15

    View Slide

  16. 1. 移行先の管理サーバに接続
    2. 所有者の変更
    3. リソースの移動
    4. oracleユーザにスイッチ
    9. 移行リソースの所有者変更
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    16
    sudo mv source.* /home/oracle/
    sudo su - oracle
    sudo chown oracle:oracle source.*

    View Slide

  17. ※「2. 移行元でdiscoverDomainコマンドの実行」 と同様の手順
    ※「3. 移行先の管理サーバへファイルを転送」にてweblogic-deploy.zipも含めてファイルを移行した場合、unzipした後
    に以下 3. の手順を行えばよい
    1. JAVA_HOMEが設定されているかを確認
    2. WDTのダウンロードとunzip
    3. スクリプトの権限変更
    10. 移行先の管理サーバにWDTをインストール
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    17
    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

    View Slide

  18. 1. 環境変数の確認
    2. updateDomainの実行
    3. (任意) topologyセクションに変更を加える場合のみ再起動(restartDomainもしくはstop/startWebLogicの実行)
    が必要
    11. updateDomain の実行
    Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
    18
    echo $DOMAIN_HOME
    echo $MW_HOME
    weblogic-deploy/bin/updateDomain.sh ¥
    -oracle_home $MW_HOME ¥
    -domain_home $DOMAIN_HOME ¥
    -model_file source.yaml ¥
    -variable_file source.properties ¥
    -archive_file source.zip ¥
    -admin_url t3://$(hostname -i):9071

    View Slide

  19. View Slide