大湖之子 发表于 2019-1-29 14:28:49

ES的API使用

{  
"cluster_name" : "myapp",
  
"nodes" : {
  
    "La0pzwQrQDK-r9B5JzNuIA" : {
  
      "timestamp" : 1523769963467,
  
      "name" : "node3",
  
      "transport_address" : "127.0.0.1:9302",
  
      "host" : "127.0.0.1",
  
      "ip" : [ "127.0.0.1:9302", "NONE" ],
  
      "attributes" : {
  
      "master" : "true"
  
      },
  
      "indices" : {      --索引信息
  
      "docs" : {
  
          "count" : 5663,   --document数量
  
          "deleted" : 0
  
      },
  
      "store" : {
  
          "size_in_bytes" : 17227849,   --存储空间大小
  
          "throttle_time_in_millis" : 0 --限流时间,如果限流时间很大,那可能表明你的磁盘限流设置得过
  
      },
  
      "indexing" : {   --索引信息
  
          "index_total" : 289046,       --索引数据
  
          "index_time_in_millis" : 750592, --索引用时,可以除以索引数量,得到每次索引的平均时间
  
          "index_current" : 0,
  
          "index_failed" : 25,
  
          "delete_total" : 1423,       --删除数据
  
          "delete_time_in_millis" : 382,--删除耗时
  
          "delete_current" : 0,
  
          "noop_update_total" : 944,
  
          "is_throttled" : false,
  
          "throttle_time_in_millis" : 0
  
      },
  
      "get" : {
  
          "total" : 1018,
  
          "time_in_millis" : 221,
  
          "exists_total" : 954,
  
          "exists_time_in_millis" : 217,
  
          "missing_total" : 64,
  
          "missing_time_in_millis" : 4,
  
          "current" : 0
  
      },
  
      "search" : {                  --查询
  
          "open_contexts" : 0,      --活跃中的搜索数量
  
          "query_total" : 593899,   --query操作数量
  
          "query_time_in_millis" : 980120,--query操作耗时,query_time_in_millis / query_total计算的比值,可以用来粗略的评价你的查询有多高效。比值越大,每个查询花费的时间越多,你应该要考虑调优了。
  
          "query_current" : 0,
  
          "fetch_total" : 587866,         --fatch数量
  
          "fetch_time_in_millis" : 3692858, --fatch耗时,统计值展示了查询处理的后一半流程(query-then-fetch 里的 fetch),如果 fetch 耗时比 query 还多,说明磁盘较慢,或者获取了太多文档,或者可能搜索请求设置了太大的分页(比如, size: 10000 )
  
          "fetch_current" : 0,
  
          "scroll_total" : 0,
  
          "scroll_time_in_millis" : 0,
  
          "scroll_current" : 0
  
      },
  
      "merges" : {             --段合并信息
  
          "current" : 0,         --目前运行几个合并
  
          "current_docs" : 0,
  
          "current_size_in_bytes" : 0,
  
          "total" : 325,                  --合并次数
  
          "total_time_in_millis" : 65894, --合并操作消耗总时间
  
          "total_docs" : 200942,          --合并设计的文档数
  
          "total_size_in_bytes" : 441791060, --合并的段的总大小
  
          "total_stopped_time_in_millis" : 0,
  
          "total_throttled_time_in_millis" : 0,
  
          "total_auto_throttle_in_bytes" : 18853396480
  
      },
  
      "refresh" : {
  
          "total" : 44804,
  
          "total_time_in_millis" : 131391
  
      },
  
      "flush" : {
  
          "total" : 2239,
  
          "total_time_in_millis" : 27722
  
      },
  
      "warmer" : {
  
          "current" : 0,
  
          "total" : 120,
  
          "total_time_in_millis" : 4
  
      },
  
      "query_cache" : {            --查询缓存使用情况
  
          "memory_size_in_bytes" : 0,--缓存文档数量
  
          "total_count" : 2,
  
          "hit_count" : 0,             --命中数量
  
          "miss_count" : 2,            --未命中数量
  
          "cache_size" : 0,
  
          "cache_count" : 0,
  
          "evictions" : 0
  
      },
  
      "fielddata" : {
  
          "memory_size_in_bytes" : 0,
  
          "evictions" : 0
  
      },
  
      "percolate" : {
  
          "total" : 0,
  
          "time_in_millis" : 0,
  
          "current" : 0,
  
          "memory_size_in_bytes" : -1,
  
          "memory_size" : "-1b",
  
          "queries" : 0
  
      },
  
      "completion" : {
  
          "size_in_bytes" : 0
  
      },
  
      "segments" : {            --段信息
  
          "count" : 30,
  
          "memory_in_bytes" : 717948,               --segment内存总大小
  
          "terms_memory_in_bytes" : 332996,
  
          "stored_fields_memory_in_bytes" : 14080,
  
          "term_vectors_memory_in_bytes" : 0,
  
          "norms_memory_in_bytes" : 2304,
  
          "doc_values_memory_in_bytes" : 368568,
  
          "index_writer_memory_in_bytes" : 0,
  
          "index_writer_max_memory_in_bytes" : 6144000,
  
          "version_map_memory_in_bytes" : 0,
  
          "fixed_bit_set_memory_in_bytes" : 0
  
      },
  
      "translog" : {
  
          "operations" : 0,
  
          "size_in_bytes" : 516
  
      },
  
      "suggest" : {
  
          "total" : 0,
  
          "time_in_millis" : 0,
  
          "current" : 0
  
      },
  
      "request_cache" : {
  
          "memory_size_in_bytes" : 0,
  
          "evictions" : 0,
  
          "hit_count" : 0,
  
          "miss_count" : 0
  
      },
  
      "recovery" : {
  
          "current_as_source" : 0,
  
          "current_as_target" : 0,
  
          "throttle_time_in_millis" : 599
  
      }
  
      },
  
      "os" : {             --操作系统信息
  
      "timestamp" : 1523769963475,
  
      "cpu_percent" : 16,          --cpu使用率
  
      "load_average" : 2.89,       --负载
  
      "mem" : {          --内存信息
  
          "total_in_bytes" : 135282704384,--内存总大小
  
          "free_in_bytes" : 1091211264,   --空闲内存大小
  
          "used_in_bytes" : 134191493120,   --使用内存大小
  
          "free_percent" : 1,               --空闲半分比
  
          "used_percent" : 99               --使用内存百分比
  
      },
  
      "swap" : {                   --swap信息
  
          "total_in_bytes" : 17179865088,   --swap总大小
  
          "free_in_bytes" : 1044086784,   --swap空闲大小
  
          "used_in_bytes" : 16135778304   --swap使用大小
  
      }
  
      },
  
      "process" : {
  
      "timestamp" : 1523769963476,
  
      "open_file_descriptors" : 835,       --打开的文件句柄数
  
      "max_file_descriptors" : 102400,   --最大文件句柄数
  
      "cpu" : {
  
          "percent" : 0,
  
          "total_in_millis" : 269254050      --cpm使用时间
  
      },
  
      "mem" : {
  
          "total_virtual_in_bytes" : 22376689664
  
      }
  
      },
  
      "jvm" : {                --jvm信息
  
      "timestamp" : 1523769963478,
  
      "uptime_in_millis" : 24396978180,
  
      "mem" : {
  
          "heap_used_in_bytes" : 1420965384,   --堆使用大小
  
          "heap_used_percent" : 34,            --堆使用率
  
          "heap_committed_in_bytes" : 4151836672,
  
          "heap_max_in_bytes" : 4151836672,      --堆总大小
  
          "non_heap_used_in_bytes" : 62671016,
  
          "non_heap_committed_in_bytes" : 63045632,
  
          "pools" : {
  
            "young" : {                        --新生代
  
            "used_in_bytes" : 850822912,
  
            "max_in_bytes" : 1145372672,
  
            "peak_used_in_bytes" : 1145372672,
  
            "peak_max_in_bytes" : 1145372672
  
            },
  
            "survivor" : {                     --幸存者区
  
            "used_in_bytes" : 5660696,
  
            "max_in_bytes" : 143130624,
  
            "peak_used_in_bytes" : 96813656,
  
            "peak_max_in_bytes" : 143130624
  
            },
  
            "old" : {                            --老年代
  
            "used_in_bytes" : 564481776,
  
            "max_in_bytes" : 2863333376,
  
            "peak_used_in_bytes" : 564481776,
  
            "peak_max_in_bytes" : 2863333376
  
            }
  
          }
  
      },
  
      "threads" : {         --线程
  
          "count" : 342,      --线程总数
  
          "peak_count" : 348    --峰值
  
      },
  
      "gc" : {
  
          "collectors" : {
  
            "young" : {         --young gc
  
            "collection_count" : 1718,
  
            "collection_time_in_millis" : 49102
  
            },
  
            "old" : {         --old gc
  
            "collection_count" : 0,
  
            "collection_time_in_millis" : 0
  
            }
  
          }
  
      },
  
      "buffer_pools" : {
  
          "direct" : {
  
            "count" : 494,
  
            "used_in_bytes" : 70016422,
  
            "total_capacity_in_bytes" : 70016422
  
          },
  
          "mapped" : {
  
            "count" : 15,
  
            "used_in_bytes" : 3549927,
  
            "total_capacity_in_bytes" : 3549927
  
          }
  
      }
  
      },
  
      "thread_pool" : {   --线程池情况
  
      "bulk" : {
  
          "threads" : 32,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 32,
  
          "completed" : 287583
  
      },
  
      "fetch_shard_started" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 1,
  
          "completed" : 1
  
      },
  
      "fetch_shard_store" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 10,
  
          "completed" : 11
  
      },
  
      "flush" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 5,
  
          "completed" : 4521
  
      },
  
      "force_merge" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 1,
  
          "completed" : 1
  
      },
  
      "generic" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 20,
  
          "completed" : 26875520
  
      },
  
      "get" : {
  
          "threads" : 10,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 10,
  
          "completed" : 10
  
      },
  
      "index" : {
  
          "threads" : 23,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 23,
  
          "completed" : 23
  
      },
  
      "listener" : {
  
          "threads" : 10,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 10,
  
          "completed" : 20150413
  
      },
  
      "management" : {
  
          "threads" : 5,
  
          "queue" : 0,
  
          "active" : 1,
  
          "rejected" : 0,
  
          "largest" : 5,
  
          "completed" : 1629062
  
      },
  
      "percolate" : {
  
          "threads" : 0,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 0,
  
          "completed" : 0
  
      },
  
      "refresh" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 10,
  
          "completed" : 44804
  
      },
  
      "search" : {          --查询
  
          "threads" : 49,   --查询线程数
  
          "queue" : 0,      --查询队列长度
  
          "active" : 0,       --正在处理的请求数
  
          "rejected" : 0,   --拒绝的查询请求数量:rejected 受threadpool.search.queue_size: 限制,如果处理能力达到了极限,poo满,就会拒绝。
  
          "largest" : 49,
  
          "completed" : 703061
  
      },
  
      "snapshot" : {
  
          "threads" : 0,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 0,
  
          "completed" : 0
  
      },
  
      "suggest" : {
  
          "threads" : 0,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 0,
  
          "completed" : 0
  
      },
  
      "warmer" : {
  
          "threads" : 1,
  
          "queue" : 0,
  
          "active" : 0,
  
          "rejected" : 0,
  
          "largest" : 2,
  
          "completed" : 5735
  
      }
  
      },
  
      "fs" : {            --文件系统
  
      "timestamp" : 1523769963478,
  
      "total" : {
  
          "total_in_bytes" : 1647163199488,      --文件系统总大小
  
          "free_in_bytes" : 848772972544,      --空闲大小
  
          "available_in_bytes" : 765095141376,
  
          "spins" : "true"
  
      },
  
      "data" : [ {
  
          "path" : "/elasticsearch/2.4.2/node3/myapp/nodes/0",
  
          "mount" : " (/dev/sda7)",
  
          "type" : "ext4",
  
          "total_in_bytes" : 1647163199488,
  
          "free_in_bytes" : 848772972544,
  
          "available_in_bytes" : 765095141376,
  
          "spins" : "true"
  
      } ]
  
      },
  
      "transport" : {                --tcp信息
  
      "server_open" : 91,
  
      "rx_count" : 72012076,
  
      "rx_size_in_bytes" : 9420555589,
  
      "tx_count" : 72006544,
  
      "tx_size_in_bytes" : 29520860012
  
      },
  
      "http" : {                  --http信息:如果你看到 total_opened 数很大而且还在一直上涨,这是一个明确信号,说明你的 HTTP 客户端里有没启用 keep-alive 长连接的。持续的 keep-alive 长连接对性能很重要,因为连接、断开套接字是很昂贵的(而且浪费文件描述符)。请确认你的客户端都配置正确。
  
      "current_open" : 0,
  
      "total_opened" : 0
  
      },
  
      "breakers" : {               --断路器
  
      "in_flight_requests" : {
  
          "limit_size_in_bytes" : 4151836672,
  
          "limit_size" : "3.8gb",
  
          "estimated_size_in_bytes" : 123,
  
          "estimated_size" : "123b",
  
          "overhead" : 1.0,
  
          "tripped" : 0
  
      },
  
      "fielddata" : {
  
          "limit_size_in_bytes" : 2491102003,
  
          "limit_size" : "2.3gb",
  
          "estimated_size_in_bytes" : 0,
  
          "estimated_size" : "0b",
  
          "overhead" : 1.03,
  
          "tripped" : 0
  
      },
  
      "request" : {
  
          "limit_size_in_bytes" : 1660734668,
  
          "limit_size" : "1.5gb",
  
          "estimated_size_in_bytes" : 0,
  
          "estimated_size" : "0b",
  
          "overhead" : 1.0,
  
          "tripped" : 0
  
      },
  
      "parent" : {
  
          "limit_size_in_bytes" : 2906285670,
  
          "limit_size" : "2.7gb",
  
          "estimated_size_in_bytes" : 123,
  
          "estimated_size" : "123b",
  
          "overhead" : 1.0,
  
          "tripped" : 0
  
      }
  
      },
  
      "script" : {
  
      "compilations" : 0,
  
      "cache_evictions" : 0
  
      }
  
    },
  
    其他节点(略) 。。。。。。
  
}
  
}


页: [1]
查看完整版本: ES的API使用