Oracle Solaris 11 -...

50
1 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

description

ソフトウェア・ライフサイクルを管理する新たなパッケージングシステム Image Packaging System (IPS)

Transcript of Oracle Solaris 11 -...

1 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

2 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

ソフトウェア・ライフサイクルを管理する新たなパッケージングシステム

Image Packaging System (IPS)

日本オラクル株式会社 システム事業統括 ソリューション統括本部 パートナーソリューション本部

シニア・セールス・コンサルタント 黒田 俊介

2011 年 12 月 12 日

3 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Disclaimer

以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。

OracleとJavaは、Oracle Corporation 及びその子会社、関連会社の米国及びその他の国における登録商標です。

文中の社名、商品名等は各社の商標または登録商標である場合があります。

4 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Agenda

• Solaris 11 におけるライフサイクル管理

• Image Packaging System (IPS)

背景/特徴

IPS リポジトリ

IPS パッケージ

• パッケージ管理

• パッケージ作成

• Appendix

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

Solaris 11 におけるライフサイクル管理

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

ソフトウェア・ライフサイクル管理における課題 アップデート効率の向上

新しい

セキュリティ

パッチ

6:00 pkg update

6:00-6:02 : 依存関係調査、更新の

計画作成

6:02-6:04 : 新たなブート環境を作成、更新

内容をダウンロードして、更新を行う 6:04-6:06 : リブートをし、再び運用再開

保守可能時間 6-7pm

• 典型的な場合で更新が4倍高速

• ZFSでブート環境を作成し、安全に(既存環境に影響を与えず)に更新を実行

• パッケージの依存関係を完全に調査し、整合性を確認、監査可能

• 更新されたZFSブート環境を使ってリブート

7 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

システム管理をよりシンプルに

Active

BE

Active BE

New BE Old BE

Updated BE

AI Server

DHCP

Server

Net config

AI address

Automated Installer による迅速なデプロイ

Zone による迅速な開発、テスト

BE および IPS による迅速なアップデート

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

実装された数々の新機能

Packaging System Image Packaging System (IPS),

IPS Repository, IPS Package

Upgrade Boot Environment

Install Live DVD, Text Install, AI Install

9 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Image Packaging System

10 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Image Packaging System 背景

パッケージ/パッチ間の依存関係の複雑性 完全な自動化には依存関係を解決するユーティリティが必要

シングルユーザでの適用 適用可能な時期 (定期メンテナンス時など) が限定

手動によるパッチ適用 Update Manager である程度の自動化は可能であるが不十分

ダウンタイム最小化、迅速なデプロイがキー・ファクター

11 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Image Packaging System 特徴

ダウンタイムの最小化

Availability

コマンド/管理ツールの刷新

Simplicity

ネットワーク経由のソフトウェア配布

Flexibility

パッケージ依存関係の自動解決

Manageability

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

Image Packaging System

• メディア容量の制約

Solaris 10 5/08

• パッケージ・アーカイブを bzip2 から 7-zip へ変更

Solaris 10 9/10

• DVD のみでの配布

ネットワーク経由のソフトウェア配布

ネットワーク経由の配布により

メディア容量の呪縛から解放

リポジトリ

クライアント

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

Image Packaging System パッケージ依存関係の自動解決

# pkg install A

C, B, A

C, B, A

# pkgadd -d . B

# pkgadd -d . A

DVD/NFS

Solaris 11

Solaris 10

依存関係を意識したインストール

Solaris 11

依存関係の自動解決

# pkgadd -d . C

リポジトリ

Solaris 11

B C

A Solaris 10

Solaris 10

14 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Image Packaging System

• Boot Environment (BE) を利用したオンラインアップデート

• ZFS によるアップデートの簡素化

• 容易なロールバック

ダウンタイムの最小化

snapshot

clone

promote

BE : solaris

BE : solaris-1

IPS リポジトリ

Solaris 11

Solaris 11

# pkg update

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

Image Packaging System ダウンタイムの最小化

/ (root) / (root) / (root)

swap swap swap

未使用

未使用 未使用 未使用

/ の複写 更新

その他

データ

その他

データ

その他

データ

現在の

ブート環境 現在の

ブート環境

現在の

ブート環境

Disk 1 Disk 1 Disk 1

Disk 2 Disk 2 Disk 2

数十分後

数秒後

現在の

ブート環境

新しい

ブート環境

新しい

ブート環境

新しく更新された

ブート環境

空パーティ

ション

現在のブート環境

現在のブート環境

新しく更新された

ブート環境

更新

zpool zpool zpool

So

lari

s 1

0

So

lari

s 1

1

大幅な時間短縮が可能に

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

Solaris 11 Solaris 10

Image Packaging System コマンド/管理ツールの刷新

パッケージ管理者

Solaris 11

Solaris 11

システム管理者

pkg(1)

pkgrecv(1)

pkgrepo(1)

pkgsend(1)

pkgsign(1)

pkgadm(1M)

pkgask(1M)

pkgcond(1)

pkgmk(1)

pkgproto(1)

pkgtrans(1)

pkgadd(1M)

