安装环境
SystemImager服务器:CentOS release5.5 (Final) x86_64“Image-Server”
SystemImager客户端:CentOS release5.4 (Final) x86_64 ”Image-Client“
Perl模块下载地址为:
http://search.cpan.org/~abw/AppConfig-1.66/
http://search.cpan.org/~chorny/MLDBM-2.04/
http://search.cpan.org/~grantm/XML-Simple-2.18/
下载的模块安装包为
AppConfig-1.66.tar.gz
MLDBM-2.04.tar.gz
XML-Simple-2.18.tar.gz
将上述软件包下载到本机后用SecureCRT_CN上传到SystemImager服务器端
chmod+x AppConfig-1.66.tar.gz
# tarzxf AppConfig-1.66.tar.gz
# cdAppConfig-1.66
#perl Makefile.PL
#make && make install
chmod+x MLDBM-2.04.tar.gz
# tarzxf MLDBM-2.04.tar.gz
# cdMLDBM-2.04
#perl Makefile.PL
#make && make install
chmod+x XML-Simple-2.18.tar.gz
# tarzxf XML-Simple-2.18.tar.gz
# cdXML-Simple
#perl Makefile.PL
#make && make install
mkdir–p /home/systemimager
cd /home/systemimager
下载脚本install
wgethttp://download.systemimager.org/pub/sis-install/install
chmod+x install
./install-v --download-only systemconfiguratorsystemimager-common systemimager-x86_64boot-standard systemimager-x86_64initrd_template systemimager-server
#以上命令是x86_64操作系统下载的软件包
systemconfigurator-2.2.11-1.noarch.rpm
systemimager-common-4.0.2-1.noarch.rpm
systemimager-x86_64boot-standard-4.0.2-1.noarch.rpm
systemimager-x86_64initrd_template-4.0.2-1.noarch.rpm
systemimager-server-4.0.2-1.noarch.rpm
#如果是32位的OS则运行如下命令去下载软件包
./install-v --download-only systemconfigurator systemimager-common systemimager-i386boot-standardsystemimager-i386initrd_template systemimager-server
#下载的软件包为
systemimager-common-4.0.2-1.noarch.rpm
systemimager-server-4.0.2-1.noarch.rpm
systemimager-i386boot-standard-4.0.2-1.noarch.rpm
systemimager-i386initrd_template-4.0.2-1.noarch.rpm
如果不用install脚本下载软件包也可以使用下列链接
wget http://sourceforge.net/projects/systemconfig/files/systemconfigurator/2.2.11/systemconfigurator-2.2.11-1.noarch.rpm/
wgethttp://sourceforge.net/projects/systemimager/files/systemimager/4.0.2/systemimager-common-4.0.2-1.noarch.rpm
wgethttp://sourceforge.net/projects/systemimager/files/systemimager/4.0.2/systemimager-server-4.0.2-1.noarch.rpm
wget http://sourceforge.net/projects/systemimager/files/systemimager/4.0.2/systemimager-x86_64boot-standard-4.0.2-1.noarch.rpm/download
wgethttp://sourceforge.net/projects/systemimager/files/systemimager/4.0.2/systemimager-i386boot-standard-4.0.2-1.noarch.rpm
安装软件包
rpm -ivh --nodeps *.rpm
安装完以后的默认路径
/usr/lib/systemimager
/usr/sbin/si_cpimage
/usr/sbin/si_rmimage
/usr/sbin/si_mvimage
/usr/sbin/si_getimage
/usr/libexec/gthumb-image-viewer
/usr/bin/si_lsimage
/usr/bin/pdfimages
/var/lib/systemimager
/var/lib/systemimager/images
/var/lock/systemimager
/var/log/systemimager
/etc/systemimager
/etc/systemimager/systemimager.conf
/etc/systemimager/getimage.exclude
重启xinetd
servicexinetd stop
servicexinetd start
或者
servicexinetd restart
mkdir –p /home/systemimager
cd /home/systemimager
下载install脚本
wget http://download.systemimager.org/pub/sis-install/install
chmod +x install
下载安装包到
./install -vsystemimager-client systemimager-commonsystemimager-x86_64initrd_template
安装软件包
cd /home/systemimager/
rpm-ivh --nodeps *.rpm
安装完以后的目录为
/etc/systemimager/updateclient.local.exclude
/etc/systemimager/client.conf
/etc/systemimager/updateclient.local.exclude.orig
/usr/sbin/si_prepareclient
/usr/sbin/si_updateclient
在client端启动rsync
运行以下命令只需要输入两次”y”即可
/usr/sbin/si_prepareclient –server “Image-Server”
查看rsync是否启动
ps aux |grep rsync
netstat –anpt |grep rsync
现在我们已经准备好复制黄金客户端磁盘上的内容到SystemImager服务器,镜像将被存储在SystemImager服务器上的/var/lib/SystemImager目录,通过下面的命令检查并确认你在这个目录下有足够的磁盘空间:
#df -h /var/lib/systemimager
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00 93G3.1G 86G 4% /
如果没有足够的空间容纳黄金客户端磁盘内容的拷贝,在你使用getimage命令时加上-directory选项,或这在/etc/SystemImager/SystemImager.conf 文件中修改镜像文件默认的存储位置“DEFAULT_IMAGE_DIR =/var/lib/systemimager/images”
看一下是否安装DHCP,如果没有的话需要安装
# rpm -qa |grep dhcp
# /usr/sbin/si_getimage-golden-client “Image-Client” image Zoho-CentOS5.4-Image
Thisprogram will get the " Zoho-CentOS5.4-Image " system imagefrom “Image-Client”
makingthe assumption that all filesystems considered part
ofthe system image are using ext2, ext3, jfs, FAT, reiserfs, or xfs.
Thisprogram will not get /proc, NFS, or other filesystems
notmentioned above.
***********************************WARNING ***********************************
Allfiles retrieved from a golden client are, by default, made accessible to
anyonewho can connect to the rsync port of this machine. See rsyncd.conf(5)
fordetails on restricting access to these files on the imageserver. See the
systemimager-sshpackage for a more secure (but less effecient) method of
makingimages available to clients.
***********************************WARNING ***********************************
See"getimage -help" for command line options.
Continue?([y]/n): y
*******************************************************************
先分析文件列表,然后复制文件,可以在屏幕上看到文件滚动的情形。【太多,省略】
*******************************************************************
lib/modules/2.6.18-164.el5/kernel/drivers/ata/pata_sis.ko
lib/modules/2.6.18-164.el5/kernel/drivers/ata/pdc_adma.ko
lib/modules/2.6.18-164.el5/kernel/drivers/ata/sata_inic162x.ko
lib/modules/2.6.18-164.el5/kernel/drivers/ata/sata_mv.ko
lib/modules/2.6.18-164.el5/kernel/drivers/ata/sata_nv.ko
rsyncerror: timeout in data send/receive (code 30) at io.c(171) [sender=2.6.8]
rsync:connection unexpectedly closed (9400368257 bytes received so far) [receiver]
rsyncerror: error in rsync protocol data stream (code 12) at io.c(463)[receiver=2.6.8]
rsync:connection unexpectedly closed (959622 bytes received so far) [generator]
rsyncerror: error in rsync protocol data stream (code 12) at io.c(463)[generator=2.6.8]
-------------Zoho-CentOS5.4-Image IMAGE RETRIEVAL FINISHED -------------
shell-init:error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Press<Enter> to continue...
IPAddress Assignment
---------------------
Thereare three ways to assign IP addresses to the client systems on an
ongoingbasis:
1)DHCP
----------------------------------------------------------------
A DHCP server will assign IP addresses toclients installed with
this image.They may be assigned a different address each time.
If you want to use DHCP, but must ensurethat your clients
receive the same IP address each time, see"man si_mkdhcpstatic".
2)STATIC
----------------------------------------------------------------
The IP address the client uses duringautoinstall will be
permanently assigned to that client.
3)REPLICANT
----------------------------------------------------------------
Don't mess with the network settings in thisimage. I'm using
it as a backup and quick restore mechanismfor a single machine.
Whichmethod do you prefer? [1]: 1
Youhave chosen method 1 for assigning IP addresses.
Areyou satisfied? ([y]/n): y
XMLin()requires either XML::SAX or XML::Parser at /usr/lib/systemimager/perl/SystemImager/Server.pmline 1587
查看一下生成的镜像
[root@sd images]# ls/var/lib/systemimager/images/Zoho-CentOS5.4-Image
bin bootdev etc homelib
查看生成镜像的大小
[root@sd images]# du -shZoho-CentOS5.4-Image
1.5G Zoho-CentOS5.4-Image
至此克隆的第一步已经完成,在上面的几个步骤中首先是配置服务器,其次是配置客户端。
最后进行了镜像制做
Can't locateXML/Simple.pm in [at] INC ( [at] INC contains:
上述报错好像是缺少XML::Simple 模块或者是该模块没有正确安装
安装模块,运行如下命令
# cpan install XML:Simple
在
[root@sd systemconfigurator]#/usr/sbin/si_getimage -golden-client “Image-Client” -image Zoho-CentOS5.4-Image
Can't locate Boot.pm in @INC (@INC contains: /usr/lib/systemconfig/usr/lib/systemimager/perl/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at/usr/lib/systemimager/perl/SystemImager/Common.pm line 1316.
BEGIN failed--compilationaborted at /usr/lib/systemimager/perl/SystemImager/Common.pm line 1316.
Compilation failed in requireat /usr/lib/systemimager/perl/SystemImager/Server.pm line 2244.
BEGIN failed--compilationaborted at /usr/lib/systemimager/perl/SystemImager/Server.pm line 2244.
Compilation failed in requireat /usr/sbin/si_getimage line 46.
BEGIN failed--compilationaborted at /usr/sbin/si_getimage line 46.
出现上述报错的原因是systemconfigurator没有安装
它的功能是: http://wiki.systemimager.org/index.php/System_Configurator