Zone的创建
创建Zone存放的目录,该目录的权限必须为700
mkdir /export/zone
chmod 700 /export/zone
mkdir /opt/sfw
使用zonecfg命令配置Zone
bash-2.05b# zonecfg -z zone
zone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone> create
zonecfg:zone> set zonepath = /export/zone
zonecfg:zone> set autoboot = true
zonecfg:zone> add inherit-pkg-dir
zonecfg:zone:inherit-pkg-dir> set dir=/opt/sfw
zonecfg:zone:inherit-pkg-dir> end
zonecfg:zone> add net
zonecfg:zone:net> set physical = elxl0
zonecfg:zone:net> set address = 173.21.73.121
zonecfg:zone:net> end
zonecfg:zone> info
zonepath: /export/zone
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
inherit-pkg-dir:
dir: /opt/sfw
net:
address: 173.21.73.121
physical: elxl0
zonecfg:zone> verify
zonecfg:zone> commit
zonecfg:zone> exit
inherit-pkg-dir 表示zone共享Global Zone的软件包,默认共享四个目录:/lib /platform /sbin /usr,zone对这四个目录的权限是read only。
安装配置完成的zone
bash-2.05b# zoneadm -z zone install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2436> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <888> packages on the zone.
大约等待二十分钟左右
Initialized <888> packages on zone.
Zone is initialized.
Installation of these packages generated warnings:
The file contains a log of the zone installation.
bash-2.05b# zoneadm list -vc
ID NAME STATUS PATH
0 global running /
- zone installed /export/zone
Zone已经安装完成。
启动zone
zoneadm -z zone boot
登陆zone console进行配置,配置跟solaris安装时一样,需要配置地区、时区、主机名、root密码等。
# zlogin -C zone
关闭zone
zoneadm -z zone halt
转载自:http://huasheng.itpub.net/post/1210/11437
更多信息:
阅读(2163) | 评论(0) | 转发(0) |