Setting Up Seata (pre‑1.0) for Distributed Transactions in Microservices

This guide explains what a distributed transaction is and walks through the complete setup of a Seata server (version 0.9.0), including downloading, configuring file.conf and registry.conf for Nacos, initializing the database, starting services, and creating the required undo_log table.

Coder Trainee
Coder Trainee
Coder Trainee
Setting Up Seata (pre‑1.0) for Distributed Transactions in Microservices

A distributed transaction involves participants, a transaction manager, and resource servers that reside on different nodes of a distributed system.

Seata middleware (version 0.9.0)

Seata provides a solution for coordinating such transactions. The following procedure sets up a Seata server for versions below 1.0.

Download Seata from the official site: https://seata.io/zh-cn/blog/download.html. The guide uses version 0.9.0; configuration differs for versions 1.0 and above.

Prepare configuration files : After extracting the package, back up file.conf and registry.conf located in the conf directory (e.g., E:\tools\seata\seata-server-0.9.0\conf). Edit file.conf to set the transaction group name, change the transaction log storage mode to db, and provide the database connection information.

Initialize the database : Create a database named seata and execute the SQL script db_store.sql found at E:\tools\seata\seata-server-0.9.0\conf\db_store.sql to create the required tables.

Configure the registry : Modify registry.conf to use Nacos as the registration center and point it to an existing Nacos server.

Start Nacos before launching the Seata server; otherwise the server cannot discover services.

Start the Seata server and verify that it appears in the Nacos console. Successful registration is shown in the console screenshot.

Create the undo‑log table in each business database. If the file db_undo_log.sql is missing, run the following SQL:

drop table `undo_log`;
CREATE TABLE `undo_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) NOT NULL,
  `xid` varchar(100) NOT NULL,
  `context` varchar(128) NOT NULL,
  `rollback_info` longblob NOT NULL,
  `log_status` int(11) NOT NULL,
  `log_created` datetime NOT NULL,
  `log_modified` datetime NOT NULL,
  `ext` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

After completing these steps, the Seata server is fully set up and ready for integration with business services.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

microservicesSQLNacosDistributed TransactionsTransaction ManagementSeata
Coder Trainee
Written by

Coder Trainee

Experienced in Java and Python, we share and learn together. For submissions or collaborations, DM us.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.