pkgchk(1M)

pkginfo(1)

pkgparam(1)

pkgrm(1M)

pkgdepend(1)

pkgdiff(1)

pkgfmt(1)

pkglint(1)

pkgmerge(1)

pkgmogrify(1)

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

Image Packaging System

• パッケージ・マネージャ

コマンド/管理ツールの刷新

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

IPS リポジトリ

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

IPS リポジトリ

• リポジトリ

パッケージを公開する場所

Universal Resource Identifier (URI)

で表記

• 発行元 (publisher)

パッケージを公開する団体を表す

識別子

発行元はリポジトリと紐付く

リポジトリと発行元

リポジトリ

http://pkg.oracle.com/solaris/release/

発行元 : solaris

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

IPS リポジトリ

• カタログ

管理されるパッケージ一覧

• パッケージ

マニフェスト

コンテンツ

構成要素

カタログ

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

IPS リポジトリ

• リリース・リポジトリ http://pkg.oracle.com/solaris/release/

• サポート・リポジトリ https://pkg.oracle.com/solaris/support/

オフィシャル・リポジトリ

22 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS リポジトリ 複製

リポジトリ

Solaris 11

M M M M C

s x s x s

x x x x s

Solaris 11

Solaris 11

Solaris 11

M M M M C

s x s x s

x x x x s

ローカル

リポジトリ

クライアント

リポジトリの複製

23 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS リポジトリ

• 動作要件

Solaris 11 が動作する SPARC/x86 システム

15 GB のディスク容量

• リポジトリ・ソース

http://pkg.oracle.com/solaris/release/

• pkgrecv(1) にてリポジトリから直接パッケージをダウンロード

http://www.oracle.com/technetwork/server-storage/solaris11/downloads/

• sol-11-1111-repo-full-iso-a.zip

• sol-11-1111-repo-full-iso-b.zip

リリース・リポジトリの複製

24 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS リポジトリ リリース・リポジトリの複製

Terminal

# unzip sol-11-1111-repo-full-iso-a.zip

# unzip sol-11-1111-repo-full-iso-b.zip

# cat sol-11-1111-repo-full.iso-a sol-11-1111-repo-full.iso-b ¥

> sol-11-1111-repo-full.iso

# lofiadm –a /var/tmp/sol-11-1111-repo-full.iso

# mount –F hsfs /dev/lofi/1 /mnt

# cd /mnt/repo ; tar cf - . | (cd /ips ; tar xfp -)

# umount /mnt

# lofiadm –d /dev/lofi/1

# pkgrepo –s /ips refresh

Terminal

# pkgrepo create /ips

# pkgrecv –s http://pkg.oracle.com/solaris/release/ -d /ips ‘*’

# pkgrepo –s /ips refresh

25 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS リポジトリ ミラー

起点 (Origin)

ミラー

Solaris 11

Solaris 11

Solaris 11

s x s x s

x x x x s

M M M M C

s x s x s

x x x x s

クライアント

起点へパッケージ情報

を問い合わせ

ミラーからコンテンツを

インストール

26 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS リポジトリ ミラーの作成

ミラー

Solaris 11

Terminal

ips-mirror# pkgrepo create /pkg

ips-mirror# pkgrepo –s /pkg set publisher/prefix=example

ips-mirror# pkgrepo –s /pkg –p example ¥

set repository/origins=http://ips

ips-mirror# svccfg –s pkg/server setprop pkg/inst_root=/pkg

ips-mirror# svccfg –s pkg/server setprop pkg/mirror=true

ips-mirror# svcadm refresh pkg/server

ips-mirror# svcadm enable pkg/server

27 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS パッケージ

28 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS パッケージ

• Fault Management Resource Identifier (FMRI) で表記

pkg://{publisher}/{category}/{package name}@{version}

FMRI

pkg://solaris/developer/[email protected],5.11-0.175.0.0.0.2.537:20111019T095059Z

29 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS パッケージ

• マニフェスト

パッケージ情報 (メタデータ、依存関係、コンテンツ情報) を記述したファイル

• コンテンツ

パッケージを構成するファイル群

構成要素

メタデータ

依存関係

コンテンツ情報

30 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS パッケージ

• 異なるターゲットのパッケージを一つに集約

• クライアントは必要なファイルのみをインストール

“fat” パッケージ

Solaris 11

Solaris 11

Solaris 11

SPARC

i386

s s s

s s x

クライアントは必要なコン

テンツのみインストール

# pkg install A

# pkg install A

リポジトリ

M M M M C

s x s x s

x x x x s

31 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

IPS パッケージ

• 単体でインストール可能な standalone 形式 (p5p)

パッケージ

“standalone” パッケージ

Terminal

# pkgrecv –s http://pkg.oracle.com/solaris/release/ ¥

–d /var/tmp/abc.p5p –a abc

Solaris 11 リポジトリ

M M M M C

s x s x s

x x x x s

Solaris 11

M s x

x s

クライアント

abc.p5p

パッケージをファイル形式で保存

32 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ管理

33 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ管理

• リポジトリの登録

• リポジトリの削除

