目录
一.工具地址与版本
1.nacos-server-2.0.3
下载地址:Releases · alibaba/nacos · GitHub
2.seata-server-1.4.2
下载地址:https://github.com/seata/seata/releases
3.jdk11
注意:这里只搞seata,其他的自行安装
二.解压与配置
1.解压
tar -zvxf seata-server-1.4.2.tar.gz
2.配置文件file.conf, 修改了mode="db" ,去掉了其他的配置, 修改数据库连接地址数据库用户密码
## transaction log store, only used in seata-server
store {
## store mode: file、db、redis
mode = "db"
## rsa decryption public key
publicKey = ""
## database store property
db {
## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
datasource = "druid"
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.cj.jdbc.Driver"
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
url = "jdbc:mysql://192.168.99.133:3306/seata?rewriteBatchedStatements=true"
user = "数据库账号"
password = "数据库密码"
minConn = 5
maxConn = 100
globalTable = "global_table"
branchTable = "branch_table"
lockTable = "lock_table"
queryLimit = 100
maxWait = 5000
}
}
3.修改配置文件registry.conf ,已经清掉多余的配置了
registry {
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
type = "nacos"
nacos {
# nacos注册后的服务名称
application = "seata-server"
# seata 集成nacos的nacos地址与端口
serverAddr = "192.168.99.133:8848"
# 还不熟练的时候默认即可
group = "DEFAULT_GROUP"
# nacos的命名空间,为空默认在public下
namespace = "cc0bd646-7444-4611-ae53-793f494b174e"
# 默认即可
cluster = "default"
# nacos的账号,如果没有可以为空
username = ""
# nacos的密码,如果没有可以为空
password = ""
}
# type="file" 的时候使用
file {
name = "file.conf"
}
}
config {
# file、nacos 、apollo、zk、consul、etcd3
type = "nacos"
nacos {
serverAddr = "192.168.99.133:8848"
namespace = "cc0bd646-7444-4611-ae53-793f494b174e"
group = "DEFAULT_GROUP"
username = ""
password = ""
# nacos需要创建seataServer.properties方便编辑操作
dataId = "seataServer.properties"
}
# type="file" 的时候使用
file {
name = "file.conf"
}
}
4.新建nacos配置文件 seataServer.properties