Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1504618
  • 博文数量: 3500
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 43870
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-03 20:31
文章分类

全部博文(3500)

文章存档

2008年(3500)

我的朋友

分类:

2008-05-04 22:12:06

一起学习
假设和许多其他的公司一样,您已经使用 Solaris 已经十多年的时间了,您刚刚启动了一个从 Solaris 10 到 AIX(R) 6.1 的大型服务器整合和迁移项目。虽然许多命令都非常类似,但是您需要了解如何使用分区和虚拟化。IBM(R) 和 Sun 服务器在分区方面有哪些区别呢?并且,为了从 containers 进行成功的转换,您需要了解哪些有关工作负载分区 (WPAR) 的内容呢?WPAR 和 zones 之间的相似之处和区别之处分别是什么,以及创建 zones 和 WPAR 的过程有哪些不同?最后,您可以在 IBM System p(TM) 中进行哪些使用 Sun 服务器无法完成的操作呢?这些都是本文中所要解决的问题,其目的是使得您的转换工作更加容易。
zonecfg:testzone> export create -b set zonepath=/home/zones/myzone set autoboot=false set ip-type=shared add inherit-pkg-dir set dir=/lib end add inherit-pkg-dir set dir=/platform end add inherit-pkg-dir set dir=/sbin end add inherit-pkg-dir set dir=/usr end add net set address=192.168.0.22 set physical=e1000g0 end

对于上述的内容,您将更改一些变量的配置,设置您的安装区域路径和配置文件(请参见清单 2)。


清单 2. 更改一些变量的配置
zonecfg:testzone>

zonecfg:testzone> set zonepath=/zones/testzone

zonecfg:testzone> commit

zonecfg:testzone> export -f /testzone.cfg

现在,您已经做好进行安装的准备(请参见清单 3)。


清单 3. 安装
root[ksh]@ezqspc18# zoneadm -z testzone install

WARNING: skipping network interface 'e1000g0' which may not be present/plumbed \

    in the global zone.

Preparing to install zone .

Creating list of files to copy from the global zone.

Copying <7231> files to the zone.

Initializing zone product registry.

Determining zone package initialization order.

Preparing to initialize <1580> packages on the zone.

Initializing package <367> of <1580>: percent complete: 23%

在大约 17 分钟后,将完成此次安装(请参见清单 4)。


清单 4. 安装完成
Initialized <1580> packages on zone.

Zone  is initialized.

The file  contains a log \

    of the zone installation.

root[ksh]@ezqspc18#

接下来,您需要启动这个区域(请参见清单 5)。


清单 5. 启动区域
root[ksh]@ezqspc18# zoneadm -z testzone boot

WARNING: skipping network interface 'e1000g0' which may not be present/plumbed \

    in the global zone.

root[ksh]@ezqspc18#

此时,您可以使用zlogin从全局环境进行登录:

zlogin -C testzone

在登录之后,您将看到连接的屏幕,但除此之外没有任何其他内容:

Connected to zone 'testzone' console]

在大约五分钟之后,您将接收到下一条消息。您将不会立即得到一个登录提示,但也不要惊慌。在第一次进行这项操作时,您需要对环境进行进一步的配置,这需要输入您的终端类型、加上主机名和网络信息(请参见清单 6)。


清单 6. 进一步配置您的环境
Select a Language



  0. English



Please make a choice (0 - 0), or press h or ? for help: 0

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: 3

Creating new rsa public/private host key pair

Creating new dsa public/private host key pair

Configuring network interface addresses:.

? Host Name ????????????????????????????????????????????????????



  Enter the host name which identifies this system on the network.  The name

  must be unique within your domain; creating a duplicate host name will cause

  problems on the network after you install Solaris.



  A host name must have at least one character; it can contain letters,

  digits, and minus signs (-).



    Host name



System identification is completed.

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



[NOTICE: Zone rebooting]



System identification is completed.



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



[NOTICE: Zone rebooting]

SunOS Release 5.10 Version Generic_120011-14 64-bit

Copyright 1983-2007 Sun Microsystems, Inc.  All rights reserved.

Use is subject to license terms.

Hostname: testzone



testzone console login: Jan 13 15:57:10 testzone sendmail[25411]: 

My unqualified host name (localhost) unknown; sleeping for retry

此时,您应该可以验证该 zone 已经启动(请参见清单 7)。


清单 7. 验证区域已经启动
#hostname

Testzone

您可以进一步查看全局环境的 zone 划分信息(请参见清单 8)。


清单 8. 全局环境的区域划分信息
root[ksh]@ezqspc18# zoneadm list -v

  ID NAME             STATUS     PATH                           BRAND    IP

   0 global           running    /                              native   shared

   1 testzone         running    /zones/testzone                native   shared

root[ksh]@ezqspc18#

df命令(使用-Z标志)显示了文件系统输出,包括 zone (请参见清单 9)。


清单 9. 带-Z标志的df命令
root[ksh]@ezqspc18# df -kZ

Filesystem            kbytes    used   avail capacity  Mounted on

/dev/dsk/c0t0d0s0    60502476 11620301 48277151    20%    /

/devices                   0       0       0     0%    /devices

ctfs                       0       0       0     0%    /system/contract

proc                       0       0       0     0%    /proc

mnttab                     0       0       0     0%    /etc/mnttab

swap                 16904432    1376 16903056     1%    /etc/svc/volatile

objfs                      0       0       0     0%    /system/object

fd                         0       0       0     0%    /dev/fd

swap                 16903568     512 16903056     1%    /tmp

swap                 16903104      48 16903056     1%    /var/run

/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1

        60502476 11620301 48277151    20%    /platform/sun4u-us3/lib/libc_psr.so.1

/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1

     60502476 11620301 48277151    20%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1

/zones/testzone/dev  60502476 11620301 48277151    20%    /zones/testzone/root/dev

/lib                 60502476 11620301 48277151    20%    /zones/testzone/root/lib

/platform            60502476 11620301 48277151    20%    /zones/testzone/root/platform

/sbin                60502476 11620301 48277151    20%    /zones/testzone/root/sbin

/usr                 60502476 11620301 48277151    20%    /zones/testzone/root/usr

proc                       0       0       0     0%    /zones/testzone/root/proc

ctfs                       0       0       0     0%  /zones/testzone/root/system/contract

mnttab                     0       0       0     0%    /zones/testzone/root/etc/mnttab

objfs                      0       0       0     0%    /zones/testzone/root/system/object

swap            16903248     192 16903056     1%    /zones/testzone/root/etc/svc/volatile

/zones/testzone/root/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1

                     60502476 11620301 48277151    20% \

       /zones/testzone/root/platform/sun4u-us3/lib/libc_psr.so.1

/zones/testzone/root/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1

                     60502476 11620301 48277151    20% \

       /zones/testzone/root/platform/sun4u-us3/lib/sparcv9/libc_psr.so.1

fd                         0       0       0     0%    /zones/testzone/root/dev/fd

swap                 16903056       0 16903056     0%    /zones/testzone/root/tmp

swap                                        
            
            
阅读(183) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~