邮件启动
/etc/init.d/mysql.server.front.csmail start
/etc/init.d/mysql.server.csmail start
/etc/init.d/csmail.rc start
邮件件关闭
/etc/init.d/csmail.rc stop
/etc/init.d/mysql.server.csmail stop
/etc/init.d/mysql.server.front.csmail stop
1.准备双机环境
操作系统: CentOS release 5.8 (Final)
三台机器: csmail_ha1 --ha1 --192.168.0.21 ->第一台csmail
csmail_ha2 --ha2 --192.168.0.22 ->第二台csmail
csmail_nfs --nfs --192.168.0.30 ->两台机器的共用存储,使用nfs
--vip --192.168.0.20 ->虚拟IP
2.相关软件
csmail邮件8.12版本
heartbeat-2.1.4.tar.bz2
3.系统配置
.
.nfs配置
在csmail_nfs主机建/csdata目录,并共享出去
/csdata 192.168.0.0/24(rw,sync,no_root_squash)
.以下操作要在ha1和ha2都做一次
.安装依赖组件:
yum groupinstall -y "Legacy Software Development" "Legacy Software Support" \
"Development Libraries" "Development Tools"
.更新ha1和ha2对应的主机名
.创建用户和用户组,要保证两台机器的uid和gid相同,组id为600,uid为601
groupadd -g 600 haclient
useradd -u 601 -g haclient hacluster
.设置/etc/hosts文件
csmail_ha1 192.168.0.21
csmail_ha2 192.168.0.22
同时指出自己是哪台机器
127.0.0.1 csmail_ha? localhost.localdomain localhost
::1 csmail_ha? localhost6.localdomain6 localhost6
.设置/etc/sysconfig/networks
NETWORKING=yes
NETWORKING_IPV6=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=csmail_ha?
.设置/etc/reslov.conf
第一行:search localdomain 先查找本地hosts文件
4.安装过程
a.安装邮件
.在ha1安装邮件,执行setup.sh安装
.ha1查看/etc/passwd,找到以下三个对应的行,并复制到ha2的passwd文件中
csmail:x:500:501::/opt/foundir/csmail:/bin/bash
postfix:x:501:503::/home/postfix:/bin/bash
mysql:x:502:504::/home/mysql:/bin/bash
.ha1查看/etc/group,找到以下个对应的行,并复制到ha2的group文件中
postdrop:x:500:
foundir:x:501:
csmail:x:502:csmail
postfix:x:503:
mysql:x:504:
.在ha2安装邮件,执行setup.sh安装
.关闭开机自动启动,后面程序的启动会由heartbeat来控制
chkconfig mysql.server.front.csmail off
chkconfig mysql.server.csmail off
chkconfig csmail.rc off
b.安装heartbeat
.上传软件包Heartbeat-2-1-STABLE-2.1.4.tar.bz2并解压
.cd到解压出来的目录
./bootstrap --prefix=/opt/heartbeat && make && make install
.cp /opt/heartbeat/share/doc/heartbeat-2.1.4/{ha.cf,haresources,authkeys} /opt/heartbeat/etc/ha.d/
.mv /etc/init.d/*csmail* /opt/heartbeat/etc/ha.d/resource.d/
c.三个文件配置
.ha.cf文件
use_logd yes
debugfile /var/log/rhythmha-debug
logfile /var/log/rhythmha-log
logfacility local0
udpport 694
keepalive 2
deadtime 30
warntime 10
initdead 120
hopfudge 1
ucast eth0 192.168.0.21
auto_failback off
node csmail_ha1 csmail_ha2
.haresources文件
csmail_ha1 192.168.0.20 rhythmha_mount httpd mysql.server.csmail mysql.server.front.csmail csmail.rc rhythmha_report
.authkeys文件
auth 1
1 crc
2 sha1 HI!
3 md5 Hello!
5,启动测试
沒有留言:
張貼留言