简体   繁体   English

如何完成Windows共享故障转移系统?

[英]How to accomplish a Windows share failover system?

I have a primary and a backup windows 2008 server, and a bunch of windows XP clients that map a drive to a share on the primary server. 我有一个主Windows Server和一个备份Windows 2008 Server,以及一堆将驱动器映射到主服务器上的共享的Windows XP客户端。 If the primary server goes down, I want those client machines to automatically re-map their drive to the backup server, so they can continue to access the files. 如果主服务器出现故障,我希望那些客户端计算机自动将其驱动器重新映射到备份服务器,以便它们可以继续访问文件。

Should I try to write a vbscript or python script or something that detects if the primary server is down and issues the appropriate "net use m: \\server\\share ..." but I need that script to run every minute, no matter who is logged in. Can I do that with windows "scheduled tasks" ? 我应该尝试编写vbscript或python脚本还是检测主服务器是否关闭并发出适当的“ net use m:\\ server \\ share ...”的东西,但是无论谁,我都需要每分钟运行该脚本已登录。我可以使用Windows“计划任务”来执行此操作吗?

I'm a Unix guy, and could use any tips you have to offer on accomplishing this. 我是Unix专家,可以使用您提供的所有技巧来实现这一目标。 Is there a better solution? 有更好的解决方案吗?

many thanks, -Ian 非常感谢,-伊恩

You could use DFS and have clients map to that for their share. 您可以使用DFS,让客户映射到其共享。 Then they'd be redirected to one server or the other. 然后将它们重定向到一台服务器或另一台服务器。 This assumes that your DFS server stays up, of course. 当然,这假定您的DFS服务器保持启动状态。

That sounds like you need a client side solution then, unfortunately. 不幸的是,这听起来像您需要一个客户端解决方案。 Something along the lines of the following, in a .cmd file in each machine's startup folder or otherwise placed so that upon failure to connect, this file is executed: 遵循以下内容,位于每台计算机的启动文件夹中的.cmd文件中,或放置在其他位置,以便在连接失败时执行此文件:

if not exist \\server1\sharename goto mapsecondserver 
net use z: \\server1\sharename 
goto end 

:mapsecondserver 
net use z: \\server2\sharename 
goto end 

:end 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM