php on windows azure in open source conference

32
1 マイクロソフト株式会社 デベロッパー エバンジェリスト 井上大輔 ([email protected]) Blog http://blogs.msdn.com/daisukei/ Twitter http://twitter.com/daisukei777

Upload: microsoft

Post on 21-Jan-2015

3.525 views

Category:

Technology


2 download

DESCRIPTION

Open Source Conference in Japan.

TRANSCRIPT

Page 1: PHP on Windows Azure in Open Source Conference

1

マイクロソフト株式会社 デベロッパー エバンジェリスト 井上大輔 ([email protected]) Blog http://blogs.msdn.com/daisukei/ Twitter http://twitter.com/daisukei777

Page 2: PHP on Windows Azure in Open Source Conference

2

Agenda

Windows Azure を理解する

PHP on Windows Azure 開発のポントを理解する

さらなる活用に向けて

Page 3: PHP on Windows Azure in Open Source Conference

3

Agenda

Windows Azure を理解する

PHP on Windows Azure 開発のポントを理解する

さらなる活用に向けて

Page 4: PHP on Windows Azure in Open Source Conference

4

クラウドとは(一般論)

ンターネットをベースとしたコンピュータの利用形態

巨大なデータセンターがバックボーン

広い概念なので、ASP や ユーテゖリテゖコンピューテゖング等いろいろ包括

押さえておきたい用語は SaaS、PaaS、HaaS

「所有」から「利用」へ

スケーラブル 必要な時利用

ンターネット

Page 5: PHP on Windows Azure in Open Source Conference

HaaS ハードウェアを提供

PaaS 開発・実行環境となる プラットフォームを提供

SaaS 完成品の

ソフトウェアを提供

ネットワーク

ハードウェア

OS+ミドル

アプリ

ネットワーク

ハードウェア

OS+(ミドル)

ネットワーク

ハードウェア

アプリ

OS+ミドル

アプリ カスタマイズ

ユーザが準備するもの

事業者側が提供するもの

クラウドの概念を整理(一般論)

Page 6: PHP on Windows Azure in Open Source Conference

6

Windows Azure ~ スケーラブルなクラウド OS ~

仮想化技術で大規模データセンターのサーバー群を制御し、高い可用性とスケーラビリテゖを実現

信頼性の高いストレージ ゕプリ、ミドルウェゕ実行環境

Page 7: PHP on Windows Azure in Open Source Conference

7

Windows Azure ~ Compute ~

• Web ゕプリ 実行環境

• IIS (FastCGI サポート)がベース Web Role

• MySQL などのミドルウェゕを実行

• バッチ ジョブのような処理を実行 Worker Role

※各 Role 毎にンスタンス数は

動的にいつでも増減可能

Page 8: PHP on Windows Azure in Open Source Conference

8

Windows Azure ~ 内部構成 ~

Worker Role

Worker Role

LB

Storage

Port 25

HTTP/HTTPS

※任意のTCPポートで通信可能

バックエンドで

の処理が基本形 インターネット

Page 9: PHP on Windows Azure in Open Source Conference

9

Windows Azure ~ Storage ~

• Table = Key Value ストゕ

• BLOB = 大容量バナリ格納

• QUEUE = メッセージ キュー

Azure

Storage

• クラウド上の NTFS サービス

• 将来提供予定(現在 β)

Azure

Drive

※ ほぼ無尽蔵ストレージ領域を利用可能

Page 10: PHP on Windows Azure in Open Source Conference

10

Azure Video …

Page 11: PHP on Windows Azure in Open Source Conference

11

Demo

Page 12: PHP on Windows Azure in Open Source Conference

12

Web サーバー

Virtual

Windows Server

Linux

PHP サーバープラットフォーム の比較

DB MySQL SQL Server

Apache IIS

従来の サーバー プラットフォーム

VMware ESX Server

Windows Hyper-V

PHP アプリ

自社内、ホステゖングなど

PHP アプリ

Worker Role (MySQL)

Web Role (IIS) ※ Fast CGI サポート

マクロソフト の データセンター

Windows Azure プラットフォーム

Azure Drive

Azure Storage NTFS FS

OS

Page 13: PHP on Windows Azure in Open Source Conference

13

Agenda

Windows Azure を理解する

PHP on Windows Azure 開発のポントを理解する

さらなる活用に向けて

Page 14: PHP on Windows Azure in Open Source Conference

14

PHP アプリ開発全体像

アプリケーション パッケージ

Windows Azure SDK

Windows Azure ポータル

Windows Azure ポータル

アプリケーション パッケージ

テキスト エデゖターなど

Page 15: PHP on Windows Azure in Open Source Conference

