© 2015 IBM Corporation
IBM Containers support
2015年 9月 29日日本アイ・ビー・エム株式会社 クラウド事業統括
Bluemixテクニカル・セールス 古川 正宏
IBM Bluemixwww.bluemix.net
© 2015 IBM Corporation 2
© Copyright IBM Corporation 2012. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. IBM, the IBM logo, Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM products and services are trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.
ワークショップ、セッション、および資料は、IBMまたはセッション発表者によって準備され、それぞれ独自の見解を反映したものです。それらは情報提供の目的のみで提供されており、いかなる参加者に対しても法律的またはその他の指導や助言を意図したものではなく、またそのような結果を生むものでもありません。本講演資料に含まれている情報については、完全性と正確性を期するよう努力しましたが、「現状のまま」提供され、明示または暗示にかかわらずいかなる保証も伴わないものとします。本講演資料またはその他の資料の使用によって、あるいはその他の関連によって、いかなる損害が生じた場合も、IBMは責任を負わないものとします。 本講演資料に含まれている内容は、IBMまたはそのサプライヤーやライセンス交付者からいかなる保証または表明を引きだすことを意図したものでも、IBMソフトウェアの使用を規定する適用ライセンス契約の条項を変更することを意図したものでもなく、またそのような結果を生むものでもありません。
本講演資料でIBM製品、プログラム、またはサービスに言及していても、IBMが営業活動を行っているすべての国でそれらが使用可能であることを暗示するものではありません。本講演資料で言及している製品リリース日付や製品機能は、市場機会またはその他の要因に基づいてIBM独自の決定権をもっていつでも変更できるものとし、いかなる方法においても将来の製品または機能が使用可能になると確約することを意図したものではありません。本講演資料に含まれている内容は、参加者が開始する活動によって特定の販売、売上高の向上、またはその他の結果が生じると述べる、または暗示することを意図したものでも、またそのような結果を生むものでもありません。 パフォーマンスは、管理された環境において標準的なIBMベンチマークを使用した測定と予測に基づいています。ユーザーが経験する実際のスループットやパフォーマンスは、ユーザーのジョブ・ストリームにおけるマルチプログラミングの量、入出力構成、ストレージ構成、および処理されるワークロードなどの考慮事項を含む、数多くの要因に応じて変化します。したがって、個々のユーザーがここで述べられているものと同様の結果を得られると確約するものではありません。
記述されているすべてのお客様事例は、それらのお客様がどのようにIBM製品を使用したか、またそれらのお客様が達成した結果の実例として示されたものです。実際の環境コストおよびパフォーマンス特性は、お客様ごとに異なる場合があります。
IBM、IBM ロゴ、ibm.com、CICS、Tivoli、WebSphere、Zseriesは、世界の多くの国で登録されたInternational Business Machines Corporationの商標です。他の製品名およびサービス名等は、それぞれIBMまたは各社の商標である場合があります。現時点での IBM の商標リストについては、www.ibm.com/legal/copytrade.shtmlをご覧ください。
Linuxは、Linus Torvaldsの米国およびその他の国における登録商標です。Microsoft, Windows, Windows NT および Windowsロゴは Microsoft Corporationの米国およびその他の国における商標です。UNIXはThe Open Groupの米国およびその他の国における登録商標です。JavaおよびすべてのJava関連の商標およびロゴは Oracleやその関連会社の米国およびその他の国における商標または登録商標です。
© 2015 IBM Corporation 3
ご説明順序
•IBM Containersの基礎•MFPF v7.1におけるIBM Containersサポート•IBM Containers上でのMFPFイメージの稼働方法
© 2015 IBM Corporation 4
IBM Containersの基礎
© 2015 IBM Corporation 5
IBM Containersとは
•IBM Bluemix上で稼働可能なアプリケーションの種類の一つ
•Dockerの稼働環境としてご利用可能
•オンプレミス環境や他のクラウドサービスとの可搬性に優れている
© 2015 IBM Corporation 6
Dockerの特徴
Build Ship Run
Anywhere
Any App
•分散型アプリケーションを構築・稼働させるためのオープンなプラットフォーム•活発なオープンソース・コミュニティーでコントリビューターが1300人以上•IBMの他にRed Hat, Rackspace, VMWare, Google, Microsoft, AWSらも参画
© 2015 IBM Corporation 7
Docker(IBM Containers)の構成要素
イメージ
• コンテナ構築するためのテンプレート。読み込み専用でDocker Hubに格納されるスナップショット
コンテナ
• アプリケーション・サービスを構成する基本的な単位
Docker ハブ (レポジトリ)
• SaaSもしくはオンプレミスで提供可能
• コンテナイメージを格納・配布・共有
Docker エンジン
• アプリケーション・コンテナーを作成・出荷・実行するプログラム
• 物理マシン、仮想マシン、サーバーのローカル環境、プライベート・クラウド、パブリック・クラウドを問わず実行可能
• Dockerクライアントとコマンドを実行するために対話
© 2015 IBM Corporation 8
仮想マシンとコンテナの動作イメージ
インフラストラクチャ
オペレーティング・システム
ハイパーバイザー
ゲストOS
ゲストOS
ゲストOS
バイナリライブラリ
バイナリライブラリ
アプリ1
バイナリライブラリ
アプリ2 アプリ3
インフラストラクチャ
オペレーティング・システム
Dockerエンジン
バイナリライブラリ
バイナリライブラリ
アプリ1
バイナリライブラリ
アプリ2 アプリ3
仮想マシン コンテナ
コンテナの特徴•コンテナ型の仮想化によりゲストOSからホストする仮想マシンと比べ、必要とする計算機資源が減少•コピー・オン・ライトのファイルシステムを使用し、アプリケーションごとに異なるファイルなどレイヤーごとにサポート。また共通化できる部分は再利用を促進。
© 2015 IBM Corporation 9
MFPF v7.1におけるIBM Containersサポート
© 2015 IBM Corporation 10
ハイブリッド・クラウドにおけるコンテナを活用したモバイル戦略の加速
開発スピードと生産性
+ すぐに試せる
+ 小さく初めて必要に応じてスケール
+ クラウド上で開発・テストを行い、好き
な場所にデプロイ
インテグレーションとポータビリティ
+ 環境間でアプリケーションやワークロー
ドを円滑に移動
+ 迅速に対応できるスケーラビリティ
+ IT資産とコストの最適化
Private
Public
オンプレ環境
モバイル・アプリケーション・サーバー
Hybrid Cloud
© 2015 IBM Corporation 11
想定されるユースケース
評価
MobileFirst Platformを
利用したモバイル・ア
プリケーションの評価、
開発者の初期のスキル
育成
開発
本番環境と類似の環境
を迅速に構築し、開発
チームが開発・テスト
を実行できる
本番稼働 *
複雑なインフラ設計を
行わずにスケーラブル
で柔軟な環境を、迅速
に構築可能
* 現状では利用における制限事項あり(2015年年末までに解消見込み)• アナリティクス機能における制限があり、小規模~中規模の処理に向いている• 個人情報などのセンシティブ・データはBluemix上のマルチテナント環境での利用に向かない
迅速にアプリケーションを開発し、サービスを提供する環境に最適です
© 2015 IBM Corporation 12
MFPF v7.1が提供する2種類のDockerイメージ
Getting Started Image Evaluation on Containers
用途 デモおよび評価を行うためのDockerイメージで、Bluemix上でそのままコンテナを作成・実行することを想定
本番稼働および開発に使用する全ての機能を備えたDockerイメージで、カスタマイズしてコンテナを作成することを想定
内容 1つのイメージ共通サービス、ランタイム、管理、データ、コンソール、アナリティックスの各機能とサンプルアプリケーションを含む
2つのイメージ1) ランタイム、管理、データ、
コンソールの機能を提供2) アナリティックスの機能を提
供
入手場所 Bluemix内のレポジトリ developerWorks
カスタマイズ
制限ありアプリの追加は可能実行環境のカスタマイズ不可
カスタマイズおよび拡張可能
© 2015 IBM Corporation 13
IBM Containers上でのMFPFイメージの稼働方法
© 2015 IBM Corporation 14
Getting Started Imageイメージ利用の手順
コンテナのデプロイと実行
Bluemix上のIBM Containersサービス上にコンテナをデプロイし、実行
© 2015 IBM Corporation 15
Getting Started Imageのパッケージ
Bluemix上のContainersのレポジトリーにイメージが登録され、ユーザーのカタログ上に表示されます。
イメージに含まれるコンポーネント•MobileFirst Platform Server•MobileFirst Platform Data Proxy•MobileFirst Platform Operational Analytics•MobileFirst Platform Server 用のDerby データベース•モバイル・ブラウザー・シミュレーター•サンプル・アプリケーションと一連のアダプター (MobileFirstStarter)
© 2015 IBM Corporation 16
Getting Started Image利用の事前準備
IBM Bluemixを利用するためのアカウントIBM IDの登録Bluemixへのアカウント登録(IBM Container利用のためのプライベート・レジストリ)
© 2015 IBM Corporation 17
Getting Started Imageの利用
© 2015 IBM Corporation 18
Getting Started Imageの利用
© 2015 IBM Corporation 19
Getting Started Imageの利用
© 2015 IBM Corporation 20
Getting Started Imageの利用
© 2015 IBM Corporation 21
Getting Started Imageの利用
この例ではadmin/adminで設定しています
© 2015 IBM Corporation 22
Getting Started Imageの利用
Operations Console
Operational Analytics Console
Logのダウンロード
© 2015 IBM Corporation 23
Getting Started Imageの利用
© 2015 IBM Corporation 24
Getting Started Imageの利用
© 2015 IBM Corporation 25
Getting Started Imageの利用
以下のディレクトリに出力されたファイルを表示/var/log/rsyslog/opt/ibm/wlp/usr/servers/defaultServer/logs
© 2015 IBM Corporation 26
Evaluation on Containersイメージ利用の手順
①イメージのカスタマイズ
②イメージのビルド
③コンテナのデプロイと実行
製品コンポーネントのカスタマイズ(お客様環境に合わせた設定の実施)
イメージをコンテナとして実行できるようにビルド
Bluemix上のIBM Containersサービス上にコンテナをデプロイし、実行
© 2015 IBM Corporation 27
Evaluation on Containersイメージのパッケージ
製品コンポーネントを含む2つのイメージ”mfpf-server”と”mfpf-analytics”を提供します。実行する環境に合わせて設定をカスタマイズし、コンテナをビルドします。ビルドしたコンテナはBluemix上のContainersのレポジトリーにイメージが登録され、実行できるようになります。
イメージはdeveloperWorks上のページから入手できますイメージの構成
ビルド実行時に使用されるライブラリと依存関係にあるファイルを提供
MFPF Operational Analytics イメージ用のファイル群
MFP Server イメージ用のファイル群
© 2015 IBM Corporation 28
Evaluation on Containersイメージのパッケージ
イメージの構成
mfpf-server(mfpf-analytics)の構成
Dockerイメージをbuildするための構成設定ファイル
キーストアの構成、ユーザー・レジストリーの構成、MDPFサーバーの設定プロパティ
サーバー環境の構成
MFPプロジェクトの実行場所(.war)
キーストア, トラストストア, LTPAキー格納場所
ssh公開鍵ファイル格納場所
Bluemix上のData Cacheサービス使用時の関連ファイル格納場所
© 2015 IBM Corporation 29
Evaluation on Containersイメージのパッケージ
イメージの構成
mfpf-server(mfpf-analytics)の構成
イメージのビルドに必要なスクリプト群が含まれる
設定値のプロパティファイルが含まれ、主にこれらのファイルに設定を行う
実行用のシェルスクリプト
サーバー環境構築時に必要となる設定ファイルが含まれる
© 2015 IBM Corporation 30
Evaluation on Containersイメージのパッケージ
“mfpf-server” イメージが含むコンポーネント•MobileFirst Platform Server•MobileFirst Platform Operations Console•MobileFirst Platform Data Proxy
“mfpf-analytics” イメージが含むコンポーネント•MobileFirst Platform Operational Analytics server•MobileFirst Platform Operational Analytics console
© 2015 IBM Corporation 31
Evaluation on Containersイメージ利用の事前準備
MobileFirst Platform Command Line InterfaceBoot2docker
Mac OS X オペレーティング・システムの場合、Boot2docker VM をインストールし、一部スクリプトは必ず管理特権を使用して実行するようにしてください。
Docker のインストール済み環境
Cloud Foundry CLI ICE (IBM Containers Extention) Java SE 7 以降IBM Bluemix アカウント
IBM IDの登録Bluemixへのアカウント登録(IBM Container利用のためのプライベート・レジストリ)
MobileFirst Platform Server用のDB(Cloudant, SQL Database)*Windows OSでは現状動作しません。
© 2015 IBM Corporation 32
Evaluation on Containersイメージ利用の手順
Boot2docker の bash を起動します。(Docker Quickstart Terminalの起動)
developerWorksよりダウンロードしたzipイメージの解凍先のディレクトリを<image_root>として、カレントディレクトリを以下のディレクトリとします。<image_root>/mfpf-server/scripts
MFP CLIにContainer Extensionを追加するため以下のコマンドを実行します。(Mac OSではsudoを使用する必要があります)
Bluemix に CLI経由でログインするため以下のコマンドを実行します
$ ./installcontainercli.sh
$ ./initenv.sh args/initenv.properties
© 2015 IBM Corporation 33
Evaluation on Containersイメージ利用の手順
initenv.properties の例
© 2015 IBM Corporation 34
MFPサーバーのデータベースを設定するため以下のコマンドを実行します。
※このコマンドは管理データベースに対して1回実行するほか、設定内容を各プロジェクトにあわせて変更し、実行する必要があります。
Evaluation on Containersイメージ利用の手順
$ ./prepareserverdbs.sh args/prepareserverdbs.properties
© 2015 IBM Corporation 35
Evaluation on Containersイメージ利用の手順
prepareserverdbs.properties の例
© 2015 IBM Corporation 36
Evaluation on Containersイメージ利用の手順
dockerイメージをビルドし、Bluemix上のプライベート・イメージ・レジストリに登録するため以下のコマンドを実行します。
$ ./prepareserver.sh args/prepareserver.properties
© 2015 IBM Corporation 37
Evaluation on Containersイメージ利用の手順
prepareserver.properties の例
© 2015 IBM Corporation 38
Evaluation on Containersイメージ利用の手順
実行環境で使用するIPアドレスを取得するために以下のコマンドを実行します。
IBM Containersサービス上でMFPサーバーを稼働するために以下のコマンドを実行します。
実行した後に以下のURLにあるコンソールにアクセスし、アプリケーションやアダプターを追加します。http://<IPアドレス>:9080/worklightconsole
$ ice ip request
$ ./startserver.sh args/startserver.properties
© 2015 IBM Corporation 39
Evaluation on Containersイメージ利用の手順
startserver.properties の例
© 2015 IBM Corporation 40
developerWorks上で提供される情報
Getting started with 7.1:https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/
Foundation on IBM Containershttps://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/bluemix/
Lightweight Evaluation (Getting Started Imageの利用)https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/bluemix/evaluate-foundation-on-bluemix/
Limited Production Environment (Evaluation on Containersイメージの利用)https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/bluemix/run-foundation-on-bluemix/
© 2015 IBM Corporation 41