Distributed Transactions
Scenarios
The participator, transaction-supported server, resource server, and transaction manager of a distributed transaction are deployed on different nodes in a distributed system. Operations contained in a transaction are considered as a logical unit, and they either succeed completely, or fail completely. Distributed transactions are used to ensure data consistency among different databases.
The Microsoft Distributed Transaction Coordinator (MSDTC) service is a component of modern versions of Microsoft Windows that is responsible for coordinating transactions that span multiple resource managers. To use distributed transactions on databases, you must enable MSDTC on each participating server. MSDTC has been enabled when you enable distributed transactions on RDS for SQL Server databases. To enable MSDTC on remote servers, see Configuring MSDTC on a Remote Server.
For more information, see MS DTC Distributed Transactions.
Constraints
- Distributed transactions are enabled for newly created DB instances by default.
- Read replicas do not support distributed transactions.
- Once enabled, distributed transactions cannot be disabled.
- Enabling distributed transactions will cause DB instance to reboot. Exercise caution when you perform this operation.
- After a database link is created for an RDS for SQL Server DB instance, if a primary/standby switchover or failover occurs, the database link will not be automatically synchronized to the new primary DB instance. You need to create a database link on the new primary DB instance again.
Enabling Distributed Transactions
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the DB instance name.
- In the navigation pane on the left, choose Distributed Transactions. On the displayed page, click in the Distributed Transaction field.
Adding Hosts
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the DB instance name.
- In the navigation pane on the left, choose Distributed Transactions. On the displayed page, click Add Host.
- In the displayed dialog box, enter host names and IP addresses, and click Test Connection. After all host connection tests are successful, click OK.
- Host IP name: Enter the names of the hosts for which you want to create distributed transactions with the RDS DB instance. Each host name must be unique and contains 1 to 64 characters, including only letters, digits, and hyphens (-).
- Host IP address: Enter the IP addresses of the hosts for which you want to create distributed transactions with the RDS DB instance. You need to configure the inbound and outbound rules in the security group for the host IP addresses first.
For details about the requirements of security group rules, see the Adding a Security Group Rule section in the Virtual Private Cloud User Guide.
- If the hosts to be added are ECSs that are in the same VPC as your RDS DB instance, enter the private IP address of the ECS. You can obtain the ECS's private IP address on the ECS details page.
- If the hosts to be added are ECSs that are in different VPCs from the RDS DB instance, enter the public IP addresses of the ECSs. You need to bind an EIP to the RDS DB instance by referring to Binding and Unbinding an EIP.
Figure 1 Adding a host
Resolving Names on Remote Servers (ECSs)
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- In the navigation pane on the left, choose Distributed Transactions. On the displayed page, obtain information about the RDS DB instance.
- Add the RDS DB instance information to the hosts file in C:\Windows\System32\drivers\etc\hosts.
Configuring MSDTC on a Remote Server
- Click Start and choose Control Panel > Administrative Tools > Component Services.
- Expand the nodes in the Console pane Choose Computers > My Computer > Distributed Transaction Coordinator.
- Right-click Local DTC and choose Properties.
- In the displayed dialog box, click the Security tab. Configure information as required as shown in Figure 2 and click OK.
Deleting Hosts
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the DB instance name.
- In the navigation pane on the left, choose Distributed Transactions. In the host list, locate the host to be deleted and click Delete in the Operation column.
Alternatively, select one or more hosts to be deleted and click Delete above the list to delete hosts in batches.
- In the displayed dialog box, click Yes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot