赞
踩
相关网站介绍:Seata官网 、 Seata开发文档
本文介绍:本文章使用Seata的1.4.2版本,下载seata-server-1.4.2.zip、其他版本下载
# 注册 registry { # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa # 类型,使用nacos type = "nacos" loadBalance = "RandomLoadBalance" loadBalanceVirtualNodes = 10 # nacos配置 nacos { # 服务名称,服务启动后会显示在nacos的服务中心 application = "seata-server" # nacos地址 serverAddr = "127.0.0.1:7001" # 分组 group = "SEATA_GROUP" # 命名空间 namespace = "seata" # 用户名,如果nacos开启了授权验证则需要配置用户名 # username = "nacos" # 密码,如果nacos开启了授权验证则需要配置密码 # password = "nacos" } } # 配置文件 config { # 使用nacos管理配置文件 type = "nacos" nacos { # nacos地址 serverAddr = "127.0.0.1:7001" # 分组 group = "SEATA_GROUP" # 命名空间 namespace = "seata" # Nacos中的dataId dataId = "seataServer" # 用户名,如果nacos开启了授权验证则需要配置用户名 # username = "nacos" # 密码,如果nacos开启了授权验证则需要配置密码 # password = "nacos" } }
create database seata_config character set utf8; use seata_config; -- MySQL dump 10.13 Distrib 5.7.36, for Win64 (x86_64) -- -- Host: 127.0.0.1 Database: seata_config -- ------------------------------------------------------ -- Server version 5.7.37 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `branch_table` -- DROP TABLE IF EXISTS `branch_table`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `branch_table` ( `branch_id` bigint(20) NOT NULL, `xid` varchar(128) NOT NULL, `transaction_id` bigint(20) DEFAULT NULL, `resource_group_id` varchar(32) DEFAULT NULL, `resource_id` varchar(256) DEFAULT NULL, `branch_type` varchar(8) DEFAULT NULL, `status` tinyint(4) DEFAULT NULL, `client_id` varchar(64) DEFAULT NULL, `application_data` varchar(2000) DEFAULT NULL, `gmt_create` datetime(6) DEFAULT NULL, `gmt_modified` datetime(6) DEFAULT NULL, PRIMARY KEY (`branch_id`), KEY `idx_xid` (`xid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `branch_table` -- LOCK TABLES `branch_table` WRITE; /*!40000 ALTER TABLE `branch_table` DISABLE KEYS */; /*!40000 ALTER TABLE `branch_table` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `distributed_lock` -- DROP TABLE IF EXISTS `distributed_lock`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `distributed_lock` ( `lock_key` char(20) NOT NULL, `lock_value` varchar(20) NOT NULL, `expire` bigint(20) DEFAULT NULL, PRIMARY KEY (`lock_key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `distributed_lock` -- LOCK TABLES `distributed_lock` WRITE; /*!40000 ALTER TABLE `distributed_lock` DISABLE KEYS */; INSERT INTO `distributed_lock` VALUES ('HandleAllSession',' ',0); /*!40000 ALTER TABLE `distributed_lock` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `global_table` -- DROP TABLE IF EXISTS `global_table`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `global_table` ( `xid` varchar(128) NOT NULL, `transaction_id` bigint(20) DEFAULT NULL, `status` tinyint(4) NOT NULL, `application_id` varchar(32) DEFAULT NULL, `transaction_service_group` varchar(32) DEFAULT NULL, `transaction_name` varchar(128) DEFAULT NULL, `timeout` int(11) DEFAULT NULL, `begin_time` bigint(20) DEFAULT NULL, `application_data` varchar(2000) DEFAULT NULL, `gmt_create` datetime DEFAULT NULL, `gmt_modified` datetime DEFAULT NULL, PRIMARY KEY (`xid`), KEY `idx_status_gmt_modified` (`status`,`gmt_modified`), KEY `idx_transaction_id` (`transaction_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `global_table` -- LOCK TABLES `global_table` WRITE; /*!40000 ALTER TABLE `global_table` DISABLE KEYS */; /*!40000 ALTER TABLE `global_table` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `lock_table` -- DROP TABLE IF EXISTS `lock_table`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `lock_table` ( `row_key` varchar(128) NOT NULL, `xid` varchar(128) DEFAULT NULL, `transaction_id` bigint(20) DEFAULT NULL, `branch_id` bigint(20) NOT NULL, `resource_id` varchar(256) DEFAULT NULL, `table_name` varchar(32) DEFAULT NULL, `pk` varchar(36) DEFAULT NULL, `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:locked ,1:rollbacking', `gmt_create` datetime DEFAULT NULL, `gmt_modified` datetime DEFAULT NULL, PRIMARY KEY (`row_key`), KEY `idx_status` (`status`), KEY `idx_branch_id` (`branch_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `lock_table` -- LOCK TABLES `lock_table` WRITE; /*!40000 ALTER TABLE `lock_table` DISABLE KEYS */; /*!40000 ALTER TABLE `lock_table` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2022-03-18 15:34:49
问题1:双击之后直接闪退,可通过cmd命令启动seata-server.bat,这样就能看到具体错误信息。错误提示翻译后“Java HotSpot(TM)客户端VM警告:MaxNewSize(2097152k)等于或大于整个堆(2097152k)”。
解决问题1:修改seata-server.bat文件中的环境参数,修改为电脑所支持的大小。我修改为了512M。
启动成功后效果:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。