2007年7月1日日曜日

[Solaris10] Zoneの作成 その1

Solaris10上にZoneを作成方法
以下の環境でzoneを作成してみる。手順はWeb用Zoneだけ記載する。
Zone作成完了した段階で、ネットワーク接続ができるようになる。

 環境:
  Solaris10 11/06
 作成ゾーン:
  Web用Zone:
    ゾーン名:wpico01az
    パス  :/opt/zone/wpico01az
  DB用Zone :
    ゾーン名:dpico01az
    パス  :/opt/zone/dpico01az

0.準備
 Solaris10 11/06 インストール後には追加パッケージは必要ない。

1.Globalゾーン上にローカルゾーンのディレクトリを作成

 [global]# mkdir /opt/zone
 [global]# mkdir /opt/zone/wpico01az
 [global]# mkdir /opt/zone/dpico01az
 [global]# chmod 700 /opt/zone/wpico01az /opt/zone/dpico01az


2.GlobalゾーンでZoneの設定

 [global]# zonecfg -z wpico01az
 wpico01az: No such zone configured
 Use 'create' to begin configuring a new zone.
 zonecfg:wpico01az> create
 
 ====インストール先の設定
 zonecfg:wpico01az> set zonepath=/opt/zone/wpico01az
 ====自動起動設定(globalゾーン起動時に自動でローカルゾーンを起動する)
 zonecfg:wpico01az> set autoboot=true
 zonecfg:wpico01az> set pool=pool_default
 ====ネットワークの設定
 zonecfg:wpico01az> add net
 zonecfg:wpico01az:net> set physical=iprb0
 zonecfg:wpico01az:net> set address=192.168.10.110
 zonecfg:wpico01az:net> end
 ====CPUリソースの割り当て
 zonecfg:wpico01az> add rctl
 zonecfg:wpico01az:rctl> set name=zone.cpu-shares
 zonecfg:wpico01az:rctl> add value (priv=privileged,limit=25,action=none)
 zonecfg:wpico01az:rctl> end
 ====設定情報の確認
 zonecfg:wpico01az> info
 zonename: wpico01az
 zonepath: /opt/zone/wpico01az
 autoboot: true
 pool: pool_default
 limitpriv:
 inherit-pkg-dir:
  dir: /lib
 inherit-pkg-dir:
  dir: /platform
 inherit-pkg-dir:
  dir: /sbin
 inherit-pkg-dir:
  dir: /usr
 net:
  address: 192.168.10.110
  physical: iprb0
 rctl:
  name: zone.cpu-shares
  value: (priv=privileged,limit=25,action=none)
 zonecfg:wpico01az>
 zonecfg:wpico01az> verify
 zonecfg:wpico01az> commit
 zonecfg:wpico01az> exit
 
 ====状態の確認
 [global]# zoneadm list -cv
  ID NAME STATUS PATH
  0 global running /
  - wpico01az configured /opt/zone/wpico01az

→wpico01az の設定が完了

3.ローカルゾーンのインストール

 [global]# zoneadm -z wpico01az install
 Preparing to install zone .
 Creating list of files to copy from the global zone.
 Copying <2438> files to the zone.
 Initializing zone product registry.
 Determining zone package initialization order.
 Preparing to initialize <1003> packages on the zone.
 Initialized <1003> packages on zone.
 Zone is initialized.
 The file
contains a log of the zone installation.

 [global]# zoneadm list -cv
  ID NAME STATUS PATH
  0 global running /
  - wpico01az installed /opt/zone/wpico01az

→ゾーンwpico01az のインストール完了

4.ローカルゾーンの起動
 初回起動するときには、固有情報の設定を行う。

 [global]# zoneadm -z wpico01az boot
 [global]# zlogin -C wpico01az

→ローカルゾーン wpico01az のコンソールに接続する


 Select a Language
 
  0. English
  1. Japanese
 
 Please make a choice (0 - 1), or press h or ? for help: 1
 
 Select a Locale
 
  0. Japanese EUC (ja)
  1. Japanese EUC (ja_JP.eucJP)
  2. Japanese PC Kanji (ja_JP.PCK)
  3. Japanese UTF-8 (ja_JP.UTF-8)
  4. Go Back to Previous Screen
 
 Please make a choice (0 - 4), or press h or ? for help: 0-3
 
 
 What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52
 3) DEC VT100
 4) Heathkit 19
 5) Lear Siegler ADM31
 6) PC Console
 7) Sun Command Tool
 8) Sun Workstation
 9) Televideo 910
 10) Televideo 925
 11) Wyse Model 50
 12) X Terminal Emulator (xterms)
 13) CDE Terminal Emulator (dtterm)
 14) Other
 Type the number of your choice and press Return: 13
 
 ・Host Name for iprb0:1
  wpico01az
 
 ・Configure Security Policy:
  No

 ・Name Service
  None
 
 ・Time Zone
  Asia ー Japan
 
 System identification is completed.
 
 
  This system is configured with NFS version 4, which uses a domain
  name that is automatically derived from the system's name services.
  The derived domain name is sufficient for most configurations. In a
  few cases, mounts that cross different domains might cause files to
  be owned by "nobody" due to the lack of a common domain name.
 
  Do you need to override the system's default NFS version 4 domain
  name (yes/no) ? [no] :
 
  For more information about how the NFS version 4 default domain
  name is derived and its impact, refer to the man pages for nfs(4)
  and nfsmapid(1m), and the System Administration Guide: Network
  Services.

 rebooting system due to change(s) in /etc/default/init
 

 SunOS Release 5.10 Version Generic_118855-33 32-bit
 Copyright 1983-2006 Sun Microsystems, Inc. All rights reserved.
 Use is subject to license terms.
 Hostname: wpico01az
 

 wpico01az console login:


→Zone完成!!!

0 件のコメント: