unified-storage: expose memberlist cluster label config (#104643)
* tweak ringKey/ringName for consistency and allow us to configure memberlist cluster label config * allow setting memberlist cluster label verification disabled field --------- Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
This commit is contained in:
co-authored by
Peter Štibraný
parent
1c5545da04
commit
ecea6a9366
@@ -41,6 +41,8 @@ func toMemberlistConfig(cfg *setting.Cfg) *memberlist.KVConfig {
|
||||
memberlistKVcfg.Codecs = []codec.Codec{
|
||||
ring.GetCodec(),
|
||||
}
|
||||
memberlistKVcfg.ClusterLabel = cfg.MemberlistClusterLabel
|
||||
memberlistKVcfg.ClusterLabelVerificationDisabled = cfg.MemberlistClusterLabelVerificationDisabled
|
||||
if cfg.MemberlistBindAddr != "" {
|
||||
memberlistKVcfg.TCPTransport.BindAddrs = []string{cfg.MemberlistBindAddr}
|
||||
}
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ import (
|
||||
"google.golang.org/grpc/health/grpc_health_v1"
|
||||
)
|
||||
|
||||
const ringKey = "storage-ring"
|
||||
const ringName = "unified_storage"
|
||||
const ringKey = "unified-storage-ring"
|
||||
const ringName = "unified_storage_ring"
|
||||
const numTokens = 128
|
||||
const heartbeatTimeout = time.Minute
|
||||
|
||||
|
||||
+17
-15
@@ -541,21 +541,23 @@ type Cfg struct {
|
||||
ShortLinkExpiration int
|
||||
|
||||
// Unified Storage
|
||||
UnifiedStorage map[string]UnifiedStorageConfig
|
||||
IndexPath string
|
||||
IndexWorkers int
|
||||
IndexMaxBatchSize int
|
||||
IndexFileThreshold int
|
||||
IndexMinCount int
|
||||
EnableSharding bool
|
||||
MemberlistBindAddr string
|
||||
MemberlistAdvertiseAddr string
|
||||
MemberlistJoinMember string
|
||||
InstanceID string
|
||||
SprinklesApiServer string
|
||||
SprinklesApiServerPageLimit int
|
||||
CACertPath string
|
||||
HttpsSkipVerify bool
|
||||
UnifiedStorage map[string]UnifiedStorageConfig
|
||||
IndexPath string
|
||||
IndexWorkers int
|
||||
IndexMaxBatchSize int
|
||||
IndexFileThreshold int
|
||||
IndexMinCount int
|
||||
EnableSharding bool
|
||||
MemberlistBindAddr string
|
||||
MemberlistAdvertiseAddr string
|
||||
MemberlistJoinMember string
|
||||
MemberlistClusterLabel string
|
||||
MemberlistClusterLabelVerificationDisabled bool
|
||||
InstanceID string
|
||||
SprinklesApiServer string
|
||||
SprinklesApiServerPageLimit int
|
||||
CACertPath string
|
||||
HttpsSkipVerify bool
|
||||
}
|
||||
|
||||
type UnifiedStorageConfig struct {
|
||||
|
||||
@@ -58,6 +58,8 @@ func (cfg *Cfg) setUnifiedStorageConfig() {
|
||||
cfg.MemberlistBindAddr = section.Key("memberlist_bind_addr").String()
|
||||
cfg.MemberlistAdvertiseAddr = section.Key("memberlist_advertise_addr").String()
|
||||
cfg.MemberlistJoinMember = section.Key("memberlist_join_member").String()
|
||||
cfg.MemberlistClusterLabel = section.Key("memberlist_cluster_label").String()
|
||||
cfg.MemberlistClusterLabelVerificationDisabled = section.Key("memberlist_cluster_label_verification_disabled").MustBool(false)
|
||||
cfg.InstanceID = section.Key("instance_id").String()
|
||||
cfg.IndexFileThreshold = section.Key("index_file_threshold").MustInt(10)
|
||||
cfg.IndexMinCount = section.Key("index_min_count").MustInt(1)
|
||||
|
||||
Reference in New Issue
Block a user