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{
|
memberlistKVcfg.Codecs = []codec.Codec{
|
||||||
ring.GetCodec(),
|
ring.GetCodec(),
|
||||||
}
|
}
|
||||||
|
memberlistKVcfg.ClusterLabel = cfg.MemberlistClusterLabel
|
||||||
|
memberlistKVcfg.ClusterLabelVerificationDisabled = cfg.MemberlistClusterLabelVerificationDisabled
|
||||||
if cfg.MemberlistBindAddr != "" {
|
if cfg.MemberlistBindAddr != "" {
|
||||||
memberlistKVcfg.TCPTransport.BindAddrs = []string{cfg.MemberlistBindAddr}
|
memberlistKVcfg.TCPTransport.BindAddrs = []string{cfg.MemberlistBindAddr}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -24,8 +24,8 @@ import (
|
|||||||
"google.golang.org/grpc/health/grpc_health_v1"
|
"google.golang.org/grpc/health/grpc_health_v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ringKey = "storage-ring"
|
const ringKey = "unified-storage-ring"
|
||||||
const ringName = "unified_storage"
|
const ringName = "unified_storage_ring"
|
||||||
const numTokens = 128
|
const numTokens = 128
|
||||||
const heartbeatTimeout = time.Minute
|
const heartbeatTimeout = time.Minute
|
||||||
|
|
||||||
|
|||||||
+17
-15
@@ -541,21 +541,23 @@ type Cfg struct {
|
|||||||
ShortLinkExpiration int
|
ShortLinkExpiration int
|
||||||
|
|
||||||
// Unified Storage
|
// Unified Storage
|
||||||
UnifiedStorage map[string]UnifiedStorageConfig
|
UnifiedStorage map[string]UnifiedStorageConfig
|
||||||
IndexPath string
|
IndexPath string
|
||||||
IndexWorkers int
|
IndexWorkers int
|
||||||
IndexMaxBatchSize int
|
IndexMaxBatchSize int
|
||||||
IndexFileThreshold int
|
IndexFileThreshold int
|
||||||
IndexMinCount int
|
IndexMinCount int
|
||||||
EnableSharding bool
|
EnableSharding bool
|
||||||
MemberlistBindAddr string
|
MemberlistBindAddr string
|
||||||
MemberlistAdvertiseAddr string
|
MemberlistAdvertiseAddr string
|
||||||
MemberlistJoinMember string
|
MemberlistJoinMember string
|
||||||
InstanceID string
|
MemberlistClusterLabel string
|
||||||
SprinklesApiServer string
|
MemberlistClusterLabelVerificationDisabled bool
|
||||||
SprinklesApiServerPageLimit int
|
InstanceID string
|
||||||
CACertPath string
|
SprinklesApiServer string
|
||||||
HttpsSkipVerify bool
|
SprinklesApiServerPageLimit int
|
||||||
|
CACertPath string
|
||||||
|
HttpsSkipVerify bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type UnifiedStorageConfig struct {
|
type UnifiedStorageConfig struct {
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ func (cfg *Cfg) setUnifiedStorageConfig() {
|
|||||||
cfg.MemberlistBindAddr = section.Key("memberlist_bind_addr").String()
|
cfg.MemberlistBindAddr = section.Key("memberlist_bind_addr").String()
|
||||||
cfg.MemberlistAdvertiseAddr = section.Key("memberlist_advertise_addr").String()
|
cfg.MemberlistAdvertiseAddr = section.Key("memberlist_advertise_addr").String()
|
||||||
cfg.MemberlistJoinMember = section.Key("memberlist_join_member").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.InstanceID = section.Key("instance_id").String()
|
||||||
cfg.IndexFileThreshold = section.Key("index_file_threshold").MustInt(10)
|
cfg.IndexFileThreshold = section.Key("index_file_threshold").MustInt(10)
|
||||||
cfg.IndexMinCount = section.Key("index_min_count").MustInt(1)
|
cfg.IndexMinCount = section.Key("index_min_count").MustInt(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user