简体   繁体   English

Powershell命令更新Windows Server故障转移群集中的群集IP资源的名称

[英]Powershell command to update name of a Cluster IP Resource in Windows Server Failover Clustering

Hopefully this one is easy- 希望这很容易-

I am scripting a method to update clustered Windows servers in the event of an IP change. 我正在编写一种在IP发生更改时更新群集Windows服务器的方法的脚本。 I am nearly done, but for display and monitoring purposes, I would like to standardize the name of the "Cluster IP Address" resources. 我差不多完成了,但是出于显示和监视的目的,我想对“群集IP地址”资源的名称进行标准化。 By default the first IP resource is named "Cluster IP Address" and each additional IP is called "Cluster IP Address ". 默认情况下,第一个IP资源被称为“群集IP地址”,每个其他IP被称为“群集IP地址”。 When I update an IP, the name will still have the old IP in the name. 当我更新IP时,名称中仍会包含旧IP。 I can change this through the Failover Cluster Manager GUI, but I would like to change this using Powershell and it is not documented as a configurable parameter in Microsoft documentation. 我可以通过故障转移群集管理器GUI进行更改,但我想使用Powershell进行更改,并且Microsoft文档中未将其记录为可配置参数。

This will be on systems running Windows Server 2012 and above. 这将在运行Windows Server 2012及更高版本的系统上。 I will have at most two Cluster IP Address resources per deployment. 每个部署最多有两个群集IP地址资源。 This is used for SQL Availability Groups. 这用于SQL可用性组。 I have attempted updating the cluster registry keys tied to the resource name and changing ClusterObject.Name, which is not configurable. 我试图更新绑定到资源名称的群集注册表项并更改ClusterObject.Name,这是不可配置的。

To check the resource names, run the following. 要检查资源名称,请运行以下命令。 In my case there are two- "Cluster IP Address" and "Cluster IP Address (Original 2nd IP)". 在我的情况下,有两个“群集IP地址”和“群集IP地址(原始第二个IP)”。

Get-ClusterResource

Then update the second Cluster IP Address 然后更新第二个群集IP地址

Get-ClusterResource -Name "Cluster IP Address <Original 2nd IP>" | Set-ClusterParameter -Multiple @{"Address"="<New 2nd IP>";"Network"="Cluster Network 2"}

After this, the IP will change successfully, but running Get-ClusterResource will still return "Cluster IP Address (Original 2nd IP)" as the name of the second Cluster IP Address resource because we changed the IP and not the name. 此后,IP将成功更改,但是运行Get-ClusterResource仍将返回“群集IP地址(原始第二IP)”作为第二个群集IP地址资源的名称,因为我们更改了IP而不是名称。 The name is not a parameter that can be changed with Set-ClusterParameter. 名称不是可以使用Set-ClusterParameter更改的参数。

tl;dr: I am looking for a Powershell command to change the name of a Cluster IP Address resource. tl; dr:我正在寻找一个Powershell命令来更改群集IP地址资源的名称。

Ok, it was actually way more simple than I thought. 好吧,实际上这比我想的要简单得多。 It isn't a parameter. 这不是参数。

(Get-ClusterResource -Name "Cluster IP Address <Original 2nd IP>").Name = "Cluster IP Address <New 2nd IP>"

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

相关问题 使用 PowerShell 创建 Windows 故障转移集群报错 - Creating a Windows failover cluster using PowerShell reported an error 在 azure vm 上配置 MSMQ 集群故障转移(windows server 2016) - configure MSMQ cluster failover on an azure vm (windows server 2016) Powershell命令确定远程Windows Server上群集共享卷的可用空间 - Powershell Command to determine the Free Space of a Cluster Shared Volumes on a Remote Windows Server Windows 故障转移集群 API 仍然有效吗? - Windows Failover Cluster API still Valid? 如何在Windows Server上进行故障转移 - how to do failover on windows server SQL Server故障转移群集 - 确定活动节点 - SQL Server failover cluster - determine active node 使用 Powershell 创建 Windows 集群 - Creating Windows Cluster with Powershell 连接到故障转移群集所有者节点并运行PowerShell脚本 - Connect to failover cluster owner node and run PowerShell script 如何为快速应用程序群集(RAC)oracle群集和Windows Server 2008提供单个IP? - How to have a single IP for Rapid Application Cluster (RAC) oracle cluster and WIndows Server 2008? 如何在Windows故障转移群集管理器2012中启用“持久模式”? - How to enable “persistent mode” in Windows failover cluster manager 2012?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM