oracle cloud デザイン・パターン -java cloud service apptocloud-

22
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Oracle Cloud デデデデ デデデデ -Java Cloud Service AppToCloud- 2017 年 2 年 28 年 年年年年年年年年年年 年年年年 年年年年年年年年年年 Fusion Middleware 年年年年 年年年年

Post on 14-Apr-2017

80 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |

Oracle Cloud デザイン・パターン-Java Cloud Service AppToCloud-

2017 年 2 月 28 日日本オラクル株式会社クラウド・テクノロジー事業統括 Fusion Middleware 事業本部

平井健人

Page 2: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

Safe Harbor StatementThe following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Oracle Confidential – Internal/Restricted/Highly Restricted 2

Page 3: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

Document Control

• 本資料は、 Oracle WebLogic Server 12cR2 ならびに Java Cloud Service 17.1.2 を前提に説明します–製品・サービスのアップデートに伴い、内容が変更される可能性があります–最新情報は、各製品・サービスのマニュアルやドキュメントをご確認下さい

3

Page 4: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

Document Control

4

Date Version

変更箇所

2017/2 1.0 WebLogic 12.2.1 + JCS 17.1.2 で資料作成

Page 5: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 5

JCS AppToCloud

Page 6: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 6

アーキテクチャー設計時に生じる典型的な課題( JCS 編)

• お客様の声– 既存の WebLogic ドメイン(オンプレミス環境)をクラウド移行するにはどうすれば良

いの?

• 解決したい課題– オンプレミス環境の WebLogic ドメインを有しており、クラウド移行したいが、クラウ

ドでも同じ環境を一から作るのは手間がかかる。– 既存の WebLogic 環境のテスト環境や開発環境が必要だが、 HW 等準備するには、コス

トと時間がかかる。

設計課題

Oracle Cloud を検討してくれているお客様の声と課題

Page 7: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

JCS AppToCloud(クラウド移行)

7

設計ガイド

• Oracle Cloud での解決方法:– AppToCloud ツールにより、 WebLogic サー

バのサーバ / クラスタ構成、アプリケーション、共有ライブラリ、データソース等が簡単に JCSに移行可能です。

– a2c-healthcheck をエクスポート対象の稼働中のドメインに対して実行し、サーバ / クラスタ / アプリケーションの状態を確認してサーバから JVM 構成情報を取得します。

– a2c-export により、ドメイン構成をエクスポートし、アーカイブしたファイルをStorage Cloud Service へアップロードします。

– JCS コンソールよりインスタンスを作成し、外部リソースのマッピングを行い、インポートします。

WebLogicServer

AppToCloud ツールダウンロード

ドメイン構成アーカイブ

JCS サービスコンソールCreate / Import

アプリケーションデータソースマッピング

a2c-export• Plug/Unplug• Data Pump• Backup Restore

a2c-healthcheckStorage Cloud

Service

Java CloudService

Database Cloud Service

オンプレミス Database

Page 8: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 8

• メリット:– オンプレミスの WebLogic Server 環境を簡単

にクラウド移行できます。

– 従来通りの設計思想を活かしながら、クラウド・スケーリング、バックアップ管理、他クラウド連携等のクラウド提供の機能を利用した運用・開発が可能です。

– クラウドに移行することで、設備投資の削減、運用コストの削減、クラウド機能の活用による開発 / 運用性の向上を実現できます。

– ロードバランサを追加構成可能です。

– Database Cloud Service とのマッピングが可能です。

• 補足事項:– 対象の WebLogic Server のバージョンは

WebLogic Server 10.3.3 以降です。

– 移行先の JCS 上の WebLogic Server のエディションは Enterprise Edition 以上になります。

– AppToCloud ツールは JDK7 以降で実行します。WebLogic Server のランタイム環境が JDK6の場合もツールの実行は JDK7 以降になります。

– アップロード先の Storage Cloud Service コンテナは先に作成しておく必要がございます。

– DB の移行作業が別途必要です。

設計ガイドJCS AppToCloud(クラウド移行)

Page 9: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 9

WebLogicドメイン構成のエクスポート

JCS インスタンスの作成 エクスポート構成のインポート

構築ガイド

※ 上記の前にデータベースの移行が別途必要です。

JCS AppToCloud(クラウド移行)

AppToCloud 手順

[Step1] [Step2] [Step3]

Page 10: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

[Step1] WebLogic ドメイン構成のエクスポート

10

[1-1] AppToCloud ツールのダウンロード

1. 下記 OTN(Oracle Technology Network) の AppToCloud ツールダウンロードページにアクセスします。http://www.oracle.com/technetwork/topics/cloud/downloads/java-cloud-apptocloud-3042466.html

