Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

66

Click here to load reader

Transcript of Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Page 1: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Linux / Mac ユーザーのための Microsoft

Azure 仮想マシン 入門

Page 2: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

2

2010 年 日本マイクロソフト入社現在のお仕事: テクニカルエバンジェリスト得意エリア : WEB サイトのチューニング経歴 ・ 学生時代に就職活動 WEB サイトのビジネス立上げ ・ 日本 IBM にて、アウトソーシング部隊の SE に。 ・ 日本最大規模の電子チケットサイト の運用を7−8年経験 ・ クラウドをやりたくなり、日本マイクロソフト( Azure 営業)に転職 ・ 最近 エバンジェリスト

増渕 大輔

Page 3: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

前半の振り返り(クイズ)3

Page 4: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

それぞれの Azure Region には、600,000 サーバーが置ける

Page 5: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

1 つの Region にデータセンターが 16 個

Page 6: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

データセンターの面積は1 つのフットボール場に近い

Page 7: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

データセンターの面積は1 つのフットボール場に近い

Page 8: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

それは、 2 機のジャンボジェット機が格納できる広さ

Page 9: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

それは、 2 機のジャンボジェット機が格納できる広さ

Page 10: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Microsoft AzureMax / Linux 対応状況

10

Page 11: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Linux drivers for Hyper-Vsince 2010

多くの企業でLinux on Hyper-V

Microsoft ♡ Linux

Now

Linux is a real business for Microsoft

System Centersince 2009

We’ve been at this for a while

Linux and open source is a fundamental part of what we do

数百、数千の管理にSystem Center

Since “day 1” in 2013Linux VMs run on Azure

20+% Linux on Azure

Page 12: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Customers can easily deploy and manage their Linux and FreeBSD workloads in Azure.

Linux や FreeBSD へのサポートEnable the best experience for running Linux and FreeBSD on Hyper-V.

Provide great choice and flexibility in running Linux distributions and FreeBSD in Azure.

Page 13: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

実はかなり選択肢が豊富です

https://vmdepot.msopentech.com/List/Index http://azure.microsoft.com/ja-jp/marketplace/virtual-machines/

Page 14: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

14

Azure SDK

.NET Client Library

Visual Studio Tools

.NET SDK

Core SDK

Node.js Client Library

Node.js SDK

Core SDK

PHP Client Library

PHP SDK

Core SDK

Java Client Library

Java SDK

Core SDK

Eclipse Tools

• Windows, Linux, Mac Support.

Ruby Client Library

Core SDK

Ruby SDK

Ruby

Page 15: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Dozens of .NET & PHP CMS and Web applicationsApplications

/PaaS

Via HTMl/JS, cross-platform and nativeClients

Infrastructure & OS

Management

Databases &Middleware DocDB

App Frameworks

UbuntuSUSE, OpenSUSE,

OpenLogic CentOS-basedOracle Linux, CoreOS

VM Extensions

Full Stack in Azure

Page 16: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

サポートが必要なんですけどLinux and OSS Support on Azure

Announced on Tuesday, July 14, 2015

Page 17: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Microsoft Azure が提供するサービスコンピューティング

データサービス

TrafficManager

仮想ネットワーク ExpressRoute

モバイルサービスWEB サイト クラウドサービス仮想マシン

アプリケーションサービス

StorageBlobs テーブル キュー

SQL データベース MachineLeaningHD Insight 復旧サービス StoreSImple

Active Directory

BizTalk サービスService Bus

CDNAPI 管理

メディアサービス 通知ハブ

スケジューラ

Automation

CachingRemoteApp

VisualStudioOnline

ネットワーク

Files

Page 18: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

https://azure.microsoft.com/ja-jp/documentation/articles/virtual-machines-linux-opensource/

Page 19: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

動くのはわかった。

19

Page 20: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

実際に何に気を付ければよいの?20

Page 21: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Linux 管理のためのクライアント環境セットアップ• Windows の場合

• SSH Client の導入• Mac の 場合

• 特に何もいりません

21

Page 22: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Azure 管理のためのクライアント環境セットアップ• Azure はブラウザ操作なので基本的にはパソコン上でブラウザが動けば他には何もいりません• 運用上、 CLI を使いたい場合は、ツールのセットアップが必要です。(後述)

22

Page 23: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

23

Page 24: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

アカウント作成サブスクリプション作成

仮想マシン の設計仮想マシン の作成

Page 25: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

二つのドメイン

25

 

Microsoft Domain内の製品説明

http://www.microsoft.com/ja-jp/server-cloud/azure/Index.aspx 

http://azure.microsoft.com/

Microsoft Azure製品ポータル実際のアクションにつなげるのはこちら・ SDK ダウンロード・管理画面ログイン・ホワイトペーパーなど

