廊坊市做网站app开发定制外包24

当前位置: 首页 > news >正文

廊坊市做网站,app开发定制外包24,域名解析到网站需要怎么做,如何建一个微信公众号下载安装包 链接: seata
配置seata-server 文件上传Linux解压 压缩包我放在/usr/local/seata中 tar -zxvf seata-server-2.0.0.tar.gz修改配置文件 设置nacos为注册和配置中心 进入文件夹 cd /usr/local/seata/seata/conf修改application.yml文件 …… …… cons…下载安装包 链接: seata
配置seata-server 文件上传Linux解压 压缩包我放在/usr/local/seata中 tar -zxvf seata-server-2.0.0.tar.gz修改配置文件 设置nacos为注册和配置中心 进入文件夹 cd /usr/local/seata/seata/conf修改application.yml文件 …… …… console:user:username: seatapassword: seata seata:config:# support: nacos, consul, apollo, zk, etcd3type: nacosnacos:server-addr: ip:8848group: DEFAULT_GROUPnamespace: 32e627d0-0b4xxxxxxxdataId: seataServer.propertiesusername: nacospassword: nacosregistry:# support: nacos, eureka, redis, zk, consul, etcd3, sofatype: nacospreferred-networks: xx.xx.*nacos:application: seata-serverserver-addr: ip:8848group: DEFAULT_GROUPnamespace: 32e627d0-0b4xxxxxxxusername: nacospassword: nacos …… ……将seata配置文件上传到nacos 在nacos新建配置文件seataServer.properties
官方供参考的配置文件: config.txt 以下为我修改后的配置文件 #For details about configuration items, see https://seata.io/zh-cn/docs/user/configurations.html #Transport configuration, for client and server transport.typeTCP transport.serverNIO transport.heartbeattrue transport.enableTmClientBatchSendRequestfalse transport.enableRmClientBatchSendRequesttrue transport.enableTcServerBatchSendResponsefalse transport.rpcRmRequestTimeout30000 transport.rpcTmRequestTimeout30000 transport.rpcTcRequestTimeout30000 transport.threadFactory.bossThreadPrefixNettyBoss transport.threadFactory.workerThreadPrefixNettyServerNIOWorker transport.threadFactory.serverExecutorThreadPrefixNettyServerBizHandler transport.threadFactory.shareBossWorkerfalse transport.threadFactory.clientSelectorThreadPrefixNettyClientSelector transport.threadFactory.clientSelectorThreadSize1 transport.threadFactory.clientWorkerThreadPrefixNettyClientWorkerThread transport.threadFactory.bossThreadSize1 transport.threadFactory.workerThreadSizedefault transport.shutdown.wait3 transport.serializationseata transport.compressornone#Transaction routing rules configuration, only for the client service.vgroupMapping.default_tx_groupdefault #If you use a registry, you can ignore it service.default.grouplist127.0.0.1:8091 service.enableDegradefalse service.disableGlobalTransactionfalse#Transaction rule configuration, only for the client client.rm.asyncCommitBufferLimit10000 client.rm.lock.retryInterval10 client.rm.lock.retryTimes30 client.rm.lock.retryPolicyBranchRollbackOnConflicttrue client.rm.reportRetryCount5 client.rm.tableMetaCheckEnabletrue client.rm.tableMetaCheckerInterval60000 client.rm.sqlParserTypedruid client.rm.reportSuccessEnablefalse client.rm.sagaBranchRegisterEnablefalse client.rm.sagaJsonParserfastjson client.rm.tccActionInterceptorOrder-2147482648 client.tm.commitRetryCount5 client.tm.rollbackRetryCount5 client.tm.defaultGlobalTransactionTimeout60000 client.tm.degradeCheckfalse client.tm.degradeCheckAllowTimes10 client.tm.degradeCheckPeriod2000 client.tm.interceptorOrder-2147482648 client.undo.dataValidationtrue client.undo.logSerializationjackson client.undo.onlyCareUpdateColumnstrue server.undo.logSaveDays7 server.undo.logDeletePeriod86400000 client.undo.logTableundo_log client.undo.compress.enabletrue client.undo.compress.typezip client.undo.compress.threshold64k #For TCC transaction mode tcc.fence.logTableNametcc_fence_log tcc.fence.cleanPeriod1h#Log rule configuration, for client and server log.exceptionRate100#Transaction storage configuration, only for the server. The file, db, and redis configuration values are optional. store.modedb store.lock.modedb store.session.modedb #Used for password encryption

