PLT-7275: Configure replica/shard count for Elasticsearch indexes. (#7093)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
b47cf82043
Коммит
29be10ca2f
@@ -411,6 +411,8 @@ func trackConfig() {
|
|||||||
"enable_indexing": *utils.Cfg.ElasticsearchSettings.EnableIndexing,
|
"enable_indexing": *utils.Cfg.ElasticsearchSettings.EnableIndexing,
|
||||||
"enable_searching": *utils.Cfg.ElasticsearchSettings.EnableSearching,
|
"enable_searching": *utils.Cfg.ElasticsearchSettings.EnableSearching,
|
||||||
"sniff": *utils.Cfg.ElasticsearchSettings.Sniff,
|
"sniff": *utils.Cfg.ElasticsearchSettings.Sniff,
|
||||||
|
"post_index_replicas": *utils.Cfg.ElasticsearchSettings.PostIndexReplicas,
|
||||||
|
"post_index_shards": *utils.Cfg.ElasticsearchSettings.PostIndexShards,
|
||||||
})
|
})
|
||||||
|
|
||||||
SendDiagnostic(TRACK_CONFIG_PLUGIN, map[string]interface{}{
|
SendDiagnostic(TRACK_CONFIG_PLUGIN, map[string]interface{}{
|
||||||
|
|||||||
@@ -292,7 +292,9 @@
|
|||||||
"Password": "changeme",
|
"Password": "changeme",
|
||||||
"EnableIndexing": false,
|
"EnableIndexing": false,
|
||||||
"EnableSearching": false,
|
"EnableSearching": false,
|
||||||
"Sniff": true
|
"Sniff": true,
|
||||||
|
"PostIndexReplicas": 2,
|
||||||
|
"PostIndexShards": 1
|
||||||
},
|
},
|
||||||
"DataRetentionSettings": {
|
"DataRetentionSettings": {
|
||||||
"Enable": false
|
"Enable": false
|
||||||
|
|||||||
@@ -119,9 +119,11 @@ const (
|
|||||||
ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_COLOR = "#f2a93b"
|
ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_COLOR = "#f2a93b"
|
||||||
ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_TEXT_COLOR = "#333333"
|
ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_TEXT_COLOR = "#333333"
|
||||||
|
|
||||||
ELASTICSEARCH_SETTINGS_DEFAULT_CONNECTION_URL = ""
|
ELASTICSEARCH_SETTINGS_DEFAULT_CONNECTION_URL = ""
|
||||||
ELASTICSEARCH_SETTINGS_DEFAULT_USERNAME = ""
|
ELASTICSEARCH_SETTINGS_DEFAULT_USERNAME = ""
|
||||||
ELASTICSEARCH_SETTINGS_DEFAULT_PASSWORD = ""
|
ELASTICSEARCH_SETTINGS_DEFAULT_PASSWORD = ""
|
||||||
|
ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_REPLICAS = 2
|
||||||
|
ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_SHARDS = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServiceSettings struct {
|
type ServiceSettings struct {
|
||||||
@@ -432,12 +434,14 @@ type WebrtcSettings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ElasticsearchSettings struct {
|
type ElasticsearchSettings struct {
|
||||||
ConnectionUrl *string
|
ConnectionUrl *string
|
||||||
Username *string
|
Username *string
|
||||||
Password *string
|
Password *string
|
||||||
EnableIndexing *bool
|
EnableIndexing *bool
|
||||||
EnableSearching *bool
|
EnableSearching *bool
|
||||||
Sniff *bool
|
Sniff *bool
|
||||||
|
PostIndexReplicas *int
|
||||||
|
PostIndexShards *int
|
||||||
}
|
}
|
||||||
|
|
||||||
type DataRetentionSettings struct {
|
type DataRetentionSettings struct {
|
||||||
@@ -1417,6 +1421,16 @@ func (o *Config) SetDefaults() {
|
|||||||
*o.ElasticsearchSettings.Sniff = true
|
*o.ElasticsearchSettings.Sniff = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.ElasticsearchSettings.PostIndexReplicas == nil {
|
||||||
|
o.ElasticsearchSettings.PostIndexReplicas = new(int)
|
||||||
|
*o.ElasticsearchSettings.PostIndexReplicas = ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_REPLICAS
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.ElasticsearchSettings.PostIndexShards == nil {
|
||||||
|
o.ElasticsearchSettings.PostIndexShards = new(int)
|
||||||
|
*o.ElasticsearchSettings.PostIndexShards = ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_SHARDS
|
||||||
|
}
|
||||||
|
|
||||||
if o.DataRetentionSettings.Enable == nil {
|
if o.DataRetentionSettings.Enable == nil {
|
||||||
o.DataRetentionSettings.Enable = new(bool)
|
o.DataRetentionSettings.Enable = new(bool)
|
||||||
*o.DataRetentionSettings.Enable = false
|
*o.DataRetentionSettings.Enable = false
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user