Browse Source

revivification

pull/262/head
KuiLiao 5 years ago
parent
commit
6ef72f747a
  1. 40
      conf.sample.yml
  2. 2
      dtmsvr/config/config.go
  3. 1
      main.go

40
conf.sample.yml

@ -5,12 +5,12 @@
### MicroService.EndPoint => MICRO_SERVICE_END_POINT ### MicroService.EndPoint => MICRO_SERVICE_END_POINT
##################################################################### #####################################################################
Store: # specify which engine to store trans status # Store: # specify which engine to store trans status
Driver: 'mysql' # Driver: 'mysql'
Host: 'localhost' # Host: 'localhost'
User: 'root' # User: 'root'
Password: '123456' # Password: '123456'
Port: 3306 # Port: 3306
# Driver: 'boltdb' # default store engine # Driver: 'boltdb' # default store engine
# Driver: 'redis' # Driver: 'redis'
@ -37,11 +37,11 @@ Store: # specify which engine to store trans status
# SuccessDataExpire: 86400 # successful Trans data will expire in 1 days. only for redis. # SuccessDataExpire: 86400 # successful Trans data will expire in 1 days. only for redis.
# RedisPrefix: '{a}' # default value is '{a}'. Redis storage prefix. store data to only one slot in cluster # RedisPrefix: '{a}' # default value is '{a}'. Redis storage prefix. store data to only one slot in cluster
MicroService: # MicroService:
Driver: 'dtm-driver-nacos' # name of the driver to handle register/discover # Driver: 'dtm-driver-nacos' # name of the driver to handle register/discover
Target: '1.14.127.29:8848' # register dtm server to this url # Target: '127.0.0.1:8848' # register dtm server to this url
EndPoint: '192.168.101.9:36789' # EndPoint: '127.0.0.1:36789'
OptionsJson: '{"username": "nacos", "password": "nacos", "namespaceId": "c3dc917d-906a-429d-90a9-85012b41014e"}' # micro service other config message, example: '{"username": "nacos", "password": "nacos"}' # OptionsJson: '{"username": "nacos", "password": "nacos", "namespaceId": "c3dc917d-906a-429d-90a9-85012b41067e"}' # micro service other config message, example: '{"username": "nacos", "password": "nacos"}'
### the unit of following configurations is second ### the unit of following configurations is second
# TransCronInterval: 3 # the interval to poll unfinished global transaction for every dtm process # TransCronInterval: 3 # the interval to poll unfinished global transaction for every dtm process
@ -49,15 +49,15 @@ MicroService:
# RetryInterval: 10 # the subtrans branch will be retried after this interval # RetryInterval: 10 # the subtrans branch will be retried after this interval
# RequestTimeout: 3 # the timeout of HTTP/gRPC request in dtm # RequestTimeout: 3 # the timeout of HTTP/gRPC request in dtm
LogLevel: 'info' # default: info. can be debug|info|warn|error # LogLevel: 'info' # default: info. can be debug|info|warn|error
Log: # Log:
Outputs: 'stderr' # default: stderr, split by ",", you can append files to Outputs if need. example:'stderr,/tmp/test.log' # Outputs: 'stderr' # default: stderr, split by ",", you can append files to Outputs if need. example:'stderr,/tmp/test.log'
RotationEnable: 0 # default: 0 # RotationEnable: 0 # default: 0
RotationConfigJSON: '{}' # example: '{"maxsize": 100, "maxage": 0, "maxbackups": 0, "localtime": false, "compress": false}' # RotationConfigJSON: '{}' # example: '{"maxsize": 100, "maxage": 0, "maxbackups": 0, "localtime": false, "compress": false}'
#
HttpPort: 36789 # HttpPort: 36789
GrpcPort: 36790 # GrpcPort: 36790
JsonRpcPort: 36791 # JsonRpcPort: 36791
### advanced options ### advanced options
# UpdateBranchAsyncGoroutineNum: 1 # num of async goroutine to update branch status # UpdateBranchAsyncGoroutineNum: 1 # num of async goroutine to update branch status

2
dtmsvr/config/config.go

@ -24,7 +24,7 @@ const (
// MicroService config type for micro service // MicroService config type for micro service
type MicroService struct { type MicroService struct {
Driver string `yaml:"Driver" default:"dtm-driver-nacos"` Driver string `yaml:"Driver" default:"default"`
Target string `yaml:"Target"` Target string `yaml:"Target"`
EndPoint string `yaml:"EndPoint"` EndPoint string `yaml:"EndPoint"`
OptionsJson string `yaml:"OptionsJson"` OptionsJson string `yaml:"OptionsJson"`

1
main.go

@ -60,7 +60,6 @@ func main() {
return return
} }
logger.Infof("dtm version is: %s", Version) logger.Infof("dtm version is: %s", Version)
*confFile = "conf.sample.yml"
config.MustLoadConfig(*confFile) config.MustLoadConfig(*confFile)
conf := &config.Config conf := &config.Config
if *isDebug { if *isDebug {

Loading…
Cancel
Save