zone简单配置过程
Zone的类型
Global Zone
Solaris系统本身就是Global Zone。
# zoneadm list -v
ID NAME STATUS PATH
0 global running /
Non-Global Zone
在Solaris系统上创建的Zone就是Non-Global Zone。
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.
Copyingfiles to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initializepackages on the zone.
大约等待二十分钟左右
Initializedpackages 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中的系统
启动zone
zoneadm -z zone boot
登陆zone console进行配置,配置跟solaris安装时一样,需要配置地区、时区、主机名、root密码等。
# zlogin -C zone
关闭zone
zoneadm -z zone halt
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/79022/showart_1859269.html
页:
[1]