概要説明簡易見積もりなど

Page 26: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

ログインアカウントの選択1. Microsoft アカウント

2. 組織アカウント26

Page 27: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

マイクロソフトアカウント・ “ Windows Live ID” の新しい名称・ コンシューマ向けサービスに利用可能   Outlook (Hotmail), SkyDrive, など・ 会社として利用することももちろん可能・ Microsoft ドメイン、会社の独自ドメイン の両方に対応

27

Page 28: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

組織アカウント・ 企業向けクラウドサービスに利用  例: Intune ,  Office 365・ 組織、管理者という概念あり・ ひとつでも作成可能・ Azure Active Directory で無料作成可能

28

Page 29: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

まずは簡単な方法Microsoft アカウントを作成する

• http://www.microsoft.com/ja-jp/msaccount/about/default.aspx

29

• https://signup.live.com/ 

Page 30: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

アカウントとサブスクリプション

30

アカウント・ Microsoft アカウント・組織アカウント サブスクリプション共同管理者アカウント・ Microsoft アカウント・組織アカウント共同管理者アカウント・ Microsoft アカウント・組織アカウント共同管理者アカウント・ Microsoft アカウント・組織アカウント

継続利用(購読の意味)契約単位

サブスクリプションごとに作成する Azure のシステムは独立

システムの共同管理者の作成もできます

Page 31: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

無料評価版を利用

31

 http://azure.microsoft.com/

Microsoft Azure製品ポータル評価版を試す

利用開始には無料評価版、または、購入が必要http://azure.microsoft.com/ja-jp/pricing/ • 無料評価版• 従量課金制サブスクリプション• オープン ボリューム ライセンス プログラム• エンタープライズ契約• BizSpark ( スタートアップ向け無料プラン )• DreamSpark ( 学生向け無料プラン )

Page 32: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

サブスクリプションを作成するとMicrosoft Azure にログインできます

32

 

Microsoft Domain

http://www.microsoft.com/ja-jp/server-cloud/azure/Index.aspx 

http://azure.microsoft.com/

Microsoft Azure製品ポータルMicrosoft Azure管理ポータルと、プレビューポータル

ログイン切り替え

Page 33: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

アカウント作成サブスクリプション作成

仮想マシン の設計仮想マシン の作成

Page 34: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

初期構築より継続運用が大事資産 → 利用

 余裕がある見積もり → ざっくりした見積もり手戻りコスト大 → 手戻りコスト小

構築作業が重要視 → 運用改善を重要視

さらに、仮想マシン以外のクラウド機能の活用により、実績のある方法を採用 → 合理性の高い最新技術

34

Page 35: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

初期の見積もりは個々よりも全体感から

35

配信サーバー 35台・仮想マシン S インスタンス

管理サーバ 2台・仮想マシン M インスタンス 

サーバー計 11台Storage

1110GB

トラフィックOut=15TB

主な項目■サーバー• スペック(型)• 台数• 常時稼働?

■ストレージ• OS/ システム:最低限• 業務データ: 全体量

■ネットワーク( Out )

Page 36: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

簡易見積もりツールMicrosoft Domain  内の製品説明サイト

Microsoft Azure 製品ポータルサイトhttp://www.microsoft.com/ja-jp/server-cloud/azure/Index.aspx

http://www.microsoft.com/ja-jp/server-cloud/azure/Index.aspx  

Page 37: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

37

どんなシステムを作るか?

Page 38: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

シングルサーバー

38

作成方法・ Azure Portal

・ VM Depot  

Page 39: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Azure Portal

• https://manage.windowsazure.com

Page 40: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

左下の「新規」ボタンから作成

Page 41: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

VM Depot

Page 42: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

VM Depot のイメージを手元の Azure 環境に複製

Page 43: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

仮想マシンに使える“イメージ”として登録

Page 44: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Azure CLI の導入 インストーラーを利用する場合  • OS X installer  • Linux installer

  Node がセットアップ済みの環境の場合   $ npm install azure-cli -g

  Docker container の環境に導入する場合  $ In a Docker host, run: docker run -it microsoft/azure-cli

44

https://azure.microsoft.com/ja-jp/documentation/articles/xplat-cli-install/

Page 45: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

45

どんなシステムを作るか?

Page 46: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

WEB 2台+ DB 1台

46

ポイントは・・・・ エンドポイントの構成・ データベースの選択肢  

Page 47: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

ネットワークの構造を確認

47

エンドポイント → 管理系通信として利用 → ロードバランサ―として利用

Page 48: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

管理系の通信管理系のプロトコルについては、ポート フォワーディングを設定します

Page 49: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

