免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 13989 | 回复: 25
打印 上一主题 下一主题

[原创] JumpStart 安装 Solaris10 --- 用CD images设置安装服务器及一些新功能的应用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-03 04:36 |只看该作者 |倒序浏览
[原创] JumpStart 安装 Solaris10 --- 用CD images 设置安装服务器及一些新功能的应用

原创文章,转载请注明出处。                             作者: susbin@chinaunix.net                            020207

本文主要介绍Solaris10  Custom JumpStart 安装中:
- 用下载的CD images 直接设置 installation server
- 设置RAID-1 (镜像)
- 安装10_Recommended patch cluster
- 安装第三方提供的软件包
- 修改SMF 设置及boot PROM 变量值

关于Solaris Custom JumpStart 安装的原理和步骤, 在本版及精华里有CU 前辈们撰写的多篇精彩的文章。因此本文不再叙述这些内容。如果是初次使用JumpStart,  建议先阅读本文末尾列出的五篇CU文章,这样比较容易对它的原理及基本步骤有一个概括的了解。在这些文章里还介绍了一些宝贵的经验及技巧 。

作者在此向 bear, 南非蜘蛛, race, yanghz, Philmoon 表示敬意及感谢。


操作实例

1. 阅读Sun 安装文档
Solaris 10 6/06 Installation Guide: Custom JumpStart and Advanced Installations
Part No: 819-5778-10         May 2006

2.安装前的准备工作

2.1  Server:        Sun V480, Solaris9,IP=192.168.1.48, hostname=jpserver

