본문 바로가기

가상화/Citrix

[Citrix] 데이터베이스 마이그레이션

반응형

개요

Virtual Apps and Desktops 7 솔루션의 데이터베이스 마이그레이션 절차에 대해 살펴보도록 하자

구성환경

Virual Apps and Desktops 7 1808.2

 

데이터베이스 마이그레이션 절차

현재 데이터베이스 연결정보

PS C:\Program Files\Citrix\Desktop Studio> Get-BrokerDBConnection
 Server=CXSVR\SQLEXPRESS; Initial Catalog=CitrixhoyaSite; Integrated Security=True
PS C:\Program Files\Citrix\Desktop Studio>

 

1. 모든 컨트롤러의 데이터베이스(CitrixSite, CitrixMonitoring, CitrixLogging)및 스냅샷  백업

2. 첫번째 컨트롤러에서만 데이터베이스 연결 해제

Set-LogSite -State "Disabled"
Set-MonitorConfiguration -DataCollectionEnabled $False
Set-MonitorDBConnection -DataStore Monitor -DBConnection $null -AdminAddress $Localhost
Set-LogDBConnection -Datastore Logging -DBConnection $null -AdminAddress $Localhost

3. 다른 모든 컨트롤러에서 데이터 스토어 구성을 재설정합니다 (위의 지워진 설정을 읽습니다).

Reset-MonitorDataStore –DataStore Monitor –AdminAddress $Localhost
Reset-LogDataStore –DataStore Logging –AdminAddress $Localhost

4. 모든 컨트롤러에서 데이터베이스에서 모든 서비스의 연결을 끊어야합니다. 여기서 순서는 중요합니다. 마지막 두 cmdlet(Set-LogDBConnection, Set-AdminDBConnection)은 끝에 위치해야 합니다.

Set-AppLibDBConnection -DBConnection $null -AdminAddress $Localhost     (For 7.15)
Set-OrchDBConnection -DBConnection $null -AdminAddress $Localhost         (For 7.15)
Set-TrustDBConnection -DBConnection $null -AdminAddress $Localhost         (For 7.15

* (For 7.15) = XentDesktop 7.15

Set-SfDBConnection -DBConnection $null -AdminAddress $Localhost
Set-EnvTestDBConnection -DBConnection $null -AdminAddress $Localhost
Set-MonitorDBConnection -DBConnection $null -AdminAddress $Localhost
Set-BrokerDBConnection -DBConnection $null -AdminAddress $Localhost
Set-ProvDBConnection -DBConnection $null -AdminAddress $Localhost
Set-HypDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AcctDBConnection -DBConnection $null -AdminAddress $Localhost
Set-ConfigDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AnalyticsDBConnection -DBConnection $null  -AdminAddress $Localhost
Set-LogDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AdminDBConnection –Force -DBConnection $null -AdminAddress $Localhost

5. 백업 받은 데이터베이스를 마이그레이션 타겟 서버로 복원

6. 모든 서비스를 데이터베이스에 다시 연결

 6.1 연결 데이터베이스 환경 설정

syntax)

$csSite =” Server=<ListenerName>; Initial Catalog=<DBName>; Integrated Security=True; <타겟 데이터베이스 타입>
$csMonitor =” Server=<ListenerName>; Initial Catalog=<Monitor_DBName>; Integrated Security=True; <타겟 데이터베이스 타입>
$csLog =” Server=<ListenerName>; Initial Catalog=<Log_DBName>; Integrated Security=True; <타겟 데이터베이스 타입>

 - <ListenerName> : 타겟 데이터베이스 이름 , 예) ServerName\InstanceName (명명된 데이터베이스일 경우)

 - <타겟 데이터베이스 타입> : 마이그레이션 타겟 데이터베이스 타입에 따라 아래와 같이 기술

  •   Standalone SQL Server  Connection String : None
  •   Database Mirroring Connection String : Failover Partner=SecondSQLServer
  •   Always on High Availability : MultiSubnetFailover=True
$csSite =” Server=RDS; Initial Catalog=CitrixhoyaSite; Integrated Security=True”
$csMonitor =” Server=RDS; Initial Catalog=CitrixhoyaMonitoring; Integrated Security=True”
$csLog =” Server=RDS; Initial Catalog=CitrixhoyaLogging; Integrated Security=True”

 6.2 데이터베이스 연결

Set-AdminDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-LogDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-AnalyticsDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-ConfigDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-AcctDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-HypDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-ProvDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-BrokerDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-MonitorDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-EnvTestDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-SfDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-AppLibDBConnection -DBConnection $csSite -AdminAddress $Localhost     (For 7.15)
Set-OrchDBConnection -DBConnection $csSite -AdminAddress $Localhost         (For 7.15)
Set-TrustDBConnection -DBConnection $csSite -AdminAddress $Localhost         (For 7.15)

* (For 7.15) = XentDesktop 7.15

7. 하나의 컨트롤러에서만 데이터 스토어 연결을 설정하고 활성화하십시오.

Set-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitor -AdminAddress $Localhost
Set-LogDBConnection -Datastore Logging -DBConnection $csLog -AdminAddress $Localhost
Set-LogSite -State "Enable"
Set-MonitorConfiguration -DataCollectionEnabled $True

8. 그리고 다른 모든 Controller에서 데이터 저장소 구성을 재설정하십시오.