ロードバランサ―の構成Azure 管理ポータルで、 [ 仮想マシン ] をクリックし、負荷分散セットの仮想マシンの名前をクリックして設定します。この場合の [ エンドポイント ] は ロードバランサ―として読み取ってください。仮想マシンに [ エンドポイントを追加 ] します

[ パブリック ポート ] と [ プライベート ポート ] に、仮想マシンが使用する ポート番号 を設定 する (例: 80 )[負荷分散セットの構成 ]

負荷分散セットの名前の設定監視(プローブ動作)の値の設定

Page 50: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

内部ロードバランサ―

インターナル ロードバランサー

ロードバランサー

143314331433

1433

443443443

80/443

Web層

DB層

VPN

35

WEB層と DB層のように二つのサーバーグループに分けて運用するケースではよく使います。ポイントそれぞれのグループを「負荷分散セット」とする仮想ネットワークのサブネットを分ける

Page 51: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

WEB サーバーを増やす

Page 52: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

オートスケール

負荷分散セット

CPU負荷や設定したスケジュールで仮想マシンを ON/OFF

Page 53: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

データベースの選択肢仮想マシンで作成 マネージド環境vs

シングル仮想マシン マルチサーバー仮想マシン( HA やマスタスレーブ)vs

カスタムメイド テンプレート利用vs

Page 54: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

仮想マシン上に、RDB を作成する

54

Page 55: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

MySQL を運用したくない場合

55

https://azure.microsoft.com/ja-jp/documentation/articles/store-php-create-mysql-database/

Page 56: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

入門の範囲を超えます

56

Page 57: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Linux Agent

57

仮想マシンと Azure の相互動作を管理します。最新の Linux エージェントは次のいずれかから直接入手できます。・ 動作保証済みの Linux ディストリビューションのプロバイダー• Github の Azure Linux エージェント用のオープン ソース リポジトリ

仮想マシン イメージのキャプチャ、ホスト名の変更、などに対応

Page 58: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

大規模なサーバーの運用

58

ポイント・ マネージド環境の積極的利用

・ 特にデータベースの選択肢を検討・ CLI

プレビュー機能の利用・ Azure Preview Portal・ Azure Resource Manager・ Azure Quick-start Templates 

Page 59: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

仮想マシンの管理モデル変更Classic (ASM) Model aka v1 Resource Manager (ARM) aka v2

Storage Account

Virtual Network

Cloud Service

Subnet-1Disk (blob)

VM w/ DIP

Address

Resource Group

VM NICVM IP

Address

Load BalancedEndpoint

w/ VIP Address

Load Balanc

er

DependsOn

Reference Reference

Backend Pool (NICs)

LB IP Addres

s

Reference

Coming Soon…Gateways

(VPN)ExpressRoute

Network Security Group ACLS(deployed to VM, NIC, or Subnet)

VNetSubnet

Storage AccountDisk (blob)

ReferenceReference

Page 60: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Azure Quickstart Templates

http://azure.microsoft.com/en-us/documentation/templates/

Page 61: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

仮想マシンと相性の良い各種サービス

61

Page 62: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Microsoft Azure が提供するサービス

62

コンピューティング

データサービス

TrafficManager

仮想ネットワーク ExpressRoute

モバイルサービスWEB サイト クラウドサービス仮想マシン

アプリケーションサービス

StorageBlobs テーブル キュー

SQL データベース MachineLeaningHD Insight 復旧サービス StoreSImple

Active Directory

BizTalk サービスService Bus

CDNAPI 管理

メディアサービス 通知ハブ

スケジューラ

Automation

CachingRemoteApp

VisualStudioOnline

ネットワーク

Files

Page 63: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Microsoft Azure が提供するサービス

63

コンピューティング

データサービス

TrafficManager

仮想ネットワーク ExpressRoute

モバイルサービスWEB サイト クラウドサービス仮想マシン

アプリケーションサービス

StorageBlobs テーブル キュー

SQL データベース MachineLeaningHD Insight 復旧サービス StoreSImple

Active Directory

BizTalk サービスService Bus

CDNAPI 管理

メディアサービス 通知ハブ

スケジューラ

Automation

CachingRemoteApp

VisualStudioOnline

ネットワーク

Files

サービスを組み合わせて開発・運用コストを削減

Page 64: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

実はいろいろあるデータベースの選択肢

Page 65: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

まとめ• Azure は 仮想マシンを使う分には、 Windowsと、 Mac 、 Linux の垣根がなくなってきている• ただし、 IaaS だけでなく各種サービス(マネージド環境)をうまく使うことで、開発や運用、監視、コストなど大きなメリットを享受できます•今後も Azure では数多くの機能追加 /改善が計画されています。Azure にますますご期待ください。

Page 66: Linux / Mac ユーザーのための Microsoft Azure 仮想マシン 入門

Microsoft Linux