リポジトリの登録/削除

Terminal

# pkg unset-publisher solaris

Terminal

# pkg set-publisher –g http://ips –G ‘*’ solaris

34 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ管理

• ミラーの登録

• ミラーの削除

ミラーの追加/削除

Terminal

# pkg set-publisher –M http://ips-mirror solaris

Terminal

# pkg set-publisher –m http://ips-mirror solaris

35 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ管理

• パッケージのインストール

• パッケージのアンインストール

インストール/アンインストール

Terminal

# pkg uninstall gcc-45

Terminal

# pkg install gcc-45

36 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ管理

• パッケージの検査

• パッケージの修復

検査/修復

Terminal

# pkg fix gcc-45

Terminal

# pkg verify gcc-45

37 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ管理

• パッケージの検索

• パッケージ情報の表示

• パッケージコンテンツの表示

その他

Terminal

# pkg search -r /usr/bin/gcc

Terminal

# pkg info gcc-45

Terminal

# pkg contents gcc-45

38 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成

39 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成

1. リポジトリの準備

2.コンパイル~インストール

3.マニフェストファイルの作成

i. コンテンツの追加

ii. メタデータの追加

iii. パッケージ依存関係の追加

iv. マニフェストファイルの確認

4.パッケージの登録

手順

40 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

リポジトリの準備

パッケージ作成

開発機

Solaris 11

Solaris 11

リポジトリ

C

Terminal

ips# pkgrepo create /pkg

ips# pkgrepo –s /pkg set publisher/prefix=example

ips# pkgrepo –s /pkg refresh

ips# svccfg –s pkg/server setprop pkg/inst_root=/pkg

ips# svccfg –s pkg/server setprop pkg/port=8000

ips# svccfg –s pkg/server setprop pkg/readonly=false

ips# svcadm refresh pkg/server

ips# svcadm enable pkg/server

41 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成 コンパイル~インストール

開発機

Solaris 11

Solaris 11

x

x

リポジトリ

x

x

C

Terminal

# gtar xzf a52dec-0.7.4.tar.gz

# cd a52dec-0.7.4

# ./configure

# gmake

# gmake install DESTDIR=/var/tmp/ws

42 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成

i. コンテンツ情報の追加

サポートされるソース形式

• ファイルシステム形式の SVR4 パッケージ

• データストリーム形式の SVR4 パッケージ

• tar ファイル

• ディレクトリ

マニフェストファイルの作成

開発機

Solaris 11

Solaris 11

x

x

リポジトリ

x

x

C

M

Terminal

# pkgsend generate /var/tmp/ws > /var/tmp/a52dec.p5m.1

43 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成

ii.メタデータの追加

マニフェストファイルの作成

Terminal

# cat /var/tmp/a52dec.mog

set name=pkg.fmri [email protected],5.11-0.175.0.0.0.2.0

set name=pkg.summary value=“Package summary”

set name=pkg.description value=“Package description”

set name=variant.arch value=$(ARCH)

set name=info.classification value=“org.opensolaris.category.2008:System/Multimedia Libraries”

Terminal

# pkgmogrify -DARCH=`uname –p` /var/tmp/a52dec.p5m.1 /var/tmp/a52dec.mog > /var/tmp/a52dec.p5m.2

44 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成

iii.パッケージ依存関係の追加

iv.マニフェストファイルの確認

マニフェストファイルの作成

Terminal

# pkgdepend generate –md /var/tmp/ws /var/tmp/a52dec.p5m.2 > /var/tmp/a52dec.p5m.3

# pkgdepend resolve –m /var/tmp/a52dec.p5m.3

Terminal

# pkglint /var/tmp/a52dec.p5m.3.res

45 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成 パッケージの登録

開発機

Solaris 11

Solaris 11

x

x

リポジトリ

x

x

C

M

Terminal

# pkgsend –s http://ips publish –d /var/tmp/ws /var/tmp/a52dec.p5m.3.res

x

x

x

x

M

46 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

パッケージ作成

• 目的に応じたリポジトリを用意

• 複数のリポジトリからパッケージを

pkgmerge(1) コマンドで統合

“fat” パッケージ

I386 IPS

x

x

x

x

C

M

SPARC IPS

s

s

s

s

C

M

Terminal

# pkgmerge –d http://ips-fat –s variant=i386,http://ips-i386 –s variant=sparc,http://ips-sparc a52dec

開発機

47 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

Appendix

48 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

参考 URL

• Oracle Solaris 11 Downloads http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html

• Oracle Solaris 11 Information Library http://download.oracle.com/docs/cd/E23824_01/

• Adding and Updating Oracle Solaris 11 Software Packages http://download.oracle.com/docs/cd/E23824_01/pdf/E21802.pdf

• Copying and Creating Oracle Solaris 11 Package Repositories http://download.oracle.com/docs/cd/E23824_01/pdf/E21803.pdf

• Image Packaging System Man Pages http://download.oracle.com/docs/cd/E23824_01/pdf/E21796.pdf

49 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.

50 | Copyright © 2011 Oracle and/or its affiliates. All rights reserved.