2. License Agreement を確認し、同意いただけたら「 Accept License Agreement 」を選択します。

3. 「 Download Oracle Java Cloud Service - AppToCloud Tooling 」をクリックしてダウンロードます。

構築ガイドJCS AppToCloud

Page 11: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

[Step1] WebLogic ドメイン構成のエクスポート

11

[1-2] AppToCloud ツールの配置

1. エクスポート対象となる WebLogic ドメインの管理サーバにダウンロードした「 a2c-zip-installer.zip 」を配置します。

2. ファイルを展開します。必要であればAppToCloud ツール用の新規ディレクトリを作成し、そのディレクトリに展開します。

3. 「 oracle_jcs_app2cloud/bin/a2c-healthcheck.sh 」が指定したディレクトリに存在することを確認します。

構築ガイドJCS AppToCloud

$ mkdir /u01/tools

$ unzip a2c-zip-installer.zip -d /u01/tools

$ /u01/tools/oracle_jcs_app2cloud/bin/a2c-healthcheck.sh

2. コマンド実行例

2. コマンド実行例

3. ディレクトリパスの例

Page 12: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 12

[1-3] オンプレミス WebLogic ドメインの状態チェック

1. 実行中の管理サーバにアクセスし、ドメイン内すべてのサーバを起動します。

2. ORACLE_HOME 、管理サーバの管理URL 、ドメインのシステム管理者資格証明を特定します。

3. 左記のコマンド実行例のように、 Step1で展開されたファイル「 a2c-healthcheck.sh 」を実行します。

※次スライドに実行結果の例を示します。

構築ガイド

$ a2c-healthcheck.sh -oh $ORACLE_HOME -adminUrl t3://192.168.33.10:7001 -adminUser weblogic -outputDir /home/oracle/output

[Step1] WebLogic ドメイン構成のエクスポートJCS AppToCloud

WebLogicServer

a2c-healthcheck

/outputDir

ヘルスチェックレポート ランタイム情報

出力結果

Usage: a2c-healthcheck.sh [-help] -oh <ORACLE_HOME: (WLS インストールディレクトリ )> -adminUrl < 管理サーバ URL>-outputDir < レポート出力先ディレクトリ > [-wlstTimeout < タイムアウト時間 [( ミリ秒 )][ [-adminUser < 管理者ユーザ >] | [-walletDir <Oracle ウォレットファイル配置ディレクトリ >   -adminUserAlias < エイリアス >] | [-userConfigFile <ユーザ構成ファイル※ > -userKeyFile <鍵ファイル

>] ]

オプション

※) storeUserConfig で生成するクレデンシャル情報ファイル

コマンド実行例

Page 13: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 13

a2c-healthcheck.sh -oh $ORACLE_HOME -adminUrl t3://192.168.33.11:7001 -outputDir /home/oracle/output/ -wlstTimeout 60 000 -adminUser weblogicJDK version is 1.8.0_112-b15A2C_HOME is /vagrant_data/apptocloud/oracle_jcs_app2cloud/usr/java/default/bin/java -Xmx512m -cp /vagrant_data/apptocloud/oracle_jcs_app2cloud/jcs_a2c/modules/features/jcsa2c_lib.jar -Djava.util.logging.config.class=oracle.jcs.lifecycle.util.JCSLifecycleLoggingConfig oracle.jcs.lifecycle.healthcheck.AppToCloudHealthCheck -oh /u01/app/oracle/product/fmw12.1.3.0 -adminUrl t3://192.168.33.11:7001 -outputDir /home/oracle/output/ -wlstTimeout 60000 -adminUser weblogicThe a2c-healthcheck program will write its log to /vagrant_data/apptocloud/oracle_jcs_app2cloud/logs/jcsa2c-healthcheck.logEnter the password for WebLogic user weblogic:Checking Domain HealthConnecting to domain

Connected to the domain mydomain

Checking Java Configuration...checking server runtime : AdminServer...checking server runtime : mydomain_server1...checking server runtime : mydomain_server2Done Checking Java ConfigurationChecking Servers Health

Done checking Servers HealthChecking Applications HealthChecking medrecChecking chatChecking physicianDone Checking Applications HealthChecking Datasource HealthDone Checking Datasource HealthChecking JMS Health

Done Checking JMS HealthDone Checking Domain Health

Activity Log for HEALTHCHECK

Informational Messages:

1. JCSLCM-04037: Health Check Completed

An HTML version of this report can be found at /home/oracle/output/reports/mydomain-healthcheck-activityreport.html

Output archive saved as /home/oracle/output/mydomain.zip. You can use this archive for the a2c-export tool.

