31 Ocak 2012 Salı

Advanced Concepts - XenApp Farm Maintenance

Moving DataStore to another Access or SQL Database : (XA)

Backup and Recovery Strategies
This section discusses methods for Backing Up and Recovering the XenApp Farm Data Store.
Access Data Store
While there is no built-in backup scheduler with Access, Presentation Server includes the DSMAINT BACKUP command for backing up Access Data Stores only. Citrix recommends that this command be executed daily using a scheduler script.
WARNING!
Do not attempt to backup Microsoft SQL Server or Oracle databases using this command.
Moving / Restoring an Access Database
Access to a valid backup or Copy of the Data Store is assumed before the following procedure is started.
Moving an Access Database
To move an Access database, complete the following procedure:
  1. Copy the Data Store file named “MF20.mdb” in the %system%\Program Files\Citrix\Independent Management Architecture\ folder from the source server to the target server, which will be the new Data Store host.
  2. On the new host server, create a new File DSN by using the Microsoft ODBC manager pointing to the Data Store, as shown in the following screen shots:
  1. Close the ODBC manager because you have created the required DSN file.
    The next task requires you to edit the registry settings.
    Caution
    ! This fix requires you to edit the registry. Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.
  2. Run the Registry Editor and change the value of the following registry key from <blank> to ImaAccess.dll
    HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\DatabaseDriver
  3. Open a command prompt and run the following command to configure IMA and use the new DSN file.
    dsmaint config
  4. is a sample for your reference:
    dsmaint config
    /user:citrix /pwd:citrix /dsn:<full path to the newly created DSN file from Step 2>
    .
    Note: You can drag and drop the DSN file into the command prompt to avoid typing the wrong path.
  1. Run the following command from the command prompt to stop the IMA Service and recreate the Local Host:
    dsmaint recreatelhc
  2. On all the remaining servers in the farm, run the following command, where <DirectServername> is the name of the new host server.
    dsmaint failover <DirectServername>
Restoring an Access Database
It is assumed that the following tasks are completed before starting the procedure to restore an Access database:
  • You have rebuilt or reinstalled XenApp to recover from a failure.
• You have a working XenApp server up and running with IMA started.
• You have access to a backup copy of the old Access Data Base (MF20.mdb) created by the DSMAINT BACKUP command or some other method.
To restore an Access database, complete the following procedure:
  1. Stop the IMA Service and copy the existing MF20.mdb file to a safe location.
    Note: You will be replacing this file with your backup MF20.mdb.
  2. Copy the Data Store file named “MF20.mdb” from the backup source to the target server and save it in the %system%\Program Files\Citrix\Independent Management Architecture\ folder.
    Note
    : The IMA Service must be stopped before starting the next task.
  3. Open a command prompt and run the dsmaint config command to configure IMA and use the existing MF20.dsn file.
    Following is a sample of the preceding command:
    dsmaint config /user:citrix /pwd:citrix /dsn:<full path to the .dsn file >.
Note: You can drag and drop the DSN file into the command prompt to avoid typing the wrong path.
  1. Run the following command from the command prompt to recreate the Local Host cache and any other servers in the farm so they are aware of the new information:
    dsmaint recreatelhc

    Note:
    Do not forget to stop IMA before you run the preceding command.
Microsoft SQL Desk Top Engine (MSDE)
This procedure is similar to the previous section. Refer to the respective Administrators Guide for the version of XenApp you are using.
To back up and restore Microsoft SQL Desk Top Engine (MSDE), complete the following tasks:
  1. Run the DSMAINT BACKUP command to back up the MSDE Data Store.
    Typing DSMAINT BACKUP /? From the command prompt provides the expected syntax parameters.
  2. Specify the complete path to the backup location of the Data Store backup files. Essentially, this command uses a default OSQL script to back up the database.
    Note
    : It is possible to create customized OSQL scripts for backups. However, this option is suggested only for experienced users and DBA's. The following Microsoft article provides details regarding this topic: How to back up a Microsoft Data Engine database by using Transact-SQL.
  3. To restore an MSDE Data Store, run the following command, DSMAINT RECOVER.
    Caution
    : Do not try to recover the Data Store with the Dsmaint Recover command without verifying that the Mf20.bak file exists because this command removes the existing Mf20.mdb file from the server. If the Mf20.bak file does not exist, run DSMAINT BACKUP again.
  4. To move an MSDE Database from one server to another, refer to the Knowledge Center article, CTX104941 - How to Move a Microsoft SQL Server Desktop Engine Data Store From One Server to Another.
SQL 2005 Express Edition with Service Pack 1 Data Store
In SQL 2005 Express Edition, you now have the ability to schedule backups and manage restores by using the SQL 2005 Express Management Studio tool.
Complete the following tasks to schedule backups and manage restores:
  1. Download and install the prerequisite from Microsoft Core XML Services (MSXML) 6.0 page.
  2. Download and install the package, Visual Studio Express, which includes a required Microsoft XML Parser, to update the XML services.
  3. Download and install SQL Server Management Studio Express. It provides tools that enable you to manage SQL Server Express, which are not included with the standard installation.
