diff --git a/pkg/cluster/spec/ts_meta.go b/pkg/cluster/spec/ts_meta.go index e65dbe8..df0976e 100644 --- a/pkg/cluster/spec/ts_meta.go +++ b/pkg/cluster/spec/ts_meta.go @@ -189,13 +189,10 @@ func (i *TSMetaInstance) SetDefaultConfig(instanceConf map[string]any) map[strin instanceConf = make(map[string]any, 20) } var metaPeerAddrs []string - var tsMetaSpec *TSMetaSpec for _, metaSpec := range i.topo.TSMetaServers { - if i.Host == metaSpec.Host && i.Port == metaSpec.ClientPort { - tsMetaSpec = metaSpec - } metaPeerAddrs = append(metaPeerAddrs, utils.JoinHostPort(metaSpec.Host, metaSpec.PeerPort)) } + var tsMetaSpec = i.InstanceSpec.(*TSMetaSpec) instanceConf["common.meta-join"] = metaPeerAddrs instanceConf["meta.bind-address"] = utils.JoinHostPort(i.Host, tsMetaSpec.RaftPort) instanceConf["meta.http-bind-address"] = utils.JoinHostPort(i.Host, tsMetaSpec.ClientPort) diff --git a/pkg/cluster/spec/ts_sql.go b/pkg/cluster/spec/ts_sql.go index 379c9a8..83abd12 100644 --- a/pkg/cluster/spec/ts_sql.go +++ b/pkg/cluster/spec/ts_sql.go @@ -189,12 +189,7 @@ func (i *TSSqlInstance) SetDefaultConfig(instanceConf map[string]any) map[string } instanceConf["common.meta-join"] = metaPeerAddrs - var tsSqlSpec *TSSqlSpec - for _, sqlSpec := range i.topo.TSSqlServers { - if i.Host == sqlSpec.Host { - tsSqlSpec = sqlSpec - } - } + var tsSqlSpec = i.InstanceSpec.(*TSSqlSpec) instanceConf["http.bind-address"] = utils.JoinHostPort(i.Host, tsSqlSpec.Port) instanceConf["http.flight-enabled"] = false // enabled at ts-data instanceConf["logging.path"] = tsSqlSpec.LogDir diff --git a/pkg/cluster/spec/ts_store.go b/pkg/cluster/spec/ts_store.go index 0aabd10..3ad3afe 100644 --- a/pkg/cluster/spec/ts_store.go +++ b/pkg/cluster/spec/ts_store.go @@ -196,17 +196,11 @@ func (i *TSStoreInstance) SetDefaultConfig(instanceConf map[string]any) map[stri } instanceConf["common.meta-join"] = metaPeerAddrs - var tsStoreSpec *TSStoreSpec - for _, storeSpec := range i.topo.TSStoreServers { - if i.Host == storeSpec.Host && i.Port == storeSpec.SelectPort { - tsStoreSpec = storeSpec - } - } + var tsStoreSpec = i.InstanceSpec.(*TSStoreSpec) instanceConf["data.store-ingest-addr"] = utils.JoinHostPort(i.Host, tsStoreSpec.IngestPort) instanceConf["data.store-select-addr"] = utils.JoinHostPort(i.Host, tsStoreSpec.SelectPort) instanceConf["data.store-data-dir"] = tsStoreSpec.DataDir instanceConf["data.store-wal-dir"] = tsStoreSpec.DataDir - //instanceConf["data.store-meta-dir"] = tsStoreSpec.DataDir instanceConf["logging.path"] = tsStoreSpec.LogDir instanceConf["gossip.bind-address"] = i.Host