请帮助..我正在尝试创建一个具有两个节点的集群(它们都是服务器 2008)并且我正在从 Windows 7 运行这个 C# 应用程序。在创建时我得到以下异常..
Unhandled Exception: System.Management.ManagementException: Generic failure
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStat
us errorCode)
at System.Management.ManagementObject.InvokeMethod(String methodName, Managem
entBaseObject inParameters, InvokeMethodOptions options)
at Test.main.Main() in D:\Abhijit\Sandbox\BatonInstallerProject\BIM\windows\s
ource\test\main.cs:line 202
public void CreateCluster(String[] NodeNames, String ClusterName, String ClusterIP)
{
string[] ipaddresses = new string[1];
string[] subnetmasks = new string[1];
subnetmasks[0] = "255.255.255.0";
ipaddresses[0] = ClusterIP;
ManagementPath mgmtPath = new ManagementPath("MSCluster_Cluster");
ObjectGetOptions objGetOptions = new ObjectGetOptions();
ManagementClass mgmtClass = new ManagementClass(conn.GetConnectionScope, mgmtPath, objGetOptions);
ManagementBaseObject inParams = mgmtClass.GetMethodParameters("CreateCluster");
inParams["ClusterName"] = ClusterName;
inParams["NodeNames"] = NodeNames;
inParams["IPAddresses"] = ipaddresses;
inParams["SubnetMasks"] = subnetmasks;
ManagementBaseObject retVal = mgmtClass.InvokeMethod("CreateCluster", inParams, null);
}
在检查了 ManagementException 的 errorCode 的枚举类型后,它显示“失败”..我任何人都有任何解决方案,请分享它我被困了几天......