sync cluster distribution to config file while setup

This commit is contained in:
liugq 2023-03-08 12:18:08 +08:00
parent d37da4679e
commit 50e8f7fc79
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ elasticsearch:
- id: $[[CLUSTER_ID]]
name: $[[CLUSTER_ID]]
version: $[[CLUSTER_VER]]
distribution: $[[CLUSTER_DISTRIBUTION]]
enabled: true
monitored: true
reserved: true

View File

@ -550,8 +550,8 @@ func (module *Module) initialize(w http.ResponseWriter, r *http.Request, ps http
file:=path.Join(global.Env().GetConfigDir(),"system_config.yml")
_,err=util.FilePutContent(file,fmt.Sprintf("configs.template:\n - name: \"system\"\n path: ./config/system_config.tpl\n variable:\n " +
"CLUSTER_ID: %v\n CLUSTER_ENDPINT: \"%v\"\n " +
"CLUSTER_USER: \"%v\"\n CLUSTER_VER: \"%v\"\n INDEX_PREFIX: \"%v\"",
GlobalSystemElasticsearchID,cfg.Endpoint,cfg.BasicAuth.Username,cfg.Version,cfg1.IndexPrefix ))
"CLUSTER_USER: \"%v\"\n CLUSTER_VER: \"%v\"\n CLUSTER_DISTRIBUTION: \"%v\"\n INDEX_PREFIX: \"%v\"",
GlobalSystemElasticsearchID,cfg.Endpoint,cfg.BasicAuth.Username,cfg.Version,cfg.Distribution,cfg1.IndexPrefix ))
if err!=nil{
panic(err)
}