AsperforMias commented on issue #8150:
URL:
https://github.com/apache/incubator-seata/issues/8150#issuecomment-4817203778
感觉这个问题主要分两块:
1. `store.db.dbType should not be blank`
如果 `application.yml` 里已经配置了:
```yaml
seata:
config:
type: nacos
```
那 Seata Server 启动时会优先从 Nacos 配置中心读取配置,也就是 `data-id` 对应的那份配置,比如
`seataServer.properties`
所以 DB 相关配置不能只写在本地 `application.yml` 里,Nacos 里的 `seataServer.properties`
也要配完整,比如:
```properties
store.mode=db
store.session.mode=db
store.lock.mode=db
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.cj.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true&useSSL=false&serverTimezone=Asia/Shanghai
store.db.user=root
store.db.password=your_password
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.lockTable=lock_table
store.db.distributedLockTable=distributed_lock
store.db.queryLimit=1000
store.db.maxWait=5000
```
这里,Nacos 里的 properties 配置 key 是:
```properties
store.db.dbType=mysql
```
不是 yaml 里的:
```yaml
db-type: mysql
```
现在这个报错看起来就是启动时没有从最终生效的配置里读到 `store.db.dbType`
2. console 访问不到
2.6.0 之后 console 这块似乎是调整过了,不是按老版本那种直接访问 seata-server 的 console 来用。console
集成在 naming-server 上的,需要单独部署/启动 `seata-naming-server`,然后访问 naming-server 的
console url
如果希望 seata-server 出现在 console 里,还需要让 seata-server 同时注册到 naming-server,例如
registry type 配成类似:
```yaml
seata:
registry:
type: seata,nacos
```
也就是业务侧/服务发现可以继续走 nacos,但控制台这块要通过 seata naming-server 来管理和展示
ps:如果这边用的是 Nacos 3.x,可能还会遇到 nacos-client 兼容性问题。感觉要先确认是否:
- Nacos 里的 `seataServer.properties` 是否真的有完整的 `store.db.*`
- `data-id`、`group`、`namespace` 是否和 `application.yml` 完全一致
- 已经启动了 `seata-naming-server`
- seata-server 是否注册到了 `seata,nacos`
感觉这个 issue 更像是配置方式和 2.6.0 部署方式变化共同导致问题,不一定是 seata-server 连接数据库本身的 bug
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]