CentOS5.8 cman+rgmanager+iscsi+gfs2+cLVM 实现集群共享存储

大纲

一、系统环境

二、准备工作

三、配置过程

一、系统环境

系统环境

CentOS5.8 x86_64

node1.network.com    node1    172.16.1.101

node2.network.com    node2    172.16.1.105

node3.network.com    node3    172.16.1.110

软件版本

cman-2.0.115-124.el5.x86_64.rpm

rgmanager-2.0.52-54.el5.centos.x86_64.rpm

system-config-cluster-1.0.57-17.noarch.rpm

二、准备工作

1、时间同步

[[email protected] ~]# ntpdate s2c.time.edu.cn
[[email protected] ~]# ntpdate s2c.time.edu.cn
[[email protected] ~]# ntpdate s2c.time.edu.cn

可根据需要在每个节点上定义crontab任务
[[email protected] ~]# which ntpdate
/sbin/ntpdate
[[email protected] ~]# echo "*/5 * * * * /sbin/ntpdate s2c.time.edu.cn &> /dev/null" >> /var/spool/cron/root 
[[email protected] ~]# crontab -l
*/5 * * * * /sbin/ntpdate s2c.time.edu.cn &> /dev/null

2、主机名称要与uname -n,并通过/etc/hosts解析

node1
[[email protected] ~]# hostname node1.network.com
[[email protected] ~]# uname -n
node1.network.com
[[email protected] ~]# sed -i ‘[email protected]\(HOSTNAME=\).*@\[email protected]‘  /etc/sysconfig/network

node2
[[email protected] ~]# hostname node2.network.com
[[email protected] ~]# uname -n
node2.network.com
[[email protected] ~]# sed -i ‘[email protected]\(HOSTNAME=\).*@\[email protected]‘  /etc/sysconfig/network

node3
[[email protected] ~]# hostname node3.network.com
[[email protected] ~]# uname -n
node3.network.com
[[email protected] ~]# sed -i ‘[email protected]\(HOSTNAME=\).*@\[email protected]‘  /etc/sysconfig/network

node1添加hosts解析
[[email protected] ~]# vim /etc/hosts
[[email protected] ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

172.16.1.101	node1.network.com node1
172.16.1.105	node2.network.com node2
172.16.1.110	node3.network.com node3

拷贝此hosts文件至node2
[[email protected] ~]# scp /etc/hosts node2:/etc/
The authenticity of host ‘node2 (172.16.1.105)‘ can‘t be established.
RSA key fingerprint is 13:42:92:7b:ff:61:d8:f3:7c:97:5f:22:f6:71:b3:24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘node2,172.16.1.105‘ (RSA) to the list of known hosts.
[email protected]‘s password: 
hosts                  100%  233     0.2KB/s   00:00

拷贝此hosts文件至node3
[[email protected] ~]# scp /etc/hosts node3:/etc/
The authenticity of host ‘node3 (172.16.1.110)‘ can‘t be established.
RSA key fingerprint is 13:42:92:7b:ff:61:d8:f3:7c:97:5f:22:f6:71:b3:24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘node3,172.16.1.110‘ (RSA) to the list of known hosts.
hosts                                    100%  320     0.3KB/s   00:00

3、ssh互信通信

node1
[[email protected] ~]# ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ‘‘
Generating public/private rsa key pair.
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? n                                            # 我这里已经生成过了
[[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub node2
[email protected]‘s password: 
Now try logging into the machine, with "ssh ‘node2‘", and check in:

  .ssh/authorized_keys

to make sure we haven‘t added extra keys that you weren‘t expecting.

[[email protected] ~]# setenforce 0
[[email protected] ~]# ssh node2 ‘ifconfig‘
eth0      Link encap:Ethernet  HWaddr 00:0C:29:D6:03:52  
          inet addr:172.16.1.105  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed6:352/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9881 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11220 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5898514 (5.6 MiB)  TX bytes:1850217 (1.7 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1112 (1.0 KiB)  TX bytes:1112 (1.0 KiB)
          
同理node2也需要做同样的双击互信,一样的操作,此处不再演示

4、关闭iptables和selinux

node1

[[email protected] ~]# service iptables stop
[[email protected] ~]# vim /etc/sysconfig/selinux 
[[email protected] ~]# cat /etc/sysconfig/selinux
# 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=permissive
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

[[email protected] ~]# service iptables stop
[[email protected] ~]# vim /etc/sysconfig/selinux 
[[email protected] ~]# cat /etc/sysconfig/selinux
# 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=permissive
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#	targeted - Only targeted network daemons are protected.
#	strict - Full SELinux protection.
SELINUXTYPE=targeted

node3

[[email protected] ~]# service iptables stop
[[email protected] ~]# vim /etc/sysconfig/selinux 
[[email protected] ~]# cat /etc/sysconfig/selinux
# 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=permissive
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#	targeted - Only targeted network daemons are protected.
#	strict - Full SELinux protection.
SELINUXTYPE=targeted
时间: 2024-08-14 22:32:01

CentOS5.8 cman+rgmanager+iscsi+gfs2+cLVM 实现集群共享存储的相关文章

gfs2+cman+rgmanager+iscsi实现文件集群

gfs2+cman+rgmanager+iscsi实现文件集群 主机名   ip              角色 SMB2   172.31.200.66     samba服务器1 SMB2   172.31.200.67     samba 服务器2 SAN     172.31.88.61     SAN存储分区 由于SAN是测试环境中划分出来的SAN,所以在此次测试中不需要安装配置 以下是对SMB1.SMB2两台samba文件服务器进行配置 SMB1上配置 在客户机安装initiator

高可用结合gfs2,,实现集群文件系统以及集群逻辑卷。

为什么要集群文件系统,在什么场景中适用我就用一句话来概括,当多个节点需要读写同一个文件系统时,需要使用集群文件系统,它可以将文件系统持有的锁信息传递到各个节点. 实验一.将iSCSI共享出来的磁盘,做成gfs2文件系统,实现多个节点可挂载同一个文件系统,保证数据同步 实验平台:RHEL6 环境拓扑: ansible配置前面文章有讲到    略 iSCSI服务器配置    略 用控制端让三个节点安装需要的程序包. ansible all -m shell -a 'yum install cman

scsi+gfs2+lvs2-cluster+rhcs集群

规划: target(server) server:192.168.1.254 initiator(client) rs1.china-kody.com 192.168.1.215 rs2.china-kody.com 192.168.1.216 rs3.china-kody.com 192.168.1.217 使用的软件包: server: scsi-target-utils client:iscsi-initiator-utils ricci luci  gfs2-utils lvm2-cl

StarWind模拟iscsi设备 为vmware测试提供共享存储

一.安装StarWind 1.准备计算机 StarWind将安装在一台Windosws 2012 R2服务器上,这台服务器的IP地址为:192.168.105.30 2.启动相应的服务 由于iSCSI通过TCP协议访问共享存储,而Microsoft又提供了模拟器,所以Win2012中直接集成了相关的驱动. 在安装StarWind软件时,要求计算机必须启动"iSCSI 发起程序"服务.因此,在安装之前还是最好启动"iSCSI 发起程序". 3.安装软件 安装过程比较简

Linux iSCSI协议实现共享存储

大纲 一.存储设备类型 二.什么是SCSI和iSCSI 三.iSCSI安装与配置 一.存储设备类型 DAS:Direct Attached Storage 直连主机的总线上的设备 NAS:network Attached Storage 文件共享服务器,共享级别file SAN:Storage Area Network 把SCSI协议借助于其他网络协议实现传送 tcp/ip iscsi FC(光纤): FCoE NAS与SAN的对比图 二.什么是SCSI和iSCSI 小型计算机系统接口(英语:S

RHCS集群使用cman+rgmanager配置

一.简介及前提准备 承接上文 ---> RHCS集群简介及配置web高可用 使用cman+rgmanager配置RHCS,不需安装luci/ricci,直接安装cman和rgmanager 二.cman+rgmanage配置 1.安装cman+rgmanager(node1,node2,node3) [[email protected] ~]# yum install cman rgmanager -y 2.创建集群,自动生成配置文件 [[email protected] ~]# ccs_too

RHCS+GFS2+ISCSI+CLVM实现共享存储

RHCS+GFS2+ISCSI+CLVM实现共享存储                            2015-03-25 16:35:29 标签:iscsi scsi rhcs clvm gfs2 本文转载修改自http://www.it165.net/admin/html/201404/2654.html 一,GFS2简介 GFS2 是一个基于GFS的先进的集群文件系统,能够同步每台主机的集群文件系统的metadata,能够进行文件锁的管理,并且必须要redhat cluster su

高可用,多路冗余GFS2集群文件系统搭建详解

2014.06 标签:GFS2 multipath 集群文件系统 cmirror 实验拓扑图: 实验原理: 实验目的:通过RHCS集群套件搭建GFS2集群文件系统,保证不同节点能够同时对GFS2集群文件系统进行读取和写入,其次通过multipath实现node和FC,FC和Share Storage之间的多路冗余,最后实现存储的mirror复制达到高可用. GFS2:全局文件系统第二版,GFS2是应用最广泛的集群文件系统.它是由红帽公司开发出来的,允许所有集群节点并行访问.元数据通常会保存在共享

RHCS+Conga+GFS+cLVM共享存储的高可用性web集群

一.RHCS简介: RHCS是Red Hat ClusterSuite的缩写. RHCS是一个功能完备的集群应用解决方案,它从应用的前端访问到后端的数据存储都提供了一个行之有效的集群架构实现,通过RHCS提供的这种解决方案,不但能保证前端应用持久.稳定的提供服务,同时也保证了后端数据存储的安全. RHCS集群的组成: RHCS是一个集群套件,其主要包括以下几部分: 1.集群构架管理器:RHCS的基础套件,提供集群的基本功能,主要包括布式集群管理器(CMAN).锁管理(DLM).配置文件管理(CC