通过asp.net核心中的serilog.sinks.elasticsearch设置ElasticSearch索引的副本数

xv8emn3q  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(0)|浏览(222)

我将serilog.sinks.elasticsearch包与serilog一起使用,配置如下:

loggerConfiguration.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("http://localhost:9200"))
{
          NumberOfReplicas = 0,
          IndexFormat = "logs-{0:yyyy.MM.dd}",
          MinimumLogEventLevel = LogEventLevel.Information,
          AutoRegisterTemplate = true,
          AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6
})

创建索引时,它包含1个副本,但我需要0

{
   "logs-2020.12.25":{
      "settings":{
         "index":{
            "routing":{
               "allocation":{
                  "include":{
                     "_tier_preference":"data_content"
                  }
               }
            },
            "number_of_shards":"1",
            "provided_name":"logs-2020.12.25",
            "creation_date":"1608898386163",
            "number_of_replicas":"1",
            "uuid":"WvFFt8OIRAeQgLJGtTbV4Q",
            "version":{
               "created":"7100199"
            }
         }
      }
   }
}

我做错什么了?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题