a2c-healthcheck completed successfully (exit code = 0)

実行結果例実行コマンド例

次のエクスポートで使用します。

Page 14: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |

14

[1-4] ドメインのエクスポート

1. Step2 の Health チェック完了後の出力、レポート・ファイルまたはログ・ファイルを使用し、生成されたアーカイブ・ファイルのパスおよびファイル名を特定します。

2. ORACLE_HOME 、 DOMAIN_HOME ( WebLogic Server ドメインの最上位レベルのディレクトリ)を特定します。

3. 左記のコマンド実行例のように、先ほど展開されたファイル「 a2c-export.sh 」を実行します。

※次スライドに実行結果の例を示します。

構築ガイド

$ a2c-export.sh -oh $ORACLE_HOME -domainDir /u01/app/oracle/config/domains/mydomain -archiveFile output/mydomain.zip -cloudStorageContainer Storage-iddomain/Container_A2C -cloudStorageUser weblogic

[Step1] WebLogic ドメイン構成のエクスポートJCS AppToCloud

WebLogicServer

a2c-export

Usage: a2c-export.sh [-help] -oh <ORACLE_HOME> -domainDir < エクスポート対象ドメインディレクトリ > -archiveFile <ヘルスチェック結果>

[-clusterToExport < エクスポート対象のクラスタ名>][-clusterNonClusteredServers <非クラスタ構成時に作成するクラスタ名

>[-cloudStorageContainer <Storage Cloud コンテナ名>][ [-walletDir <Oracle ウォレットファイル配置ディレクトリ > -cloudStorageUserAlias < エイリアス >] | [-cloudStorageUser <Storage Cloud ユーザ名>] ]

オプション

コマンド実行例

Storage Cloud Service

Page 15: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 15

a2c-export.sh -oh $ORACLE_HOME -domainDir $DOMAIN_HOME -archiveFile /home/oracle/output/mydomain.zip -cloudStorageCon tainer Storage-plprivateee/Container_A2C -cloudStorageUser shinyayJDK version is 1.8.0_112-b15A2C_HOME is /vagrant_data/apptocloud/oracle_jcs_app2cloud/usr/java/default/bin/java -Xmx512m -cp /vagrant_data/apptocloud/oracle_jcs_app2cloud/jcs_a2c/modules/features/jcsa2c_lib.jar -Djava.util.logging.config.class=oracle.jcs.lifecycle.util.JCSLifecycleLoggingConfig oracle.jcs.lifecycle.discovery.AppToCloudExport -oh /u01/app/oracle/product/fmw12.1.3.0 -domainDir /u01/app/oracle/config/domains/fmw12.1.3.0/mydomain -archiveFile /home/oracle/output/mydomain.zip -cloudStorageContainer Storage-plprivateee/Container_A2C -cloudStorageUser shinyayThe a2c-export program will write its log to /vagrant_data/apptocloud/oracle_jcs_app2cloud/logs/jcsa2c-export.logEnter the password for Oracle Storage Cloud user shinyay:####<Nov 11, 2016 5:39:55 AM> <INFO> <AppToCloudExport> <getModel> <JCSLCM-02005> <Creating new model for domain /u01/app/oracle/config/domains/fmw12.1.3.0/mydomain>####<Nov 11, 2016 5:39:56 AM> <INFO> <EnvironmentModelBuilder> <populateOrRefreshFromEnvironment> <FMWPLATFRM-08552> <Try to discover a WebLogic Domain in offline mode>####<Nov 11, 2016 5:40:19 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08683> <Discovering domain-level settings for domain mydomain-domain>####<Nov 11, 2016 5:40:20 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08694> <Discovering servers for domain mydomain-domain>####<Nov 11, 2016 5:40:57 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08696> <Discovering migratable targets for domain mydomain-domain>####<Nov 11, 2016 5:40:57 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08695> <Discovering clusters for domain mydomain-domain>####<Nov 11, 2016 5:40:59 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08698> <Discovering partitions for domain mydomain-domain>####<Nov 11, 2016 5:40:59 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08697> <Discovering node managers for domain mydomain-domain>####<Nov 11, 2016 5:40:59 AM> <INFO> <EnvironmentDiscovery> <discoverDomain> <FMWPLATFRM-08680> <Discovering applications for domain mydomain-domain>####<Nov 11, 2016 5:41:00 AM> <INFO> <EnvironmentDiscovery> <discoverDomain>

####<Nov 11, 2016 5:41:10 AM> <INFO> <AppToCloudExport> <archiveFileStores> <JCSLCM-02004> <FileStore added to the archive: MedRec-fs as a2c/stores/MedRec-fs/>####<Nov 11, 2016 5:41:12 AM> <INFO> <AppToCloudExport> <run> <JCSLCM-02009> <Successfully exported model and artifacts to /home/oracle/output/mydomain.zip. Overrides file written to /home/oracle/output/mydomain.json>####<Nov 11, 2016 5:41:12 AM> <INFO> <AppToCloudExport> <run> <JCSLCM-02028> <Uploading override file to cloud storage from /home/oracle/output/mydomain.json>####<Nov 11, 2016 5:41:26 AM> <INFO> <AppToCloudExport> <run> <JCSLCM-02028> <Uploading archive file to cloud storage from /home/oracle/output/mydomain.zip>####<Nov 11, 2016 5:41:45 AM> <INFO> <AppToCloudExport> <run> <JCSLCM-02009> <Successfully exported model and artifacts to https://plprivateee.storage.oraclecloud.com. Overrides file written to Storage-plprivateee/Container_A2C/mydomain.json>

Activity Log for EXPORT

Informational Messages:

1. JCSLCM-02030: Uploaded override file to Oracle Cloud Storage container Storage-plprivateee/Container_A2C 2. JCSLCM-02030: Uploaded archive file to Oracle Cloud Storage container Storage-plprivateee/Container_A2C 3. JCSLCM-02031: Export Completed

Features Not Yet Implemented Messages:

1. JCSLCM-00579: Export for Security configuration is not currently implemented and must be manually configured on the target domain.

An HTML version of this report can be found at /home/oracle/output/reports/mydomain-export-activityreport.html

Successfully exported model and artifacts to https://plprivateee.storage.oraclecloud.com. Overrides file written to Storage-plprivateee/Container_A2C/mydomain.json

a2c-export completed successfully (exit code = 0)

実行結果例

次のインスタンス作成で使用します。

実行コマンド例

Page 16: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 16

[2-1] JSON ファイルの指定

1. JCS サービス・コンソールにアクセスします。

2. 「サービスの作成」から「 Java Cloud Service – AppToCloud 」をクリックします。

3. Step3 でエクスポートされた Storage Cloud Service 上の JSON ファイルの詳細を入力し、「 OK 」をクリックします。

構築ガイド[Step2] JCS インスタンスの作成JCS AppToCloud

Page 17: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 17

[2-2] サブスクリプション・タイプの設定

1. ソフトウェア・リリース、ソフトウェア・エディションを選択します。

2. 選択が完了したら、サービス詳細画面でサービスの詳細情報を入力します。

※ ソースのドメイン構成に基づいて、これらの画面に特定のオプションが「推奨」として表示されますが、変更可能です。※WebLogic Server 11g は使用できません。AppToCloud で作成されたすべてのサービス・インスタンスは、ソース・ドメインが11g を実行している場合でも、 12c でプロビジョニングされます。※Standard Edition は選択できません。

構築ガイド[Step2] JCS インスタンスの作成JCS AppToCloud

Page 18: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 18

[2-3] 外部リソースのマッピング

1. 「サービスの追加詳細」画面で、最初のアプリケーション・データ・ソースとJavaMail セッションを構成します。

2. 「 OK 」をクリックして変更を受け入れるか、「無効化」をクリックしてこのデータ・ソース /JavaMail セッションをサービス・インスタンスから削除します。

3. マッピングが完了したら「次へ」をクリックします。

4. 確認画面で内容に問題がなければ「作成」をクリックします。

構築ガイド[Step2] JCS インスタンスの作成JCS AppToCloud

定義済みのデータソースとDatabase Cloud Serviceインスタンスをマッピング

外部メールサーバとJavaMail 定義をマッピング

Page 19: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 19

[3-1] WebLogic ドメインのインポート

1. プロビジョニングが完了したらサービス・インスタンス名の横にある アイコンをクリックし、「 App To Cloud のインポート」を選択します。

2. 確認が求められた場合は「はい」をクリックします。

3. 「アクティビティ」タブでインポートの進捗を監視できます。

構築ガイド[Step3] エクスポート構成のインポートJCS AppToCloud

Page 20: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 20

[3-2] 構成の確認

1. インポートが完了したら、「 WebLogic Server コンソールを開く」から管理コンソールにアクセスします。

2. オンプレミス環境で定義されていたデータソース、 JavaMail 、デプロイ済アプリケーション等が登録されていることを確認します。

構築ガイド[Step3] エクスポート構成のインポートJCS AppToCloud

オンプレミス環境でデプロイしていたアプリケーションがデプロイ済み

オンプレミス環境で定義していたデータソースが登録済み

Page 21: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 21

Page 22: Oracle Cloud デザイン・パターン -Java Cloud Service AppToCloud-