Microsoft SQL Server and Oracle Data Store
When using a Microsoft SQL Server or Oracle, consult the Data Base Server product documentation for scheduling automated backups of the Data Store. In most cases, daily backup is sufficient to prevent loss of farm data.
In a situation where a Citrix Data Store must be restored to another Data Base Server because the original is no longer available or has experienced a catastrophic failure, the most effective method is to use a Full Backup of the Data Store and Restore it to the new Data Base Server (SQL or Oracle). Additionally each XenApp server requires the ODBC DSN file be reconfigured or recreated and the IMA service must be reconfigured to use the new DSN file. The reconfiguration process of IMA creates updated registry information needed by the XenApp servers to connect to the new Data Base Server.
Important: Because this scenario assumes the Citrix Data Store is unavailable, the following procedure must be performed all within the same change window and it is strongly recommended that NO administrative changes be attempted until the Data Base is back on line on a new Data Base Server. Attempting changes causes writing to the Data Base resulting in failures because the Data Base is not yet accessible.  
  1. On the Destination Data Base Server, restore the most recent available Data Base backup.
  2. On a XenApp Server (Preferably a Zone Data Collector), create a new, or modify the existing, DSN file to point to the new Data Base Server. Refer to the Microsoft ODBC Manager documentation for information about how to create a DSN file or consult the Database Administrator for assistance.
  3. Once the DSN file has been created and Tested using MS ODBC manager, you must reconfigure the IMA service using the Dsmaint Config command.
    1. Run the command, Dsmaint Config /? From the command prompt for exact syntax requirements.
      The sample of the preceding command, is shown in the following screen shot:
      Note
      : You can drag and drop the DSN file into the command prompt to avoid typing the wrong path.
    2. Run the following command to stop the IMA Service and recreate the Local Host Cache :
      Dsmaint recreatelhc
  1. Start the IMA Service.
    Note: Once the IMA Service is started successfully, if you would like to verify the new settings, you can verify it by checking the following registry settings: HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\DataSourceName
  2. Copy the DSN file created in Step 3 to all servers in the farm and repeat steps 3a through 5.
Cycle Booting Presentation Servers
When the IMA Service starts after restarting the server, it establishes a connection to the data store and performs various reads to update the local host cache. These reads can vary from a few hundred kilobytes of data to several megabytes of data, depending on the size and configuration of the farm.
To reduce the load on the data store and to reduce the IMA Service start time, Citrix recommends maintaining cycle boot groups of no more than 100 servers. In large farms with hundreds of servers, or when the database hardware is not sufficient, restart servers in groups of approximately 50, with at least a 10 minute interval between groups.
Note: If the Service Control Manager reports that the IMA Service could not be started during a cycle boot of a Presentation Server but the service eventually starts, ignore this message. The Service Control Manager has a time-out of six minutes. The IMA Service can take longer than six minutes to start because the load on the database exceeds the capabilities of the database hardware. To eliminate this message, try rebooting fewer servers at one time.
Changing Farm Membership of Servers
Presentation servers require the use of the chfarm command to change farm membership. For detailed use of the chfarm command, refer to CTX736659 - How to Change Farms Using the Chfarm Utility
Note:
Additional Information:
Background information on the chfarm command
Running the chfarm command performs the following actions on the host server:
• Attempts to remove the server from the farm.
• Stops the IMA Service.
• Evokes the IMA configuration wizard of the Presentation Server installation program. This wizard gathers the following farm configuration information:
    Create a "New Server Farm" or "Join an Existing Farm":
    o To "Create a New Server Farm", the Data Store Configuration page presents options for the Data Store.
    o To "Join an Existing Farm" the Data Store Type page presents options for direct or indirect connection to the Data Store.
    o When creating a "New Server Farm", you must enter a "New Farm Name". When "Joining an Existing Farm" you must enter the information necessary to connect to the existing Farm Data Store.
    o The wizard asks for the name of the zone in which to place this server. If left at "Default" the server will be added to a new zone which will be named after the server’s subnet IP Address.
    o On the final Screen of the wizard a "grayed out" field with the Farm name is displayed.
      Important: When "Joining an Existing Farm" if the Farm Name is not displayed in this "grayed out" field on the last screen. Do not proceed. The credentials you entered for IMA to connect to the Data Store are invalid. Go back and confirm if the user account and password are correct.
• The IMA Service is started and the new information is written to the registry in the HKLM\Software\Citrix\IMA and HKLM\Software\Citrix\IMA\Runtime.
• Ensure there are no users logged on before executing the chfarm process.
Important notes regarding access data stores
• Because chfarm deletes the Access Data Store database on the server hosting the Access database. Do not run chfarm on this server until all other servers in that farm are moved to a new farm. Failure to follow this process causes errors when attempting to execute chfarm on those servers that no longer have a valid data store.
• Use chfarm on a member server that will host the new data store first. Then run chfarm on all other servers to join them to the newly created farm.
• Close all connections to the Access Management Console and the Presentation Server Console on the local server before executing the chfarm command.
Note
: Using chfarm command does not migrate the published applications or any server settings to the new server farm.

Hiç yorum yok:

Yorum Gönder