下载 Solaris 10 6/06  CD images (http://www.sun.com/software/solaris/get.jsp
下载10_Recommended patch cluster (http://sunsolve.sun.com
下载所需要的第三方Solaris10软件包(http://www.sunfreeware.com

这些下载的文件都放在 Jumpstart server 上,将来以NFS 共享方式提供给Client。

建立文件夹,用来存放下载的CD images,补丁,软件包,以及Jumpstart 所需的脚本等:
# mdkir –m 755 /u02/10_isos
# mkdir –m 755 /export/install; cd  /export/install
# mkdir –m 755 ./solaris.10 ./10_Recommended  ./10_pkgs
# mkdir –m 755 /jumpstart
#

把下载的文件分别放到准备好的文件夹里,核对 md5 checksum 无误后,  解压。
解压后的Solaris 10  CD images:
$ ls -l /u02/10_isos
-rw-r--r--   1 oracle     other    726138880 Jun  9  2006 sol-10-u2-ga-sparc-v1.iso
-rw-r--r--   1 oracle     other    538378240 Jun  9  2006 sol-10-u2-ga-sparc-v2.iso
-rw-r--r--   1 oracle     other    413204480 Jun  9  2006 sol-10-u2-ga-sparc-v3.iso
-rw-r--r--   1 oracle     other    667156480 Jun  9  2006 sol-10-u2-ga-sparc-v4.iso
-rw-r--r--   1 oracle     other    580321280 Jun  9  2006 sol-10-u2-ga-sparc-v5.iso
$
$ du -k -s ./10_isos
2858097 ./10_isos
$

如果要安装其他语言,比如"Simplified Chinese"(简体中文), 还需要下载:
Solaris 10 6/06 Languages CD, Multi-language         sol-10-u2-ga-sparc-lang-iso.zip

关于加载这第六个CD image 的方法,参考文章(1)里有实例 。

解压后的10_Recommended patch cluster:
$ cd  /export/install
$ ls ./10_Recommended | nl
     1  118371-07
     2  118560-02
    ……
    58  124457-01
    59  CLUSTER_README
    60  copyright
    61  install_cluster
    62  patch_order
$
$ du -k -s ./10_Recommended
470622  ./10_Recommended
$

解压后的第三方Solaris10软件包:
$ ls ./10_pkgs
gcc-3.4.6-sol10-sparc-local         openssl-0.9.8d-sol10-sparc-local
libiconv-1.11-sol10-sparc-local     rsync-2.6.9-sol10-sparc-local
lsof-4.77-sol10-sparc-local         tcp_wrappers-7.6-sol10-sparc-local
md5-6142000-sol8-sparc-local        top-3.6-sol10-sparc-local
openssh-4.4p1-sol10-sparc-local     wget-1.10.2-sol10-sparc-local
$

2.2  Client:  Sun Ultra45 workstation,IP=192.168.1.45   hostname=jpclient     内存4GB,硬盘 250GB x 3

安装前应该在 DNS服务器上注册 Client 的hostname,IP。还要把Client 连接到Jumpstart server 所在的同一网段里。如果它们不在同一网段,Jumpstart server 的设置也要做相应的改变。有关这方面的内容请参考Sun 安装文档及参考文章(5)。

这个Ultra45 是给Oracle DBA 专门做管理数据库用的management console, 上面要跑一个小的 Oracle10g , 还要跑Oracle10g Enterprise Manager 及一些 DBA 的工具。因此硬盘分区要根据Client 的用途来划分。
要求用JumpStart 设置两个镜像。
/             16384 mb          镜像          d10
swap        8192   mb        镜像        d20

2.3 关于设置RAID-1 (镜像)及metadb
从Solaris 9 4/04 (Update 6) 起,Custom Jumpstart 开始支持使用自带的 Solaris Volume Manager 来设置镜像。通过读入profile 里的设定值,Jumpstart 可以在安装中,自动设置镜像,包括根盘镜像。参考文章(6) 对此有很详细的介绍。

目前Solaris 10 JumpStart 只支持RAID-0 和RAID-1,不支持RAID-5。每个RAID-1 镜像下只能设置2个 RAID-0 submirrors。每个RAID-0 只能包含一个分区。如果把一个RAID-1镜像命名为以0结尾,JumpStart 可以自动为它的子镜像命名。例如:把存放“/” 的镜像命名为d10,  它的子镜像就会被JumpStart自动命名为d11, d12 。 现在还没法用JumpStart来直接给子镜像命名。
如果想通过JumpStart来建立更多的SVM 设备,还是要用finish脚本来做。参考文章(6) 还提供了一个不错的脚本svm.finish 。

把metadb 放在每块盘的 slice6 上。如果不设metadb 的大小,JumpStart 会给一个预设值:8192 blocks。 这个值是可以自己设置的。
metadb          c1t0d0s6
metadb          c1t1d0s6
metadb          c1t2d0s6

还要准备两个分区,待安装完成后,为d10, d20各建一个hot spare pool。目前JumpStart还没有建立和加入hot spare pool 的功能。
c1t2d0s0  16384  mb
c1t2d0s1   8192   mb

各磁盘上的其他分区在后面的profile.u45 中都可看到。

3.准备CD images

Solaris10 CD images 中第一个文件 (对应 CD1) 直接挂载后只能看到slice0,  看不到slice1。当使用命令setup_install_server 把它加载时就会返回报错信息。 因此需要先把 slice1 从该文件里切割出来。这个工作可以用脚本来完成,也可以手工来做。用脚本的做法请参见本文末尾参考文章(8)。下面介绍的是用命令一步一步来做。

3.1 先用dd 把第一个文件的VTOC 切割出来:

$ cd  /u02/10_isos
$ dd if=sol-10-u2-ga-sparc-v1.iso of=vtoc bs=512 count=1
1+0 records in
1+0 records out
$
$ ls -l vtoc
-rw-r--r--   1 root     other        512  Dec  7  11:13  vtoc
$

再用命令 od 从VTOC里找出slice 1 的起始位置,以及它的长度 。

$ od -D -j 452 -N 8 < vtoc
0000000 0000000826 0000876800
0000010
$

826 是slice 1的起始位置,它包含了876800 个数据块。Solaris 每柱面有640 blocks, 所以可算出slice 1开始的数据块位置:

$ echo 826*640 | bc
528640
$

3. 2  用dd 把 slice 1 从第一个文件里切割出来:

# dd if=sol-10-u2-ga-sparc-v1.iso of=sol-10-u2-ga-sparc-v1-s1.iso bs=512 \
skip=528640 count=876800
876800+0 records in
876800+0 records out
$
$ ls -l *-v1*
-rw-r--r--   1 root     other    448921600 Dec  7 11:48 sol-10-u2-ga-sparc-v1-s1.iso
-rw-r--r--   1 root     other    726138880 Jun  9 14:16 sol-10-u2-ga-sparc-v1.iso
$

3.3 挂载 Solaris10 CD images中第一个文件(对应 CD1)的 slice0, slice1

挂载CD image 文件,要先用命令 lofiadm 给这个文件创建一个附属的块设备(block device)。详细的解释及例子请参见参考文章 (2 )。对应CD 2 -5 的 CD images, 也要用这个办法来挂载, 但是不再需要做切割了。

# /usr/sbin/lofiadm -a /u02/10_isos/sol-10-u2-ga-sparc-v1.iso
/dev/lofi/1
# /usr/sbin/lofiadm -a /u02/10_isos/sol-10-u2-ga-sparc-v1-s1.iso
/dev/lofi/2
#
# cd /cdrom
# mkdir s0 s1
# cd /
# /sbin/mount -F hsfs -o ro /dev/lofi/1  /cdrom/s0
# /sbin/mount -F ufs -o ro /dev/lofi/2   /cdrom/s1
#
# df -k | grep cdrom
/dev/lofi/1           264134  264134       0   100%    /cdrom/s0
/dev/lofi/2           411903  391647       0   100%    /cdrom/s1
#

[ 本帖最后由 susbin 于 2007-2-5 04:07 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-02-03 04:37 |只看该作者
4.设置 installation server

4.1 加入第一个文件 (对应 CD1)

# /cdrom/s0/Solaris_10/Tools/setup_install_server  /export/install/solaris.10
Verifying target directory...
Calculating the required disk space for the Solaris_10 product
Calculating space required for the installation boot image
Copying the CD image to disk...
Copying Install Boot Image hierarchy...
Install Server setup complete
#
# umount /cdrom/s0
# umount /cdrom/s1
# /usr/sbin/lofiadm -d /u02/10_isos/sol-10-u2-ga-sparc-v1-s1.iso
# /usr/sbin/lofiadm -d /u02/10_isos/sol-10-u2-ga-sparc-v1.iso
#

4.2 加入其余文件 (对应 CD 2-5)

# cd /u02/10_isos
#
# for ISO in sol-10-u2-ga-sparc-v2.iso sol-10-u2-ga-sparc-v3.iso \
> sol-10-u2-ga-sparc-v4.iso sol-10-u2-ga-sparc-v5.iso
> do
> echo "---------------------------------------"
> echo "Adding the file $ISO ..."
> /usr/sbin/lofiadm -a /u02/10_isos/$ISO
> sleep 3
> /sbin/mount -F hsfs -o ro /dev/lofi/1 /cdrom
> sleep 3
> /cdrom/Solaris_10/Tools/add_to_install_server /export/install/solaris.10
> sleep 3
> umount /cdrom
> sleep 3
> /usr/sbin/lofiadm -d /u02/10_isos/$ISO
> sleep 3
> done
---------------------------------------
Adding the file sol-10-u2-ga-sparc-v2.iso ...
/dev/lofi/1

The following Products will be copied to /export/install/solaris.10/Solaris_10/Product:
Solaris_2

If only a subset of products is needed enter Control-C
and invoke /cdrom/Solaris_10/Tools/add_to_install_server with the -s option.

Checking required disk space...
-
Copying Top Level installer...
132688 blocks

Copying Tools Directory...
4320 blocks

Processing completed successfully.
---------------------------------------
Adding the file sol-10-u2-ga-sparc-v3.iso ...
/dev/lofi/1

The following Products will be copied to /export/install/solaris.10/Solaris_10/Product:
Solaris_3

If only a subset of products is needed enter Control-C
and invoke /cdrom/Solaris_10/Tools/add_to_install_server with the -s option.

Checking required disk space…
|
Copying Top Level installer...
132688 blocks

Copying Tools Directory...
4320 blocks

Processing completed successfully.
---------------------------------------
Adding the file sol-10-u2-ga-sparc-v4.iso ...
/dev/lofi/1

The following Products will be copied to /export/install/solaris.10/Solaris_10/Product:
Solaris_4

If only a subset of products is needed enter Control-C
and invoke /cdrom/Solaris_10/Tools/add_to_install_server with the -s option.

Checking required disk space...
\
Copying Top Level installer...
132688 blocks

Copying Tools Directory...
4320 blocks

Processing completed successfully.
---------------------------------------
Adding the file sol-10-u2-ga-sparc-v5.iso ...
/dev/lofi/1

The following Products will be copied to /export/install/solaris.10/Solaris_10/Product:
Solaris_5

If only a subset of products is needed enter Control-C
and invoke /cdrom/Solaris_10/Tools/add_to_install_server with the -s option.

Checking required disk space...
\
Copying the Early Access products...
56368 blocks

Copying Top Level installer...
132688 blocks

Copying Tools Directory...
4320 blocks

Processing completed successfully.
#

#  rm -r /cdrom/s0  /cdrom/s1
#
# du -k -s /export/install/solaris.10
2513095 /export/install/solaris.10
#

4.3 修改Jumpstart server系统文件及设置NFS 服务器

# vi /etc/inet/hosts

192.168.1.45   jpclient         jpclient.mydomain.com
(added one line)
#
# vi /etc/ethers

     0:17:4f:0f:42:b0  jpclient
(added one line)
#
# cat /etc/dfs/dfstab | grep share | grep -v "^#"
share -F nfs -o ro,anon=0 /jumpstart
share -F nfs -o ro,root=jpclient /export/install
#                             
# /etc/init.d/nfs.server stop
# /etc/init.d/nfs.server start
#

4.4 创建Jumpstart server所需的文档及脚本

Jumpstart server所需的脚本及文档样板等, 一定要从加载了Solaris10 CD images 的地方复制过来。Soalris9 的不可以用在Solairs10 上。
  
# cp –pr /export/install/solaris.10/Solaris_10/Misc/jumpstart_sample /jumpstart
# cd /jumpstart/jumpstart_sample
# cp -pr ./[a-]* ../
#

以下是建好的脚本及几个文档。
在以下的sysidcfg里,网络服务只有DNS, 没有其它的。预设的root_password 是 “ilovecu”。

$ cd  /jumpstart
$ cat sysidcfg                 
name_service=DNS {domain_name= mydomain.com
                                  name_server=192168.1.1, 192168.1.2, 192168.1.3
                                  search= mydomain.com }
network_interface=PRIMARY {hostname=jpclient                           
                                             default_route=192.168.1.10
                                              ip_address=192.168.1.45
                                              netmask=255.255.255.0
                                              protocol_ipv6=no}
root_password=Zftjq7R1BwPdE
security_policy=NONE
system_locale=en_US
terminal=sun-cmd
timeserver=localhost
timezone=Asia/Shanghai
$

$ cat rules
hostname jpclient        -       profile.u45     finish.u45
$

下面的profile.u45 里,3块盘的各个分区都可以看到。需要说明的是,这里分区的大小是以是MB来计算,但是metadb 的大小是以 blocks来计算。这里 每块盘上都设了metadb, 还设了大小(8MB)及count =5。 这只是为了在盘上给分区6留出足够的空间。因为在profile里,没法直接设置metadb所在的分区使用多少 空间。两个给hot spare pool用的分区 没有设置挂载点。每块盘上剩余的空间都划给分区 7。

$ cat profile.u45
# profile.u45
# susbin@chinaunix.net
# 122706

install_type    initial_install
system_type     standalone
partitioning    explicit

cluster         SUNWCreq        # Core, 260mb. Take about 10 min. Good for testing.
#cluster        SUNWCuser       # End user, 2.7gb. Take about 25 min.
#cluster        SUNWCprog       # Developer, 3.5gb
#cluster         SUNWCXall       # Entire+OEM, 3.8gb. Take about 35 min.

geo             Asia

filesys         mirror:d10 c1t0d0s0 c1t1d0s0 16384 / logging
filesys         mirror:d20 c1t0d0s1 c1t1d0s1 8192 swap

filesys         c1t0d0s3 16384 /arch1 logging
filesys         c1t0d0s4 16384 /arch2 logging
filesys         c1t0d0s5 16384 /arch3 logging
filesys         c1t0d0s7 free /data0 logging

filesys         c1t1d0s3 16384 /u04 logging
filesys         c1t1d0s4 16384 /u05 logging
filesys         c1t1d0s5 16384 /u06 logging
filesys         c1t1d0s7 free /data1 logging

# hot spare pool for d10 and d20
filesys         c1t2d0s0 16384
filesys         c1t2d0s1 8192

filesys         c1t2d0s3 16384 /u01 logging
filesys         c1t2d0s4 16384 /u02 logging
filesys         c1t2d0s5 16384 /u03 logging
filesys         c1t2d0s7 free /data2 logging

metadb          c1t0d0s6 size 16384 count 5
metadb          c1t1d0s6 size 16384 count 5
metadb          c1t2d0s6 size 16384 count 5

# Install Recommended patch cluster. Take about 15 min. or more.
#patch           patch_order nfs  192.168.1.48:/export/install/10_Recommended retry 5
$

现在Solairs10 Jumpstart 可以安装补丁。 下载的补丁可以放在 NFS server, HTTP server, 或local device 上的文件夹里。还要建一个文件, 里面列出所要安装的补丁的名字,比如, 118371-98。
前面  profile.u45 的最后一行, 作用就是安装补丁。这里利用了 Sun补丁包里自带的文件patch_order。如果想加一个新的补丁到Recommended patch cluster 里, 比如118371-99,要把下载的补丁118371-99放到安装服务器上的文件夹 /export/install/10_Recommended 里,还要在文件patch_order 里加上一行: 118371-99。安装补丁这个功能很好用, 已经装了4台机器, 没发生过任何问题。

Solairs10 Jumpstart 还新增了一项 “安装软件包” 的功能, 但它只能安装有这类名字的软件包:  SUNWname。  以常用软件tcp_wrappers 为例,  Jumpstart能安装软件包SUNWtcpd, 但它不能安装从www.sunfreeware.com  下载的tcp_wrappers-7.6-sol10-sparc-local。
使用命令pkgtrans 可以把一个tcp_wrappers-7.6-sol10-sparc-local 形式的包转换成SUNWtcpd 形式的包(a datastream to a file system format)。但实际使用起来,转换还是比较麻烦。因此, 在finish.u45 的最后部分, 专门写了一小段来直接安装从www.sunfreeware.com 下载的软件包。

$ cat finish.u45
#!/bin/sh
# susbin@chinaunix.net
# 122706

# Set variables
src_dir=${SI_CONFIG_DIR}/client.files
base=/a
base_etc=/a/etc
base_sc=/a/usr/local/scripts
base_cron=/a/var/spool/cron/crontabs
t_stamp=`date '+%m_%d_%y-%H:%M:%S'`

echo "Starting finish script at $t_stamp ... "
echo " "

# Create a directory for scripts on the jumpstart client
mkdir -p $base_sc
chmod 777 $base_sc

# Disable power mangement
touch ${base}/noautoshutdown
ls -l ${base}/noautoshutdown

# Avoid the NFS4 question
/usr/bin/touch ${base_etc}/.NFS4inst_state.domain
ls -l ${base_etc}/.NFS4inst_state.domain
echo " "

# Configure boot PROM
altdisk=/dev/rdsk/c1t1d0s0
alts0=`ls -l  ${base}$altdisk $altdisk | sed 's/devices/,/' | cut -d ',' -f2,3,4`
eeprom > ${base_sc}/eeprom.$t_stamp
eeprom "local-mac-address?"=true
eeprom nvramrc="devalias altdisk ${alts0}"
eeprom "use-nvramrc?"=ture
eeprom boot-device="disk altdisk disk1 net"
eeprom > ${base_sc}/eeprom.$t_stamp
echo " "
eeprom | grep local-mac-address
eeprom | grep nvramrc
eeprom | grep boot-device

# Make the altdisk bootable, even when disk0 is gone.
installboot ${base}${altdisk}/usr/platform/`uname -i`/lib/fs/ufs/bootblk $altdisk
cp –p ${base_etc}/system ${base_etc}/system.$t_stamp
echo "set md:mirrored_root_flag=1" >> ${base_etc}/system
echo " "
tail -1 ${base_etc}/system

# Configuring network and inetd service
cp ${base_etc}/inet/netmasks ${base_etc}/inet/netmasks.$t_stamp
cp ${src_dir}/netmasks ${base_etc}/inet
touch ${base_etc}/notrouter
cp ${src_dir}/hosts.[a-d]* ${base_etc}
cp ${src_dir}/site.xml ${base}/var/svc/profile
echo " "
ls -l ${base_etc}/hosts.[a-d]*
ls -l ${base}/var/svc/profile/site.xml

# Confuguring ntp
cp ${src_dir}/ntp.conf ${base_etc}/inet
if [ ! -d ${base}/var/ntp ]; then
  mkdir ${base}/var/ntp
fi
touch ${base}/var/ntp/ntp.drift
echo " "
ls -l ${base}/var/ntp/ntp.drift

# Setup crontab of root
cp -p ${base_cron}/root ${base_cron}/root.$t_stamp
cp ${src_dir}/crontab.root $base_cron/root
chown root:sys ${base_cron}/root
chmod 600 ${base_cron}/root
echo " "
ls -l ${base_cron}/root

# Copy my scripts to the jumpstart client
cp ${src_dir}/[a-z]*.*sh $base_sc
chmod 755 ${base_sc}/[a-z]*.*sh
mkdir ${base}/usr/local/bin
cp ${src_dir}/mdsave ${base}/usr/local/bin
chmod 755 ${base}/usr/local/bin/mdsave
mkdir ${base_etc}/lvm/recover

# Copy other files to the new system
cp ${src_dir}/kshrc $base_sc
cp ${src_dir}/[a-z]*.profile $base_sc
cp ${src_dir}/pkg.adm.file $base_sc
echo " "
ls -l ${base_sc}/pkg.adm.file

# Install third-party packages
jp_server=192.168.1.48
pkg_dir=/export/install/10_pkgs
adm_file=${base_sc}/pkg.adm.file
local_pkg_dir=/tmp/3rd.pkgs

mkdir $local_pkg_dir
# mount  ${jp_server}pkg_dir  $local_pkg_dir 因为有表情符号,所以换成下面一行。
mount  ${jp_server}:/export/install/10_pkgs  $local_pkg_dir

if [ $? = 0 ] ; then
  echo " "
  echo "Installing third party packages... "
  pkg_list=`ls ${local_pkg_dir}`
  for PKG in $pkg_list
  do
  pkgadd -n -a $adm_file -R $base -d ${local_pkg_dir}/$PKG all
  done

  umount $local_pkg_dir
  rm -r $local_pkg_dir
  echo " "
  echo "Third party packages installation is done. "
else
  echo "Could not mount $local_pkg_dir ."
  echo "No third party packages are installed."
fi

echo " "
echo "Ended  finish script at $t_stamp ."

exit 0
$

以上脚本里每一段都是相对独立的。如果不想做某一段, 可以把这一段删去。比如,
# Configure boot PROM 这一段, 如果不想做, 就可以删掉。有些机器只有一个网卡, 就不需要设local-mac-address, 所以也可把这一行删掉。
关于在JumpStart 安装中设置boot PROM,在Sun 的安装文档里没有找到例子。在网上搜了一下, 也没有找到有关文章。使用了几次, 到目前为止还没有发现问题.。希望用过这种方法的朋友指教。

关于 # Avoid the NFS4 question的更多内容可参见参考文章 (10)。

在脚本finish.u45里有几处需要用到事先准备好的文件,下面把它们的内容列出来:

$ cd /jumpstart/client.files
$ cat hosts.allow
ALL:    192.168.1.  .mydomain.com
$
$ cat hosts.deny
ALL:ALL
$
$ cat ntp.conf
driftfile  /var/ntp/ntp.drift
server 1.cn.pool.ntp.org
server 0.asia.pool.ntp.org
server 2.asia.pool.ntp.org
$
$ cat site.xml
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='profile' name='default'>
     <service name='network/ntp' type='service' version='0'>
          <instance name='default' enabled='true'/>
     </service>
     <service name='network/ftp' type='service' version='0'>
          <instance name='default' enabled='true'/>
     </service>
</service_bundle>

前面site.xml 文件的作用是把ntp和 ftp 服务设置为online。如果安装了Solaris10 全部内容
“cluster         SUNWCXall       # Entire+OEM, 3.8gb. Take about 35 min”,
那么Solaris10 SMF 是会把ntp, ftp和 telnet 服务预设为 disabled。用site.xml可以对SMF 管理的服务做适当的调整。有关设置SMF的讨论可参见参考文章 (9)。

$ cat pkg.adm.file
mail=
instance=unique
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
networktimeout=60
networkretries=3
authentication=nocheck
keystore=${BASE}/var/sadm/security
proxy=
basedir=default
$
上面自建的pkg.adm.file,是为在Jumpstart 中安装第三方提供的软件包准备的。安装时要让 pkgadd 去读这个文件(installation administration file),得到全部问题的答案,这样在与系统的互动问答上就不会发生问题。

5. 加入 Client  及检查Jumpstart server的设置

# cd  /jumpstart
# ./check
Validating rules...
Validating profile profile.u45...
The custom JumpStart configuration is ok.
#

# cd /export/install/solaris.10/Solaris_10/Tools
# ./add_install_client -s jpserver:/export/install/solaris.10 \
>  -c jpserver:/jumpstart -p jpserver:/jumpstart jpclient sun4u
updating /etc/bootparams
#

检查Jumpstart server设置得是否正确,还有其他方法。参考文章 (1), (5)里面有比较详细的介绍。

6.测试及正式安装

如果Jumpstart server 是新建的,一般在正式安装之前,要测试一下。因为硬件的连接和软件的设置都可能会有问题。在前面的profile.u45 里,有这样一行,用它来做测试就很合适:
cluster        SUNWCreq        # Core, 260mb. Take about 10 min. Good for testing.

因为这样只装了一个最基本的Core, 许多服务是没有的,启动时会看到一些报错信息。做测试时,profile.u45 里的最后一行也可以不让它起作用,因为安装补丁比较费时间。
#patch           patch_order nfs  192.168.1.48:/export/install/10_Recommended retry 5

另外,# Configure boot PROM 这一段如果在测试的时候做过,在正式安装时就不用再做了。

开始在 Client 上安装,要打入命令:

ok boot net – install nowin

如果遇到问题,就要根据报错内容去找出原因,然后把问题解决。本文末尾的参考文章 (5) 和 (3) 提供了排错的理论及实例。

安装结束后一定要在Client 上检查以下文件,确认安装中是否有问题出现。

$ ls –l  /var/sadm/system/logs
total 332
lrwxrwxrwx   1 root     root          20 Dec 21 16:29 begin.log -> begin.log_2006_12_21
-rw-r--r--   1 root     root          90 Dec 21 15:48 begin.log_2006_12_21
lrwxrwxrwx   1 root     root          21 Dec 21 16:29 finish.log -> finish.log_2006_12_21
-rw-r--r--   1 root     root         524 Dec 21 16:29 finish.log_2006_12_21
-rw-r--r--   1 root     root         232 Dec 21 16:34 install_launch.log_2006_12_21_1632
-rw-r--r--   1 root     root      108108 Dec 21 16:28 install_log
-rw-r--r--   1 root     root       39932 Dec 21 16:37 sysidtool.log

$

正式安装完成后,还需要在 Jumpstart server 上执行以下命令:

# /etc/init.d/nfs.server stop
#
# cd /export/install/solaris.10/Solaris_10/Tools
# ./rm_install_client jpclient
removing jpclient from bootparams
#


结束语

一个系统安装好了, 往往还要做一些安装后的设置。比如, 提高或加强系统的安全性(Hardening system),设置root用户的环境变量等。在网上看到过几个脚本, 但都不很完善。参考文章 (7) 就给出了一个例子。
Sun 也提供了一个工具  JumpStart Enterprise Toolkit   http://www.sun.com/bigadmin/content/jet/
因为从来没用过这个工具, 希望将来在本版能看到这方面的讨论。


参考文章:

A. CU
(1) Jumpstart安装实例                                                                        bear, 2002-6-13
(2) lofsadm的用法,可以用这个命令不光盘装oracle和其它软件                           南非蜘蛛 , 2002-8-2
(3) 用DVD制作9的网络安装服务器以及遇到问题的解决                                     race, 2003-11-5
(4) Solaris9的jumpstart服务器配置中文详解(从原理到实践)                             yanghz, 2004-12-3
(5) Solaris 9网络安装实例及说明                                                              Philmoon, 2006-12-28

B. Internet
(6) Automatically Mirroring the Boot Disk with Custom JumpStart               Matthew Cheek, Apr, 2004
(7) jumpstart finish script                                                                   Paveza, Gary, Apr, 2005
( 8 )  A CD-Free Installer for the Solaris OS                                           Mohd Akhbar Jamaludin, May, 2005
(9) Liane Praza's Weblog                                                                    Liane Praza, Jun, 2005
(10) override the system's default NFS version 4 domain name                  chilimonkey , Dec 2005
(11) Using Solaris JumpStart With the Solaris 10 OS for x86/x64 Platforms
                                                                               Craig Winter and Dale Layfield, March 2007

[ 本帖最后由 susbin 于 2007-6-4 11:06 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2007-02-03 10:03 |只看该作者
2007-2-3 04:36   


牛人
我是拿个时候在工作

辛苦了

有一个精华贴子出炉了!!!

论坛徽章:
0
4 [报告]
发表于 2007-02-03 11:04 |只看该作者
ding顶 好货

论坛徽章:
0
5 [报告]
发表于 2007-02-03 12:34 |只看该作者
学习!

论坛徽章:
0
6 [报告]
发表于 2007-02-03 13:19 |只看该作者
能否在写一下,通过jumpstart将os的补丁打到最新

论坛徽章:
0
7 [报告]
发表于 2007-02-03 19:11 |只看该作者
经典好文啊,不知道什么时候有机会照着做一遍!

论坛徽章:
0
8 [报告]
发表于 2007-02-03 22:38 |只看该作者
原帖由 testtest111 于 2007-2-3 13:19 发表
能否在写一下,通过jumpstart将os的补丁打到最新


Sun JumpStart 安装文档里讲了两种安装补丁的方法,可以选一种方法来做。
下面这一段里就有例子。

Patches Stored on an NFS Server
If the patch is stored on an NFS server, use one of the following syntaxes for the patch keyword.
patch patch_id_list | patch_file nfs server_name:/patch_directory [retry n]
patch patch_id_list | patch_file nfs://server_name/patch_director [retry n]

patch_id_list Specifies the patch ID numbers that are to be installed. The list should be a list of
comma-separated Solaris patch IDs. The patches are installed in the order
specified in the list.

patch_file Afile with a list of patches that is found in the patch_location. The patches are
installed in the order specified in the file.

server_name Specifies the name of the server where you stored the patches.
patch_directory Specifies the location of the patch directory on the specified server. The patches
must be in standard patch format.

retry n Is an optional keyword. n is the maximum number of times the install utility
attempts to mount the directory.

EXAMPLE 11–18 Adding a PatchWith an Ordered List by Using NFS
In this example, the patch profile keyword adds all the patches listed in the patch file from the NFS
patch directory nfs://patch_master/Solaris/v10_606/patches. Patches are installed in the order
listed in the patch. If a mount fails, the NFS mount is tried five times.

patch patch_file nfs://patch_master/Solaris/v10_606/patches retry 5

EXAMPLE 11–19 Adding a Patch by Using NFS
In this example, the patch profile keyword adds the patches 112467–01 and 112765–02 from the
patch directory /Solaris/v10_606/patches on the server patch_master.

patch 112467-01,112765-02 nfs patch_master:/Solaris/v10_606/patches

[ 本帖最后由 susbin 于 2007-2-4 04:13 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2007-02-06 08:49 |只看该作者
请版主看一下此贴,是否具备加入精华的条件。

如果不够,请指出不足之处。谢谢。


小虾偶在CU还是新手,也请各位路过大侠多提意见。小虾这厢有礼了。

论坛徽章:
0
10 [报告]
发表于 2007-02-06 10:20 |只看该作者
支持这么好的文章.绝对应该加入精华.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP