Linux 高可用(HA)集群之Corosync详解(2)

 

 

首页服务器应用

背景:

阅读新闻

Linux 高可用(HA)集群之Corosync详解

[日期:2013-08-13]   来源:Linux社区  作者:freeloda   [字体:]  

二、Corysync与Pacemaker 安装
1.环境说明
(1).操作系统
CentOS 6.4 X86_64位系统

(2).软件环境
corosync-1.4.1-15.el6_4.1.x86_64

pacemaker-1.1.8-7.el6.x86_64

(3).拓扑环境

2.前提条件
node1:
(1).各节点之间主机名互相解析
[root@node1 ~]# uname -n 
node1.test.com
[root@node1 ~]# vim /etc/hosts
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4 
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6   
192.168.18.201  node1.test.com  node1   
192.168.18.202  node2.test.com  node2
[root@node1 ~]# ping node1 
[root@node1 ~]# ping node2

(2).各节点之间时间同步   

1 [root@node1 ~]# ntpdate 210.72.145.44

(3).各节点之间ssh互信 

[root@node1 ~]# ssh-keygen  -t rsa -f ~/.ssh/id_rsa  -P ''   
[root@node1 ~]# ssh-copy-id -i .ssh/id_rsa.pub root@node2.test.com

node2:
(1).各节点之间主机名互相解析
[root@node2 ~]# uname -n 
node2.test.com
[root@node2 ~]# vim /etc/hosts
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4 
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6   
192.168.18.201  node1.test.com  node1   
192.168.18.202  node2.test.com  node2
[root@node2~]# ping node1 
[root@node2 ~]# ping node2

(2).各节点之间时间同步   

[root@node2 ~]# ntpdate 210.72.145.44

(3).各节点之间ssh互信 

[root@node2 ~]# ssh-keygen  -t rsa -f ~/.ssh/id_rsa  -P ''   
[root@node2 ~]# ssh-copy-id -i .ssh/id_rsa.pub root@node1.test.com

3.配置yum源(EPEL源)
node1:
[root@node1 src]# wget Fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
[root@node1 src]# rpm -ivh epel-release-5-4.noarch.rpm
warning: epel-release-5-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...                ########################################### [100%]
1:epel-release          ########################################### [100%]
[root@node1 src]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[root@node1 src]# yum list

node2:

[root@node2 src]# wget
[root@node2 src]# rpm -ivh epel-release-5-4.noarch.rpm
warning: epel-release-5-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...                ########################################### [100%]
1:epel-release          ########################################### [100%]
[root@node2 src]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[root@node2 src]# yum list

4.关闭防火墙与SELinux

node1:
[root@node1 ~]# service iptables stop
[root@node1 ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#      enforcing - SELinux security policy is enforced.
#      permissive - SELinux prints warnings instead of enforcing.
#      disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#      targeted - Only targeted network daemons are protected.
#      strict - Full SELinux protection.
SELINUXTYPE=targeted

node2:
[root@node2 ~]# service iptables stop
[root@node2 ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#      enforcing - SELinux security policy is enforced.
#      permissive - SELinux prints warnings instead of enforcing.
#      disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#      targeted - Only targeted network daemons are protected.
#      strict - Full SELinux protection.
SELINUXTYPE=targeted

5.安装corosync与pacemaker
node1:
12 [root@node1 ~]# yum install -y corosync*
[root@node1 ~]# yum install -y pacemaker*

node2:
[root@node2 ~]# yum install -y corosync*
[root@node2 ~]# yum install -y pacemaker*

linux

 

RHN客户端注册的时候报SSL错误

Monitorix监控Linux主机图文详解

相关资讯      

   

本文评论   查看全部评论 (1)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

第 1 楼

*

匿名 发表于 2013/9/20 17:58:45

博主写得非常好啊!请问你有没有博客地址啊,回复个博客地址吧,想关注下博主的博客。

(3) (0)

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2c9adace79125eb1a033b06fa13f956d.html