2008/02/22

Red Hat Cluster: CentOS 5.1上でRHCSを使ってみる・その4・DomU bs1のインストール

LuciサーバとなるDomU bs1のインストールは、dc*とほぼ同様。詳しい手順については、『Red Hat Cluster: CentOS 5.1上でRHCSを使ってみる・その3・DomU dcXのインストール』を参照。
Kickstart設定ファイルhttp://repository.xencluster/centos/5/bsX-ks.cfgは以下の通り。
logging --host=192.168.55.192 --level=debug

install
url --url http://repository.xencluster/centos/5/os/i386
lang en_US.UTF-8
keyboard jp106
network --device eth0 --bootproto dhcp --hostname=localhost.localdomain
rootpw --iscrypted $1$KAWvpPhY$2pUQEq/OY2NFyUpCq7OWe/
firewall --enabled --ssh --port=snmp:udp --port=8084:tcp
authconfig --enableshadow --enablemd5
selinux --permissive
timezone Asia/Tokyo
bootloader --location=mbr --driveorder=xvda --append="console=xvc0"

services --enabled=ntpd,oddjobd,snmpd --disabled=avahi-daemon,bluetooth,cpuspeed,cups,hidd,lm_sensors,mdmonitor,microcode_ctl,nfslock,pcscd,smartd,yum-updatesd

clearpart --all --drives=xvda
part /boot --fstype ext3 --size=100 --ondisk=xvda
part pv.2 --size=0 --grow --ondisk=xvda
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=272 --grow --maxsize=544
logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
repo --name=base --baseurl=http://repository.xencluster/centos/5/os/i386/
repo --name=updates --baseurl=http://repository.xencluster/centos/5/updates/i386/
repo --name=addons --baseurl=http://repository.xencluster/centos/5/addons/i386/
repo --name=extras --baseurl=http://repository.xencluster/centos/5/extras/i386/

reboot

%packages
@admin-tools
@base
@cluster-storage
@clustering
@core
@emacs
@mail-server
@network-server
@ruby
@server-cfg
@system-tools
@text-internet
@web-server
-smartmontools
-OpenIPMI*
-squid
-samba-*
-system-config-samba
lynx
tftp
kmod-gfs-xen
kmod-gnbd-xen
-NetworkManager
-bluez-utils
device-mapper-multipath
-irda-utils
-pcmciautils
net-snmp-utils
net-snmp-libs
net-snmp
-kmod-gfs
-kmod-gnbd
-kernel

%post --log=/mnt/sysimage/root/install-post.log
### network
echo 'NOZEROCONF=yes' >> /etc/sysconfig/network

/bin/cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /tmp/ifcfg-eth0
/bin/sed 's/^HWADDR=/#HWADDR=/' < /tmp/ifcfg-eth0 > /etc/sysconfig/network-scripts/ifcfg-eth0

### logrotate
/bin/cat > /etc/logrotate.d/00local.conf <<EOL
rotate 20
compress
start 100
EOL
/sbin/restorecon /etc/logrotate.d/00local.conf

### yum update from the local repository
/bin/cp -p /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.dist
/bin/sed 's/mirrorlist=/#mirrorlist=/
s/#baseurl=/baseurl=/
s/mirror.centos.org/repository.xencluster/' < /etc/yum.repos.d/CentOS-Base.repo.dist > /etc/yum.repos.d/CentOS-Base.repo

### sshd
/bin/cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.dist
/bin/sed 's/^PasswordAuthentication yes/PasswordAuthentication no/' < /etc/ssh/sshd_config.dist > /etc/ssh/sshd_config

/bin/mkdir ~root/.ssh
/bin/chmod 600 ~root/.ssh
/bin/cat > ~root/.ssh/authorized_keys2 <<EOL
ssh-dss AAAA!CUT!N someone@somehost
EOL
/bin/chmod 644 ~root/.ssh/authorized_keys2

### Mail
##### /etc/mail/sendmail.cf
/usr/bin/patch /etc/mail/sendmail.mc <<EOL
26c26
< dnl define(\`SMART_HOST', \`smtp.your.provider')dnl
---
> define(\`SMART_HOST', \`mx.xencluster')dnl
EOL
(cd /etc/mail; /usr/bin/make sendmail.cf)

##### /etc/aliases
/usr/bin/patch /etc/aliases <<EOL
96c96
< #root: marc
---
> root: root@xencluster
EOL
/usr/bin/newaliases

### SNMP
/bin/cat > /etc/snmp/snmpd.conf <<EOL
com2sec localhost localhost COMMUNITY_STRING
com2sec localnet 192.168.55.0/24 COMMUNITY_STRING

group gOpLocalhost v1 localhost
group gOpLocalhost v2c localhost
group gOpLocalnet v1 localnet
group gOpLocalnet v2c localnet

view all included .1
view systemview included REDHAT-CLUSTER-MIB:RedHatCluster

access gOpLocalhost "" any noauth exact all none all
access gOpLocalnet "" any noauth exact all none all

syslocation Unknown
syscontact root@xencluster

disk / 100000

load 10

# for cluster
dlmod RedHatCluster /usr/lib/cluster-snmp/libClusterMonitorSnmp.so
EOL

/bin/cat > /etc/snmp/snmp.conf <<EOL
mibs +REDHAT-MIB:REDHAT-CLUSTER-MIB
EOL

### NTP on Xen DomU
/bin/cat >> /etc/sysctl.conf <<EOL

# For ntpd on Xen DomU.
xen.independent_wallclock = 1
EOL

### cron
/bin/cp -p /etc/crontab /etc/crontab.dist
/bin/sed 's/^\(..\) 4 /\1 5 /' < /etc/crontab.dist > /etc/crontab

### grub
log_mesg "grub"
/bin/cp -p /boot/grub/grub.conf /boot/grub/grub.conf.dist
/bin/sed 's/ rhgb quiet//' < /boot/grub/grub.conf.dist > /boot/grub/grub.conf

### /etc/bashrc
log_mesg "bashrc"
/bin/cp -p /etc/bashrc /etc/bashrc.dist
/bin/sed 's/xterm\*)/xterm*|vt100*)/' < /etc/bashrc.dist > /etc/bashrc



その1・概要
その2・Dom0 fsXのインストール
その3・DomU dcXのインストール
その4・DomU bs1のインストール
その5・Luciの準備
その6・クラスタcDom0sの生成
その7・クラスタcDomUsの生成
その8・クラスタ動作の試験

0 件のコメント: