没有合适的资源?快使用搜索试试~ 我知道了~
首页构建Heartbeat+DRBD+NFS高可用文件共享存储
资源详情
资源评论
资源推荐
资源由 www.eimhe.com 美河学习在线收集提供
实验简介:
本实验部署 DRBD + HEARDBEAT + NFS 环境,建立一个高可用(HA)的文件服务器
集群。在方案中,通过 DRBD 保证了服务器数据的完整性和一致性。DRBD 类似于
一个网络 RAID-1功能。当 你将数据写入本地文件系统时,数据还将会被发送到
网络中另一台主机上,以相同的形式记录在一个另文件系统中。主节点与备节
点的数据可以保证实时相互同步。 当本地主服务器出现故障时,备份服务器上
还会保留有一份相同的数据,可以继续使用。在高可用(HA)中使用 DRBD 功能,
可以代替使用一个共享盘阵。因为 数据同时存在于本地主服务器和备份服务器
上。切换时,远程主机只要使用它上面的那份备份数据,就可以继续提供主服
务器上相同的服务,并且 client 用户 对主服务器的故障无感知。系统环境:
[root@localhost ~]# uname -r
2.6.18-164.el5
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
拓扑图:
一、DRBD 的配置
node1主机配置
主机名配置 node1主机名配置
[root@localhost ~]# vim /etc/sysconfig/network
3 HOSTNAME=node1.a.com
[root@localhost ~]# hostname node1.a.com #配置后需注销才能生效
[root@localhost ~]# hostname #查看主机名
node1.a.com
配置本地 DNS 解析
[root@node1 ~]# vim /etc/hosts
资源由 www.eimhe.com 美河学习在线收集提供
5 192.168.2.10 node1.a.com
6 192.168.2.11 node2.a.com
创建一个新的分区
查看分区
[root@node1 ~]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1288 10241437+ 83 Linux
/dev/sda3 1289 1353 522112+ 82 Linux swap /
Solaris
增加一个扩展分区
[root@node1 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p ##查看
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1288 10241437+ 83 Linux
/dev/sda3 1289 1353 522112+ 82 Linux swap /
Solaris
Command (m for help): n ##增加分区
Command action
e extended
p primary partition (1-4)
e ##扩展分区
Selected partition 4
First cylinder (1354-2610, default 1354):
资源由 www.eimhe.com 美河学习在线收集提供
Using default value 1354
Last cylinder or +size or +sizeM or +sizeK (1354-2610, default 2610):
Using default value 2610
Command (m for help): p ##查看
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1288 10241437+ 83 Linux
/dev/sda3 1289 1353 522112+ 82 Linux swap /
Solaris
/dev/sda4 1354 2610 10096852+ 5 Extended
增加一个逻辑分区
Command (m for help): n
First cylinder (1354-2610, default 1354):
Using default value 1354
Last cylinder or +size or +sizeM or +sizeK (1354-2610, default 2610): +1g
查看分区
Command (m for help): p
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1288 10241437+ 83 Linux
/dev/sda3 1289 1353 522112+ 82 Linux swap /
Solaris
/dev/sda4 1354 2610 10096852+ 5 Extended
/dev/sda5 1354 1476 987966 83 Linux
保存退出
Command (m for help): w
内核重新识别分区
[root@node1 ~]# partprobe /dev/sda
[root@node1 ~]# cat /proc/partitions
major minor #blocks name
8 0 20971520 sda
资源由 www.eimhe.com 美河学习在线收集提供
8 1 104391 sda1
8 2 10241437 sda2
8 3 522112 sda3
8 4 0 sda4
8 5 987966 sda5
把下载好的 rpm 安装包传到 node1上,如图:
安装 drdb 服务[root@node1 ~]# rpm -ivh
drbd83-8.3.8-1.el5.centos.i386.rpm
安装内核模块
[root@node1 ~]# rpm -ivh kmod-drbd83-8.3.8-1.el5.centos.i686.rpm
安装之后形成的文件
[root@node1 ~]# rpm -ql drbd83 |less
[root@node1 ~]# rpm -ql kmod-drbd83 |less
将这两个安装包 copy 到 node2,并安装
[root@node1 ~]# scp *.rpm node2.a.com:/root/
The authenticity of host 'node2.a.com (192.168.2.11)' can't be
established.
RSA key fingerprint is 3a:64:a0:6e:d0:21:14:6c:e9:1e:84:50:89:42:05:29.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2.a.com,192.168.2.11' (RSA) to the list
of known hosts.
root@node2.a.com'spassword:
drbd83-8.3.8-1.el5.centos.i386.rpm 100% 217KB
216.7KB/s 00:00
kmod-drbd83-8.3.8-1.el5.centos.i686.rpm 100% 123KB
123.0KB/s 00:00
编辑配置文件
[root@node1 ~]# vim /etc/drbd.conf
#
# please have a a look at the example configuration file in
# /usr/share/doc/drbd83/drbd.conf
#
进入底行模式下,进行读取那个文件
:read /usr/share/doc/drbd83-8.3.8/drbd.conf
可以看到
include "drbd.d/global_common.conf";通用配置的文件
include "drbd.d/*.res"; 定义资源的文件
剩余16页未读,继续阅读
machen_smiling
- 粉丝: 506
- 资源: 1958
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0