高可用性存储
我想通过NFS和CIFS使2 TB左右可用。我正在寻找2个(或者更多)服务器解决方案以实现高可用性,并在可能的情况下跨服务器负载平衡。对群集或者高可用性解决方案有什么建议吗?
这是业务用途,计划在未来几年内增长到5-10 TB。我们的设施每周一周六天,每天24小时不间断。我们可能会有15-30分钟的停机时间,但我们想最大程度地减少数据丢失。我想尽量减少凌晨3点的通话。
我们目前正在Solaris上使用ZFS运行一台服务器,并且正在为HA部分寻找AVS,但是Solaris出现了一些小问题(CIFS实现不适用于Vista等)阻碍了我们。
我们已经开始研究
- GFS上的DRDB(用于分布式锁定功能的GFS)
- Gluster(需要客户端,没有本机CIFS支持吗?)
- Windows DFS(文档说仅在文件关闭后才复制?)
我们正在寻找提供数据的"黑匣子"。
当前,我们在ZFS中对数据进行快照,并将快照通过网络发送到远程数据中心以进行异地备份。
我们最初的计划是拥有第二台计算机并每10 15分钟进行rsync。失败的问题是正在进行的生产过程将丢失15分钟的数据,并"留在中间"。从头开始要比找出中间的位置要容易得多。这就是促使我们着眼于高可用性解决方案的原因。
解决方案
回答
我们在寻找"企业"解决方案还是"家庭"解决方案?从问题很难看出,因为2TB对于企业来说很小,而对于家庭用户(尤其是两台服务器)来说高端则很少。我们能否澄清需求,以便我们讨论取舍?
回答
我会建议NAS存储。 (网络添加存储)。
惠普有一些不错的选择。
http://h18006.www1.hp.com/storage/aiostorage.html
以及群集版本:
http://h18006.www1.hp.com/storage/software/clusteredfs/index.html?jumpid=reg_R1002_USEN
回答
如今,2TB可以安装在一台计算机上,因此我们可以选择从简单到复杂的多种方式。这些都假定为linux服务器:
- 我们可以通过设置两台计算机并从主计算机到备份计算机定期执行rsync来获得穷人的HA。
- 我们可以使用DRBD在块级别上彼此镜像。这样做的缺点是将来很难扩展。
- 我们可以使用OCFS2对磁盘进行群集,以备将来扩展。
也有很多商业解决方案,但是如今对于大多数而言,2TB有点小。
我们还没有提到应用程序,但是如果没有必要进行热故障转移,并且我们真正想要的只是可以承受丢失一两个磁盘的事情,那么就可以找到一个支持RAID-5,至少4个驱动器的NAS,和热插拔,我们应该一切顺利。
回答
有两种方法可以解决此问题。首先是直接从戴尔或者惠普那里购买SAN或者NAS,然后花钱解决问题。现代存储硬件使这一切变得容易,从而节省了更多核心问题的专业知识。
如果我们想自己动手,请看看将Linux与DRBD结合使用。
http://www.drbd.org/
DRBD允许我们创建联网的块设备。跨两个服务器而不是仅两个磁盘来考虑RAID 1. 万一一个系统死机,DRBD部署通常使用Heartbeat进行故障转移。
我不确定负载平衡,但是我们可能会进行调查,看看是否可以使用LVS在DRBD主机之间进行负载平衡:
http://www.linuxvirtualserver.org/
总而言之,让我重申一下,从长远来看,我们可能会节省很多时间,只是为NAS掏钱。
回答
我想从问题的主体是我们是企业用户?我从Silicon Mechanics购买了6TB RAID 5单元,并连接了NAS,我的工程师在我们的服务器上安装了NFS。通过rsync执行备份到另一个大容量NAS。
回答
看看Amazon Simple Storage Service(Amazon S3)
http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2?ie=UTF8&node=16427261&no=3435361&me=A36L942TSJ2AJA
--
这可能是有趣的。高可用性
尊敬的AWS客户:
你们中的许多人都要求我们提前告知我们当前正在开发的功能和服务,以便我们可以更好地计划该功能与应用程序的集成方式。为此,我们很高兴与我们分享一些早期细节,以了解我们在AWS上正在开发的一项新服务-内容交付服务。
这项新服务将为我们提供一种向最终用户分发内容的高性能方法,从而使客户在访问对象时具有低延迟和高数据传输率。初始版本需要通过HTTP连接传递流行的,公开可读的内容的开发人员和企业。我们的目标是创建一个内容交付服务,以:
让开发人员和企业轻松上手,没有最低费用,也没有承诺。我们只需支付实际使用的费用。
简单易用使用一个简单的API调用即可开始交付内容。
与Amazon S3无缝协作,这为我们提供了文件的原始最终版本的持久存储,同时使内容交付服务更易于使用。
在全球范围内,我们使用三大洲的边缘地区的全球网络从最合适的位置提供内容。
首先,将对象的原始版本存储在Amazon S3中,以确保它们是公共可读的。然后,我们将进行一个简单的API调用,以使用新的内容交付服务注册存储桶。此API调用将返回一个新域名,供我们包含在网页或者应用程序中。当客户使用此域名请求对象时,它们将被自动路由到最近的边缘位置,以实现内容的高性能交付。就这么简单。
我们目前正在与一小部分私人Beta版客户合作,并希望在今年年底之前广泛使用此服务。如果我们想在我们启动时收到通知,请单击此处告知我们。
真挚地,
亚马逊网络服务团队
回答
我们最好的选择是与从事此类工作为生的专家一起工作。这些家伙实际上在我们的办公大楼里...我有机会与他们一起完成一个我领导的类似项目。
http://www.deltasquare.com/关于
回答
我最近使用DRBD作为后端部署了hanf,在我的情况下,我正在运行活动/备用模式,但是我也已经在主要/主要模式下使用OCFS2成功地对其进行了测试。不幸的是,关于如何最好地实现这一目标的文档并不多,存在的大多数充其量也几乎没有用。如果我们确实遵循drbd路线,强烈建议我们加入drbd邮件列表,并阅读所有文档。这是我为处理ha失败而编写的ha / drbd设置和脚本:
DRBD8是必需的,这是由drbd8-utils和drbd8-source提供的。一旦安装了这些文件(我相信它们是由反向端口提供的),则可以使用模块助手将其安装在m-a a-i drbd8上。 depmod -a或者重新启动,如果我们使用depmod -a,则需要modprobe drbd。
我们将需要一个后端分区才能用于drbd,请勿使该分区成为LVM,否则我们会遇到各种各样的问题。不要将LVM放在drbd设备上,否则会遇到各种各样的问题。
Hanfs1:
/etc/drbd.conf global { usage-count no; } common { protocol C; disk { on-io-error detach; } } resource export { syncer { rate 125M; } on hanfs2 { address 172.20.1.218:7789; device /dev/drbd1; disk /dev/sda3; meta-disk internal; } on hanfs1 { address 172.20.1.219:7789; device /dev/drbd1; disk /dev/sda3; meta-disk internal; } }
Hanfs2的/etc/drbd.conf:
global { usage-count no; } common { protocol C; disk { on-io-error detach; } } resource export { syncer { rate 125M; } on hanfs2 { address 172.20.1.218:7789; device /dev/drbd1; disk /dev/sda3; meta-disk internal; } on hanfs1 { address 172.20.1.219:7789; device /dev/drbd1; disk /dev/sda3; meta-disk internal; } } Once configured, we need to bring up drbd next. drbdadm create-md export drbdadm attach export drbdadm connect export We must now perform an initial synchronization of data - obviously, if this is a brand new drbd cluster, it doesn't matter which node you choose. Once done, you'll need to mkfs.yourchoiceoffilesystem on your drbd device - the device in our config above is /dev/drbd1. http://www.drbd.org/users-guide/p-work.html is a useful document to read while working with drbd. Heartbeat Install heartbeat2. (Pretty simple, apt-get install heartbeat2). /etc/ha.d/ha.cf on each machine should consist of: hanfs1: logfacility local0 keepalive 2 warntime 10 deadtime 30 initdead 120 ucast eth1 172.20.1.218 auto_failback no node hanfs1 node hanfs2 hanfs2: logfacility local0 keepalive 2 warntime 10 deadtime 30 initdead 120 ucast eth1 172.20.1.219 auto_failback no node hanfs1 node hanfs2 /etc/ha.d/haresources should be the same on both ha boxes: hanfs1 IPaddr::172.20.1.230/24/eth1 hanfs1 HeartBeatWrapper I wrote a wrapper script to deal with the idiosyncracies caused by nfs and drbd in a failover scenario. This script should exist within /etc/ha.d/resources.d/ on each machine. !/bin/bash heartbeat fails hard. so this is a wrapper to get around that stupidity I'm just wrapping the heartbeat scripts, except for in the case of umount as they work, mostly if [[ -e /tmp/heartbeatwrapper ]]; then runningpid=$(cat /tmp/heartbeatwrapper) if [[ -z $(ps --no-heading -p $runningpid) ]]; then echo "PID found, but process seems dead. Continuing." else echo "PID found, process is alive, exiting." exit 7 fi fi echo $$ > /tmp/heartbeatwrapper if [[ x == "xstop" ]]; then /etc/init.d/nfs-kernel-server stop #>/dev/null 2>&1 NFS init script isn't LSB compatible, exit codes are 0 no matter what happens. Thanks guys, you really make my day with this bullshit. Because of the above, we just have to hope that nfs actually catches the signal to exit, and manages to shut down its connections. If it doesn't, we'll kill it later, then term any other nfs stuff afterwards. I found this to be an interesting insight into just how badly NFS is written. sleep 1 #we don't want to shutdown nfs first! #The lock files might go away, which would be bad. #The above seems to not matter much, the only thing I've determined #is that if you have anything mounted synchronously, it's going to break #no matter what I do. Basically, sync == screwed; in NFSv3 terms. #End result of failing over while a client that's synchronous is that #the client hangs waiting for its nfs server to come back - thing doesn't #even bother to time out, or attempt a reconnect. #async works as expected - it insta-reconnects as soon as a connection seems #to be unstable, and continues to write data. In all tests, md5sums have #remained the same with/without failover during transfer. #So, we first unmount /export - this prevents drbd from having a shit-fit #when we attempt to turn this node secondary. #That's a lie too, to some degree. LVM is entirely to blame for why DRBD #was refusing to unmount. Don't get me wrong, having /export mounted doesn't #help either, but still. #fix a usecase where one or other are unmounted already, which causes us to terminate early. if [[ "$(grep -o /varlibnfs/rpc_pipefs /etc/mtab)" ]]; then for ((test=1; test <= 10; test++)); do umount /export/varlibnfs/rpc_pipefs >/dev/null 2>&1 if [[ -z $(grep -o /varlibnfs/rpc_pipefs /etc/mtab) ]]; then break fi if [[ $? -ne 0 ]]; then #try again, harder this time umount -l /var/lib/nfs/rpc_pipefs >/dev/null 2>&1 if [[ -z $(grep -o /varlibnfs/rpc_pipefs /etc/mtab) ]]; then break fi fi done if [[ $test -eq 10 ]]; then rm -f /tmp/heartbeatwrapper echo "Problem unmounting rpc_pipefs" exit 1 fi fi if [[ "$(grep -o /dev/drbd1 /etc/mtab)" ]]; then for ((test=1; test <= 10; test++)); do umount /export >/dev/null 2>&1 if [[ -z $(grep -o /dev/drbd1 /etc/mtab) ]]; then break fi if [[ $? -ne 0 ]]; then #try again, harder this time umount -l /export >/dev/null 2>&1 if [[ -z $(grep -o /dev/drbd1 /etc/mtab) ]]; then break fi fi done if [[ $test -eq 10 ]]; then rm -f /tmp/heartbeatwrapper echo "Problem unmount /export" exit 1 fi fi #now, it's important that we shut down nfs. it can't write to /export anymore, so that's fine. #if we leave it running at this point, then drbd will screwup when trying to go to secondary. #See contradictory comment above for why this doesn't matter anymore. These comments are left in #entirely to remind me of the pain this caused me to resolve. A bit like why churches have Jesus #nailed onto a cross instead of chilling in a hammock. pidof nfsd | xargs kill -9 >/dev/null 2>&1 sleep 1 if [[ -n $(ps aux | grep nfs | grep -v grep) ]]; then echo "nfs still running, trying to kill again" pidof nfsd | xargs kill -9 >/dev/null 2>&1 fi sleep 1 /etc/init.d/nfs-kernel-server stop #>/dev/null 2>&1 sleep 1 #next we need to tear down drbd - easy with the heartbeat scripts #it takes input as resourcename start|stop|status #First, we'll check to see if it's stopped /etc/ha.d/resource.d/drbddisk export status >/dev/null 2>&1 if [[ $? -eq 2 ]]; then echo "resource is already stopped for some reason..." else for ((i=1; i <= 10; i++)); do /etc/ha.d/resource.d/drbddisk export stop >/dev/null 2>&1 if [[ $(egrep -o "st:[A-Za-z/]*" /proc/drbd | cut -d: -f2) == "Secondary/Secondary" ]] || [[ $(egrep -o "st:[A-Za-z/]*" /proc/drbd | cut -d: -f2) == "Secondary/Unknown" ]]; then echo "Successfully stopped DRBD" break else echo "Failed to stop drbd for some reason" cat /proc/drbd if [[ $i -eq 10 ]]; then exit 50 fi fi done fi rm -f /tmp/heartbeatwrapper exit 0
elif " x $ 1" ==" xstatus";然后
#start up drbd first /etc/ha.d/resource.d/drbddisk export start >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "Something seems to have broken. Let's check possibilities..." testvar=$(egrep -o "st:[A-Za-z/]*" /proc/drbd | cut -d: -f2) if [[ $testvar == "Primary/Unknown" ]] || [[ $testvar == "Primary/Secondary" ]] then echo "All is fine, we are already the Primary for some reason" elif [[ $testvar == "Secondary/Unknown" ]] || [[ $testvar == "Secondary/Secondary" ]] then echo "Trying to assume Primary again" /etc/ha.d/resource.d/drbddisk export start >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "I give up, something's seriously broken here, and I can't help you to fix it." rm -f /tmp/heartbeatwrapper exit 127 fi fi fi sleep 1 #now we remount our partitions for ((test=1; test <= 10; test++)); do mount /dev/drbd1 /export >/tmp/mountoutput if [[ -n $(grep -o export /etc/mtab) ]]; then break fi done if [[ $test -eq 10 ]]; then rm -f /tmp/heartbeatwrapper exit 125 fi #I'm really unsure at this point of the side-effects of not having rpc_pipefs mounted. #The issue here, is that it cannot be mounted without nfs running, and we don't really want to start #nfs up at this point, lest it ruin everything. #For now, I'm leaving mine unmounted, it doesn't seem to cause any problems. #Now we start up nfs. /etc/init.d/nfs-kernel-server start >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "There's not really that much that I can do to debug nfs issues." echo "probably your configuration is broken. I'm terminating here." rm -f /tmp/heartbeatwrapper exit 129 fi #And that's it, done. rm -f /tmp/heartbeatwrapper exit 0
科幻
完成上述所有操作后,我们只需要配置/ etc / exports
#Lets check to make sure nothing is broken. #DRBD first /etc/ha.d/resource.d/drbddisk export status >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "stopped" rm -f /tmp/heartbeatwrapper exit 3 fi #mounted? grep -q drbd /etc/mtab >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "stopped" rm -f /tmp/heartbeatwrapper exit 3 fi #nfs running? /etc/init.d/nfs-kernel-server status >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "stopped" rm -f /tmp/heartbeatwrapper exit 3 fi echo "running" rm -f /tmp/heartbeatwrapper exit 0
然后,这只是在两台计算机上启动心跳并在其中一台计算机上发出hb_takeover的情况。我们可以通过以下方法测试它是否正常工作:确定发出该命令的对象是主检查/ proc / drbd,该设备已正确安装,并且可以访问nfs。
--
祝你好运。对我来说,从头开始设置它是一次非常痛苦的经历。
回答
我可以建议我们访问F5网站并查看http://www.f5.com/solutions/virtualization/file/
回答
我们可以查看镜像文件系统。它在文件系统级别执行文件复制。
主系统和备份系统上的相同文件均为实时文件。
http://www.linux-ha.org/RelatedTechnologies/Filesystems
代码数量不匹配