Reset-MonitorDataStore –DataStore Monitor –AdminAddress $Localhost
Reset-LogDataStore –DataStore Logging –AdminAddress $Localhost

 

트러벌슈팅) 데이터베이스 연결 오류

오류 메시지 1) PowerShell 에서 데이터베이스 연결시 오류 메시지

PS C:\Program Files\Citrix\Desktop Studio> Set-LogDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-LogDBConnection : There was a problem communicating with the Citrix Delegated Administration Service.
위치 줄:1 문자:1
+ Set-LogDBConnection -DBConnection $csSite -AdminAddress $Localhost
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-LogDBConnection], UnauthorizedAccessException
    + FullyQualifiedErrorId : Citrix.XDPowerShell.Status.AuthorizationError,Citrix.ConfigurationLogging.Sdk.DataStore.
   Commands.SetLogDBConnectionCommand

PS C:\Program Files\Citrix\Desktop Studio>

[그림] 오류 메시지 1

 오류 메시지 2) 대상 데이터베이스의 접속 오류 메시지

[그림] 데이터베이스 접속 오류

원인

컨트롤러서버는 대상 데이터베이스에 접속시 컴퓨터 계정을 이용하여 접속을 시도하는데, 대상 데이터베이스에 컨트롤러 컴퓨터 계정에 대한 로그인 정보가 없을 경우 발생

조치

대상 서버에 로그인 사용자 생성 및 권한 부여

1. 컴퓨터 계정 그룹 추가

 예) Domain Admins 그룹에 CXSVR 컴퓨터 계정을 구성원으로 추가

2. 추가된 그룹을 이용하여 로그인 사용자 추가 및 역할 부여

 

 

샘플 예제)

PS C:\Users\administrator.HOYA> asnp citrix.*
PS C:\Program Files\Citrix\Desktop Studio> Get-BrokerDBConnection
 Server=CXSVR\SQLEXPRESS; Initial Catalog=CitrixhoyaSite; Integrated Security=True 
PS C:\Program Files\Citrix\Desktop Studio> Set-LogSite -State "Disabled"
PS C:\Program Files\Citrix\Desktop Studio> Set-MonitorConfiguration -DataCollectionEnabled $False
PS C:\Program Files\Citrix\Desktop Studio> Set-MonitorDBConnection -DataStore Monitor -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-LogDBConnection -Datastore Logging -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Reset-MonitorDataStore -DataStore Monitor -AdminAddress $Localhost
DBUnconfigured
PS C:\Program Files\Citrix\Desktop Studio> Reset-LogDataStore -DataStore Logging -AdminAddress $Localhost
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-AppLibDBConnection -DBConnection $null -AdminAddress $Localhost 

 ServiceStatus ExtraInfo 
 ------------- --------- 
DBUnconfigured 

PS C:\Program Files\Citrix\Desktop Studio> Set-OrchDBConnection -DBConnection $null -AdminAddress $Localhost 

 ServiceStatus ExtraInfo 
 ------------- --------- 
DBUnconfigured 

PS C:\Program Files\Citrix\Desktop Studio> Set-TrustDBConnection -DBConnection $null -AdminAddress $Localhost 

 ServiceStatus ExtraInfo 
 ------------- --------- 
DBUnconfigured 

PS C:\Program Files\Citrix\Desktop Studio> Set-SfDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-EnvTestDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-MonitorDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-BrokerDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured {}

PS C:\Program Files\Citrix\Desktop Studio> Set-ProvDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-HypDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-AcctDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-ConfigDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-AnalyticsDBConnection -DBConnection $null  -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-LogDBConnection -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> Set-AdminDBConnection -Force -DBConnection $null -AdminAddress $Localhost

 ServiceStatus ExtraInfo
 ------------- ---------
DBUnconfigured

PS C:\Program Files\Citrix\Desktop Studio> $csSite =" Server=RDS; Initial Catalog=CitrixhoyaSite; Integrated Security=True"
PS C:\Program Files\Citrix\Desktop Studio> $csMonitor =" Server=RDS; Initial Catalog=CitrixhoyaMonitoring; Integrated Security=True"
PS C:\Program Files\Citrix\Desktop Studio> $csLog =" Server=RDS; Initial Catalog=CitrixhoyaLogging; Integrated Security=True"
PS C:\Program Files\Citrix\Desktop Studio> Set-AdminDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-LogDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-AnalyticsDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-ConfigDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-AcctDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-HypDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-ProvDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-BrokerDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-MonitorDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-EnvTestDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-SfDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-AppLibDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-OrchDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-TrustDBConnection -DBConnection $csSite -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitor -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-LogDBConnection -Datastore Logging -DBConnection $csLog -AdminAddress $Localhost

ServiceStatus ExtraInfo
------------- ---------
           OK {}

PS C:\Program Files\Citrix\Desktop Studio> Set-LogSite -State "Enable"
PS C:\Program Files\Citrix\Desktop Studio> Set-MonitorConfiguration -DataCollectionEnabled $True
PS C:\Program Files\Citrix\Desktop Studio> Reset-MonitorDataStore -DataStore Monitor -AdminAddress $Localhost
OK
PS C:\Program Files\Citrix\Desktop Studio> Reset-LogDataStore -DataStore Logging -AdminAddress $Localhost
OK
PS C:\Program Files\Citrix\Desktop Studio>
반응형