2009年2月9日星期一

使用Systemimager自動化Linux安裝及復原

Systemimager與傳統的image方法比較起來具有相當多的優點。Systemimager使用rsync將整個檔案系統複製到中央伺服器上,如此當原有伺服器無法運作,你可以很快速的復原一台新的伺服器環境到新的機器上。From Linux.com "Automate Linux installation and recovery with SystemImager"
1.) 下載
a.) wget http://download.systemimager.org/pub/sis-install/install -O systemimager.pl b.) 執行 perl systemimager.pl -v --download-only --tag stable --directory . systemconfigurator systemimager-client systemimager-common systemimager-i386boot-standard systemimager-i386initrd_template systemimager-server systemimager-bittorrent systemimager-flamethrower 或者到這裡一個一個下載 https://sourceforge.net/project/showfiles.php?group_id=259 https://sourceforge.net/project/showfiles.php?group_id=24006 systemconfigurator-2.2.9-1.noarch.rpm systemimager-bittorrent-3.8.1-1.noarch.rpm systemimager-client-3.8.1-1.noarch.rpm systemimager-common-3.8.1-1.noarch.rpm systemimager-flamethrower-3.8.1-1.noarch.rpm systemimager-i386boot-standard-3.8.1-1.noarch.rpm systemimager-i386initrd_template-3.8.1-1.noarch.rpm systemimager-server-3.8.1-1.noarch.rpm2.) 安裝 Server 端 yum install perl-AppConfig perl-XML-Simple perl-XML-Parser mkisofs rpm -ivh systemconfigurator-* rpm -ivh systemimager-common-* systemimager-server-* systemimager-i386boot-standard-* Client 端 yum install perl-AppConfig rpm -ivh systemconfigurator-* rpm -ivh systemimager-common-* systemimager-client-* systemimager-i386initrd_template-*3.) 開始 Client 端,指定 image server ip si_prepareclient --server 10.1.1.111
Welcome to the SystemImager si_prepareclient command. This command may modifythe following files to prepare your golden client for having it's imageretrieved by the imageserver. It will also create the /etc/systemimagerdirectory and fill it with information about your golden client. All modifiedfiles will be backed up with the .before_systemimager-3.8.1 extension.
/etc/services: This file defines the port numbers used by certain software on your system. Entries for rsync will be added if necessary.
/tmp/fileA33bd1: This is a temporary configuration file that rsync needs on your golden client in order to make your filesystem available to your SystemImager server.
inetd configuration: SystemImager needs to run rsync as a standalone daemon on your golden client until it's image is retrieved by your SystemImager server. If rsyncd is configured to run as a service started by inetd, it will be temporarily disabled, and any running rsync daemons or commands will be stopped. Then, an rsync daemon will be started using the temporary configuration file mentioned above.
See "si_prepareclient --help" for command line options.
Continue? (y/[n]): y*********************************** WARNING ***********************************This utility starts an rsync daemon that makes all of your files accessibleby anyone who can connect to the rsync port of this machine. This is thecase until you reboot, or kill the 'rsync --daemon' process by hand. Bydefault, once you use si_getimage to retrieve this image on your imageserver,these contents will become accessible to anyone who can connect to the rsyncport on your imageserver. See rsyncd.conf(5) for details on restrictingaccess to these files on the imageserver. See the systemimager-ssh packagefor a more secure method of making images available to clients.*********************************** WARNING ***********************************Continue? (y/[n]): yOne or more rsync daemons appear to be running on this machine. If youcontinue, those daemons will be killed.Continue? (y/[n]): y
Server 端,從 client 10.1.1.113 rsync 資料 至 server 10.1.1.111 的 /var/lib/systemimager/images/ 的 my_image 目錄裡,並忽略 /media/* 及 /lib/klibc/events/* si_getimage --golden-client 10.1.1.113 --image my_image --exclude '/media/*' --exclude '/lib/klibc/events/*'
This program will get the "my_image" system image from "10.1.1.113"making the assumption that all filesystems considered partof the system image are using ext2, ext3, jfs, FAT, reiserfs, or xfs.
This program will not get /proc, NFS, or other filesystemsnot mentioned above.
*********************************** WARNING ***********************************All files retrieved from a golden client are, by default, made accessible toanyone who can connect to the rsync port of this machine. See rsyncd.conf(5)for details on restricting access to these files on the imageserver. See thesystemimager-ssh package for a more secure (but less effecient) method ofmaking images available to clients.*********************************** WARNING ***********************************
See "si_getimage --help" for command line options.
Continue? ([y]/n): y
ref:http://wiki.systemimager.org/index.php/Quick_Start_HOWTO
http://www.howtoforge.com/howto_linux_systemimager
http://www.linux.com/articles/53888

没有评论: