如何配置XenDesktop使用Mirror数据库
admin
2023-04-03 03:41:50
0

在XenDesktop的部署过程中如果是用SQL Mirror的方式我们建议用户在配置好Mirror之后在初始化XenDesktop站点配置,这样在Connection string中默认会包含mirror数据库连接。但是有时候难免会有用户出现先配置站点以后在配置mirror,这样就会让事情变的非常复杂,需要几十条命令重置所有service的connection string,稍有不慎可能导致环境挂掉。这里我整理了2段简单的脚本供大家使用。

注意事项

  1. 修改前务必对DDC和DB做快照
  2. 此脚本仅适用于7.15 LTSR, 不同的版本服务数量会有差异,请自行修改

具体步骤

  1. 我们首先需要将DDC中的connection string置空,您可以将一下内容保存为ps1文件到DDC上通过管理员权限执行
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DesktopServer\DataStore\Connections\Controller ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ADIdentitySchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Analytics\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\AppLibrarySchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ConfigLoggingSiteSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ConfigurationSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DAS\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DesktopUpdateManagerSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\EnvTestServiceSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\HostingUnitServiceSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Monitor\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\OrchestrationSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\StorefrontSchema\DataStore\Connections ConnectionString $null
    Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\TrustSchema\DataStore\Connections ConnectionString $null

  2. 重启DDC
  3. DDC上重置connection string, 服务器地址请自行修改,保存ps1文件DDC上通过Powershell执行

Asnp citrix*
$cs="Server=DB.ctx.com;Failover Partner=DB2.ctx.com;Initial Catalog=Citrixsite;Integrated Security=True"
$cslog="Server=DB.ctx.com;Failover Partner=DB2.ctx.com;Initial Catalog=CitrixLogging;Integrated Security=True"
$csmonitor="Server=DB.ctx.com;Failover Partner=DB2.ctx.com;Initial Catalog=CitrixMonitoring;Integrated Security=True"

Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DesktopServer\DataStore\Connections\Controller ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ADIdentitySchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Analytics\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\AppLibrarySchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ConfigLoggingSiteSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\ConfigurationSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DAS\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\DesktopUpdateManagerSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\EnvTestServiceSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\HostingUnitServiceSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\Monitor\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\OrchestrationSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\StorefrontSchema\DataStore\Connections ConnectionString $cs
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\XDservices\TrustSchema\DataStore\Connections ConnectionString $cs

Set-MonitorDBConnection -datastore Monitor -DBConnection $null
Set-MonitorDBConnection -datastore Monitor -DBConnection $csmonitor
Set-LogDBConnection -datastore Logging -DBConnection $null
Set-LogDBConnection -datastore Logging -DBConnection $cslog

  1. 重启DDC
  2. 如果DDC多台则需要分别修改

希望对大家有所帮助

相关内容

热门资讯

台湾演员赴陆偶遇“如花”高喊“... 据台媒TVBS,曾演出《破事精英第二季》的台湾演员萧子一,日前在中国大陆横店影视城巧遇景区知名NPC...
东盟“不选边”走到尽头? 第48届东盟峰会落幕,中东冲突外溢、美国关税施压、内部矛盾凸显,东盟陷入“经济要救生、安全走钢丝”的...
17岁高中生写作业至凌晨,外出... 5月11日,据青海大通县融媒体中心消息:大通县公安局表示,5月8日6时15分,大通县公安局桥头派出所...
天猫“国货严选”纯棉一次性内裤... 淘宝天猫国货严选旗舰店内一次性内裤宣称“纯棉”,“假一赔十”,实际收到商品为“100%聚酯纤维”。近...
字节砍掉30%的AI项目?背后... 来源:市场资讯 (来源:钛媒体APP) 5月9日,一则关于字节跳动AI战略的消息,在社交媒体上迅速发...
戴尔电脑频繁出现蓝屏死机、重启... IT之家 5 月 11 日消息,Windows 11 更新时常出故障并引发各类问题,其中最让用户恼火...
分享PD氮化镓快充哪个品牌款式... 现在不少小伙伴选氮化镓快充头,尤其是苹果用户,找来找去都会纠结:PD氮化镓快充哪个品牌款式多,苹果氮...
激光近视手术和ICL晶体植入哪... 很多想摘镜的朋友都会纠结:选激光手术,还是ICL晶体植入?到底哪种更安全、更适合自己?广州英华眼科蔡...
原创 天... 备受科技圈关注的联发科技 MTK 天玑开发者大会即将启幕,# 天玑开发者大会# 话题提前霸占数码热搜...
量子力学如何开辟了人类认识和改... 量子力学是 20 世纪最具颠覆性、最具奠基性的基础科学革命成果,与相对论共同构筑起现代物理学两大支柱...