云搜索服务 CSS-配置Elasticsearch集群读写分离:查询同步状态

时间:2024-11-19 17:39:24

查询同步状态

  • 获取自动同步状态

    该接口可以获取匹配索引同步的状态。

    请求示例如下:

    GET auto_sync/stats

    接口返回示例如下:

    {
      "success_count" : 3,
      "failed_count" : 0,
      "failed_remote_cluster_state_requests_count" : 0,
      "last_fail_exception" : { },
      "last_fail_remote_cluster_requests_exception" : { }
    }
  • 获取指定索引的自动同步状态

    请求示例如下:

    GET {index_name}/sync_stats

    接口返回示例如下:

    {
      "indices" : {
        "data1_follower" : {
          "shards" : {
            "0" : [
              {
                "primary" : false,
                "total_synced_times" : 27,
                "total_empty_times" : 25,
                "total_synced_files" : 4,
                "total_synced_bytes" : 3580,
                "total_paused_nanos" : 0,
                "total_paused_times" : 0,
                "current" : {
                  "files_count" : 0,
                  "finished_files_count" : 0,
                  "bytes" : 0,
                  "finished_bytes" : 0
                }
              },
              {
                "primary" : true,
                "total_synced_times" : 28,
                "total_empty_times" : 26,
                "total_synced_files" : 20,
                "total_synced_bytes" : 17547,
                "total_paused_nanos" : 0,
                "total_paused_times" : 0,
                "current" : {
                  "files_count" : 0,
                  "finished_files_count" : 0,
                  "bytes" : 0,
                  "finished_bytes" : 0
                }
              }
            ]
          }
        }
      }
    }
support.huaweicloud.com/usermanual-css/css_01_0162.html