15

PHP アプリ開発環境 ~ Windows Azure 専用の設定フゔルとパッケージ ~

サービス定義ファイル ServiceDefinition.csdef

サービス構成ファイル

ServiceConfiguration.cscfg

サービスパッケージファイル XXX.cspkg

動的変更不可 ロール、プロトコル、

ポート 等

動的変更可能 ンスタンス数、Storage ゕカウント等

PHP の exe フゔル、作成したPHPゕプリ

Page 16: PHP on Windows Azure in Open Source Conference

16

PHP アプリ開発環境 ~ パッケージ化するためのツール群 ~

cspack.exe Windows Azure SDK のコマンド

Visual Studio Windows Azure Tools for Microsoft Visual Studio

Eclipse Windows Azure tools for Eclipse

Page 17: PHP on Windows Azure in Open Source Conference

17

Demo

Page 18: PHP on Windows Azure in Open Source Conference

18

デバッグ環境 ~ Windows Azure シミュレーション環境 ~

Windows Azure シミュレーション環境

Development Fabric Development Storage

Page 19: PHP on Windows Azure in Open Source Conference

19

Demo

Page 20: PHP on Windows Azure in Open Source Conference

20

PHP アプリ開発環境 ~ Azure Storage へのゕクセス ~

Windows Azure SDK for PHP Azure Storage へ簡単ゕクセス

Zend Framework 1.10 Zend_Service_WindowsAzure コンポーネントが提供されており Azure Storage へ簡単ゕクセス

Windows Azure Storage Explorer Azure Storage 用エクスプローラー

Page 21: PHP on Windows Azure in Open Source Conference

21

Demo

Page 22: PHP on Windows Azure in Open Source Conference

22

Agenda

Windows Azure を理解する

PHP on Windows Azure 開発のポントを理解する

さらなる活用に向けて

Page 23: PHP on Windows Azure in Open Source Conference

23

アクセラレーター ~ MySQL 、CMS の利用を容易に ~

Windows Azure PHP Solution Accelerator

Windows Azure MySQL Solution Accelerator

Windows Azure Solution Accelerator

Page 24: PHP on Windows Azure in Open Source Conference

MySQL PHP Solution Accelerator

Worker Role として MySQL を起動 常駐させ、それを Web Role から利用

MySQL (Worker Role)

ンターネット

Page 25: PHP on Windows Azure in Open Source Conference

MySQL PHP Solution Accelerator

カスタマズにより MySQL の冗長化が可能

MySQL Master (Worker Role)

MySQL Slave (Worker Role)

ンターネット

Page 26: PHP on Windows Azure in Open Source Conference

MediaWiki Solution Accelerator

MediaWiki のバックエンドに、MySQL とMemcached を冗長化構成で利用

Memcached (Worker Role)

ンターネット

ンターネット

Page 27: PHP on Windows Azure in Open Source Conference

PHP on Windows Azure ガイドライン

http://msdn.microsoft.com/ja-jp/azure/ff394366.aspx

Page 28: PHP on Windows Azure in Open Source Conference

28

まとめ

Windows Azure を理解する

PHP on Windows Azure 開発のポントを理解する

さらなる活用に向けて

Page 29: PHP on Windows Azure in Open Source Conference

29

タダで Windows Azure を使い倒す

誰でも使えるお試しプラン

クレジットカードの登録は必要

やろうと思えばLive IDをたくさん用意して…

MSDN購読特典でAzureが実質1ンスタンス使い放題 (8ヶ月間)

会社でMSDN購読していて誰もAzure使っていなければ 手を回してゲット

25時間/月まで 0 円

MSDNが ついてくる

750時間/月まで 0 円

スタートゕップ企業なら、マクロソフトの支援プログラムに加入できる

加入するともれなくMSDNがついてくる。すなわちAzure利用権付き

MSDN

サブスクリプション BizSpark への加入

初期特別

プラン

Page 30: PHP on Windows Azure in Open Source Conference

30

Windows Azure を使う時の注意点

課金の原則 CPU使用率は関係なく占有したデプロ時間で課金

Runしてなくてもデプロすれば(削除しない限り)課金発生

ステージングも同じレート

最小単位は1時間

Page 31: PHP on Windows Azure in Open Source Conference

31

リソース情報

Windows Azure Portal(日本語) http://www.microsoft.com/japan/WindowsAzure/

Windows Azure Interoperability (日本語) http://www.microsoft.com/japan/windowsazure/interop/

Windows Azure Tools for Eclipse (英語) http://www.windowsazure4e.org/

Page 32: PHP on Windows Azure in Open Source Conference

32