Este articulo pretende orientar sobre la implementación y mejoras del recurso MSDTC en un cluster (activo/activo) sobre Windows Server 2008.
La capa de virtualización en Failover Cluster para el Servicio Coordinador de transacciones distribuidas (MSDTC), en Windows Server 2008, admite la ejecución de múltiples recursos MSDTC activos al mismo tiempo. Esto mejora el rendimiento, dado que las aplicaciones en clúster puede tener ahora un recurso de clúster MSDTC que se encuentren en su mismo nodo, esto hace mitigar los problemas de rendimiento de una posible latencia. En lo que relaciona a SQL Server, podremos disponer por cada nodo un grupo destinado a MSDTC y otro para la instancia SQL, es lo recomendado para Windows Server 2008.
En anteriores arquitecturas, tales como Windows Server 2003/2000, solo era posible configurar, a nivel de todo el Cluster, un único recurso para MSDTC, esto penaliza el performance de los nodos donde no resida este recurso, con pequeñas latencias.
La funcionalidad de disponer en cada nodo del Cluster, un recurso dedicado para el servicio de transacciones distribuidas, cobra verdadero interés, cuando hablamos de Cluster Geográfico. Dada la lejanía de los nodos, el no disponer en el propio nodo el recurso MSDTC, las latencias son mayores. También cobra importancia cuando las aplicaciones (en nuestro caso SQL Server), hacen gran uso del MSDTC, para lo que sí se aprovecha el disponer del recurso en el mismo nodo del Cluster.
Si solo disponemos de un solo recurso a nivel del Cluster para el Servicio de MSDTC, cualquier caída o fallo de este, afecta a todas las instancias de SQL. Por el contrario, si dispones de un recurso de MSDTC por cada nodo, en caso de fallo, error, movimiento o reinicio, solo se vería afectada la instancia de SQL que reside en el mismo nodo
Una de las desventajas, si se decide optar, por configurar a nivel en Cluster con múltiples recursos del servicio MSDTC, (uno por cada nodo), es la necesidad de mas IP´s y discos dedicados por cada uno de los grupos de recursos.
De nombrar es que el DTC Local puede estar activo en todos los nodos del clúster, independientemente de cualquier otro recurso MSDTC que puedan existir en el Clsuter.
Pasos para crear MSDTC en Failover Cluster de Windows Server 2008 (Cindy Cross)
A continuación vamos a comentar los pasos para crear MSDTC en un clúster de Windows Serverb2008 con un DTC por cada SQL Server, el DTC estará en el grupo de SQL Server. La capacidad de utilizar múltiples DTC es nuevo en Windows 2008, para versiones anteriores de Windows estos pasos no funcionarán
En Windows 2008 ya no se puede hacer que MSDTC dependa del disco de quórum, por lo tanto la recomendación es que tenga su propio disco, aunque también pueda compartir disco con los de la aplicación (SQL Server, en nuestro caso). Para obtener el mejor rendimiento dedique un disco exclusivo para el servicio de MSDTC en Cluster.
Hay dos maneras de configurarlo:
Copio los pasos narrados por Cindy Cross, dentro de su articulo publicado en: How to configure DTC for SQL Server in a Windows 2008 cluster :
1. Conectando a la consola de administración del Cluster:
Start "Failover Cluster Management"
Connect Conectar con el clúster (haga clic sobre el grupo local de la izquierda o seleccione "Manage a Cluster" de la derecha e ingrese su nombre de clúster remoto)
2. Si está usando un firewall asegúrese de que tiene una excepción para MSDTC y/o las direcciones IP que dedicara a/los recurso/s MSDTC
3. MSDTC puede tener su propia IP y su propio nombre virtual, requiere de un disco no utilizado por SQL Server durante la instalación, pero puede ser un disco que luego serán utilizados por SQL Server. Podremos elegir el nombre del recurso MSDTC.
a) Create a new DTC resource
i. Look for a green arrow in the middle pane next to "Configure a Service or Application" and click on it to open the "High Availability Wizard"
ii. Choose "Next" to go to the "Select Service or Application" screen
iii. Choose "Distributed Transaction Coordinator (DTC)" then click "Next"
iv. You can either use the default name or create your own unique name for the "Client Access Point" then click "Next". You may want to name it something like DTC_YourSQLServerResourceName. For example: if your SQL instance's virtual name is SQL01, call your DTC resource something like DTC_SQL01 or MSDTC-SQL Server (SQL01).
v. Choose a disk that is not already used and will not be the disk you choose during SQL Server setup.
vi. Click "Next" twice.
b) Install SQL Server on at least one node.
c) Move DTC to the SQL Server group
i. Right click on the DTC resource and choose "More Actions" then "Move this resource to another service or application".
ii. Choose your SQL Server group in "Select A Service or Application".
iii. Right click on the DTC resource and choose "Properties". Go to the "Policies" tab and uncheck "if restart is unsuccessful, fail over all resources in this service or application" for the DTC resource unless you are sure you want a DTC failure to cause SQL Server to fail over. This is the same thing as "affect the group" in older versions of Windows.
iv. Optionally you can take DTC offline and make it dependent on the SQL Server name and disk. Then remove its dependencies on the original name and disk. Then you can optionally delete the original IP, name, and disk or move them out of the SQL Server group.
d) (Optional for SQL Server 2008) Map SQL Server to this DTC resource. If you skip this step SQL Server 2005 will use the default DTC. SQL Server 2005 will only use the DTC in the SQL Server group if that one is the default for the entire cluster or if you do the mapping step. SQL Server 2008 will use the DTC in its group unless that DTC is not online/started when SQL Server starts or if you create a mapping to a different DTC.
i. Open a dos prompt using "Run as Administrator".
ii. Modify the below statement with a mapping name (make up a name to id the mapping), service (the SQL Server service name - not the display name), and ClusterResourceName (DTC resource name) then run it
Example: Msdtc -tmMappingSet -name DTC_SQL01_Mapping -service “MSSQL$SQL01” -ClusterResourceName "MSDTC-SQL Server (SQL01)" <<-- Note the correction I made here on 3/21/09 to the service name for SQL, and the additional verification steps below
Do you want to continue with this operation? [y/n]
y
[enter]
iii. Run "msdtc -tmmappingview *" to verify the mapping was created successfully. The mapping is also stored in HKEY_LOCAL_MACHINEClusterMSDTCTMMappingService as a new key named the same as the mapping parameter used in the msdtc command.
iv. To verify SQL Server is mapped to the expected instance of DTC you can either
Shut down all the other DTC services and make sure the mapped DTC is online. Verify you can do a BEGIN DISTRIBUTED TRANSACTION from this SQL Server.
Do a BEGIN DISTRIBUTED TRANSACTION from this SQL Server, verify it succeeds and roll it back. Then shut down the mapped DTC and verify a new BEGIN DISTRIBUTED TRANSACTION will work.
e) Enable network access
i. Run DcomCnfg
ii. Navigate to Computers.Component Services.My Computer.Distributed Transaction Coordinator.Clustered DTCs
iii. Right click on the DTC service for this SQL Server group and select "Properties".
iv. Go to the security tab and check "Network DTC Access", "Allow Inbound", and "Allow Outbound".
v. When you hit "Apply" or "OK" it will restart the DTC resource.
This is Option 2 from the blog mentioned at the end of this thread – Pros/Cons include:
DTC will depend on the SQL Server resource name and IP
SQL must be installed first
You have no choice on the DTC resource name
Fewer overall steps
a) Install SQL Server on at least one node.
b) Add DTC
i. Right click on your SQL Server group under "Services and Applications" and choose "Add a resource" then "More resources" then "2 - Add Distributed Transaction Coordinator".
ii. Right click on the new (offline) DTC resource and choose "Properties". Note that the DTC resource name is MSDTC-SQL Server (YourInstanceName) and it cannot be changed.
iii. Go to the "Dependencies" tab make DTC dependent on a disk in the SQL Server group. If DTC is not heavily used you can choose a disk already used for SQL Server, but this could have a performance impact.
iv. Go to the "Dependencies" tab make DTC dependent on the SQL Server name.
v. Go to the "Policies" tab and uncheck "if restart is unsuccessful, fail over all resources in this service or application" for the DTC resource unless you are sure you want a DTC failure to cause SQL Server to fail over.
vi. Bring DTC online.
c) (Optional for SQL Server 2008) Map SQL Server and this DTC resource. If you skip this step SQL Server 2005 will use the default DTC. SQL Server 2005 will only use the DTC in the SQL Server group if that one is the default or if you do the mapping step. SQL Server 2008 will use the DTC in its group unless that DTC is not online/started when SQL Server starts or if you create a mapping to a different DTC.
i. Open a dos prompt using "Run as Administrator".
ii. Modify the below statement with a mapping name (make up a name to id the mapping), service (the SQL Server service name - not the display name), and ClusterResourceName (DTC resource name) then run it
Example: Msdtc -tmMappingSet -name DTC_SQL01_Mapping -service “MSSQL$SQL01” -ClusterResourceName "MSDTC-SQL Server (SQL01)" <<-- Note the correction I made here on 3/21/09 to the service name for SQL, and the additional verification steps below
Do you want to continue with this operation? [y/n]
y
[enter]
iii. Run "msdtc -tmmappingview *" to verify the mapping was created successfully. The mapping is also stored in HKEY_LOCAL_MACHINEClusterMSDTCTMMappingService as a new key named the same as the mapping parameter used in the msdtc command.
iv. To verify SQL Server is mapped to the expected instance of DTC you can either
Shut down all the other DTC services and make sure the mapped DTC is online. Verify you can do a BEGIN DISTRIBUTED TRANSACTION from this SQL Server.
Do a BEGIN DISTRIBUTED TRANSACTION from this SQL Server, verify it succeeds and roll it back. Then shut down the mapped DTC and verify a new BEGIN DISTRIBUTED TRANSACTION will work.
d) Enable network access
i. Run DcomCnfg
ii. Navigate to Computers.Component Services.My Computer.Distributed Transaction Coordinator.Clustered DTCs
iii. Right click on the DTC service for this SQL Server group and select "Properties".
iv. Go to the security tab and check "Network DTC Access", "Allow Inbound", and "Allow Outbound".
v. When you hit "Apply" or "OK" it will restart the DTC resource.
Hints:
Repeat the above steps for any additional SQL Server instances you install.
If you use DTC heavily you should consider putting it on its own disk for optimal performance. Otherwise you can associate it with your least used SQL Server disk.
Do NOT make SQL Server dependent on the DTC resource.
Do NOT check "if restart is unsuccessful, fail over all resources in this service or application" for the DTC resource unless you are sure you want a DTC failure to cause SQL Server to fail over.
Fuentes:
Microsoft, msdn, Cindy Cross
Apunte y recopilación por Norman M. Pardell
Puedes consultarme, si deseas cualquier aclaración, pregunta o sugerencia en: Contacto, contestaré tan pronto como me sea posible.