store.publicKey#These configurations are required if the store mode is db. If store.mode,store.lock.mode,store.session.mode are not equal to db, you can remove the configuration block.

store.db.datasourcedruid store.db.dbTypemysql store.db.driverClassNamecom.mysql.cj.jdbc.Driver store.db.urljdbc:mysql://ip:3306/seata?useUnicodetruerewriteBatchedStatementstrue store.db.userroot store.db.passwordroot store.db.minConn5 store.db.maxConn30 store.db.globalTableglobal_table store.db.branchTablebranch_table store.db.distributedLockTabledistributed_lock store.db.queryLimit100 store.db.lockTablelock_table store.db.maxWait5000#Transaction rule configuration, only for the server server.recovery.committingRetryPeriod1000 server.recovery.asynCommittingRetryPeriod1000 server.recovery.rollbackingRetryPeriod1000 server.recovery.timeoutRetryPeriod1000 server.maxCommitRetryTimeout-1 server.maxRollbackRetryTimeout-1 server.rollbackRetryTimeoutUnlockEnablefalse server.distributedLockExpireTime10000 server.xaerNotaRetryTimeout60000 server.session.branchAsyncQueueSize5000 server.session.enableBranchAsyncRemovefalse server.enableParallelRequestHandlefalse#Metrics configuration, only for the server metrics.enabledfalse metrics.registryTypecompact metrics.exporterListprometheus metrics.exporterPrometheusPort9898创建seata数据库及回滚表 在mysql新建了一个名为seata的数据库 导入seata回滚所需的表链接: 表结构地址。根据自己的数据库选择。 在需要接入seata的相关微服务数据库中创建undo_log表。链接表结构地址根据自己的数据库选择。接入服务的数据库不同都要创建一次 设置seata自启动 进入文件夹 /etc/systemd/system创建seata.service文件 #固定写法换一下路径即可 #!/bin/sh [Unit] Descriptionseata-service Aftersyslog.target network.target remote-fs.target nss-lookup.target [Service] Typeforking EnvironmentJAVA_HOME/usr/local/java/jdk1.8.0_311 ExecStart/usr/local/seata/seata/bin/seata-server.sh -p 8091 -h ip PrivateTmptrue [Install] WantedBymulti-user.target【注意】此处-h 后接当前主机IP如不接在nacos上注册的会显示为172开头的虚拟IP 设置开机自启并刷新配置 systemctl enable seata systemctl daemon-reload # 刷新配置启动seata systemctl start seata systemctl status seata # 查看服务状态完成 打开浏览器ip:7091即可看到控制台。账号密码为前面修改配置文件设置的密码即seata。
微服务接入seata pom中引入seata依赖 dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-seata/artifactId /dependencyyml配置文件设置

seata配置

seata:enabled: trueapplication-id: ${spring.application.name}tx-service-group: default_tx_group# 关闭自动代理enable-auto-data-source-proxy: false# seata nacos注册中心配置registry:type: nacosnacos:application: seata-serverserver-addr: nacos的ip:8848group: DEFAULT_GROUPnamespace: 32e627d0-0b49-48de-b298-fb959134e1c5username: nacospassword: nacos# seata nacos配置中心配置config:type: nacosnacos:server-addr: nacos的IP:8848group: DEFAULT_GROUPnamespace: 32e627d0-0b49-48de-b298-fb959134e1c5data-id: seataServer.propertiesusername: nacospassword: nacos【注意】这里需要非常注意的是tx-service-group的值要和seataServer.properties里面的相同。 #Transaction routing rules configuration, only for the client service.vgroupMapping.default_tx_groupdefault使用 主接口增加注解 GlobalTransactional远程调用服务增加注解 Transactional。项目接入多数据源新建两方法分别插入数据到不同库看回滚效果。
TIPS本项目使用的是mybatis-plus