设为首页 收藏本站
查看: 1070|回复: 0

[经验分享] ElasticSearch (1) REST API -- ES server itself

[复制链接]

尚未签到

发表于 2017-5-21 07:37:54 | 显示全部楼层 |阅读模式
  http://www.elasticsearch.org/
  http://elasticsearch-users.115913.n3.nabble.com/
  https://groups.google.com/forum/?fromgroups=#!forum/elasticsearch
  ##### index settings ##### 
  http://ES_HOST_SERVER:9200/INDEX_NAME/_settings
  #####  pretty format ##### 
  http://ES_HOST_SERVER:9200/153299/_settings?pretty=true
  #####  index status ##### 
  http://ES_HOST_SERVER:9200/153299/_status?pretty=true
  #####  cluster settings ##### 
  http://ES_HOST_SERVER:9200/_cluster/settings?pretty=true
  #####  Cluster Health ##### 
  http://ES_HOST_SERVER:9200/_cluster/health?pretty=true
  #####  cluster state ##### 
  http://ES_HOST_SERVER:9200/_cluster/state?pretty=true
  #####  Cluster Update Settings ##### 
  curl -XPUT ES_HOST_SERVEAR:9200/_cluster/settings -d '{
  "persistent" : {
  "discovery.zen.minimum_master_nodes" : 2
  }
  }'
  #####  Node info ##### 
  http://ES_HOST_SERVER:9200/_cluster/nodes?pretty=true
  #####  local node info ##### 
  http://ES_HOST_SERVER:9200/_cluster/nodes/_local
  ##### node address ##### 
  http://ES_HOST_SERVER:9200/_cluster/nodes/10.49.216.121
  #####  node name ##### 
  http://ES_HOST_SERVER:9200/_cluster/nodes/Eternity
  #####  Nodes Shutdown ##### 
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cluster/nodes/_local/_shutdown'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cluster/nodes/nodeId1,nodeId2/_shutdown'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cluster/nodes/_master/_shutdown'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_shutdown'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cluster/nodes/_shutdown'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cluster/nodes/_all/_shutdown'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cluster/nodes/_local/_shutdown?delay=10s'
  The shutdown API can be disabled by setting action.disable_shutdown in the node configuration.
  #####  Nodes restart ##### 
  curl -XPOST 'http://0.42.108.201:9200/_cluster/nodes/_restart'
  Node can be restated only if the wrapper service is setup.
  ##### Cluster Nodes hot_threads ##### 
  http://ES_HOST_SERVER:9200/_nodes/hot_threads?pretty=true
  #####  mapping ##### 
  #####  get index mapping ##### 
  http://ES_HOST_SERVER:9200/153299/_mapping
  host:port/{index}/{type}/_mapping
  where both {index} and {type} can stand for comma-separated list of names. To get mappings for all indices you can use _all for {index}. The following are some examples:
  http://ES_HOST_SERVEAR:9200/INDEX_NAME,kimchy/_mapping
  http://ES_HOST_SERVEAR:9200/_all/tweet,book/_mapping
  http://ES_HOST_SERVER:9200/_all/_mapping
  http://ES_HOST_SERVER:9200/_mapping
  #####  optimize ##### 
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/kimchy,elasticsearch/_optimize'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_optimize'
  #####  flush index ##### 
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/kimchy,elasticsearch/_flush'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_flush'
  #####  Gateway Snapshot  ##### 
  Note, this API only applies when using shared storage gateway implementation, 
  and does not apply when using the (default) local gateway
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/kimchy,elasticsearch/_gateway/snapshot'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_gateway/snapshot'
  #####  Indices Update Settings ##### 
  #####  Indices Stats ##### 
  http://ES_HOST_SERVER:9200/_stats?pretty=true
  By default, docs, store, and indexing, get, and search stats are returned, other stats can be enabled as well:
  docs: The number of docs / deleted docs (docs not yet merged out). Note, affected by refreshing the index.
  store: The size of the index.
  indexing: Indexing statistics, can be combined with a comma separated list of types to provide document type level stats.
  get: Get statistics, including missing stats.
  search: Search statistics, including custom grouping using the groups parameter (search operations can be associated with one or more groups).
  merge: merge stats.
  flush: flush stats.
  refresh: refresh stats.
  clear: Clears all the flags (first).
  Here are some samples:
  # Get back stats for merge and refresh on top of the defaults
  curl 'ES_HOST_SERVEAR:9200/_stats?merge=true&refresh=true'
  # Get back stats just for flush
  curl 'ES_HOST_SERVEAR:9200/_stats?clear=true&flush=true'
  # Get back stats for type1 and type2 documents for the my_index index
  curl 'ES_HOST_SERVEAR:9200/my_index/_stats?clear=true&indexing=true&types=type1,type2
  #####  Translog ##### 
  Each shard has a transaction log or write ahead log associated with it. It allows to guarantee that when an index/delete operation occurs, it is applied atomically, while not “committing” the internal lucene index for each request. A flush (“commit”) still happens based on several parameters:
  SettingDescription
  index.translog.flush_threshold_opsAfter how many operations to flush. Defaults to 5000.
  index.translog.flush_threshold_sizeOnce the translog hits this size, a flush will happen. Defaults to 500mb.
  index.translog.flush_threshold_periodThe period with no flush happening to force a flush. Defaults to 60m.
  #####  Indices Segments ##### 
  curl -XGET 'http://ES_HOST_SERVEAR:9200/INDEX_NAME/_segments'
  curl -XGET 'http://ES_HOST_SERVEAR:9200/INDEX_NAME1,INDEX_NAME2/_segments'
  curl -XGET 'http://ES_HOST_SERVER:9200/_segments?pretty=true'
  #####  clear catche ##### 
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/INDEX_NAME/_cache/clear'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/INDEX_NAME1,INDEX_NAME2/_cache/clear'
  $ curl -XPOST 'http://ES_HOST_SERVEAR:9200/_cache/clear'
  The API, by default, will clear all cached. Specific caches can be cleaned explicitly by setting filter, field_data or bloom to true.
  #####  Indices Exists ##### 
  curl -XHEAD 'http://ES_HOST_SERVEAR:9200/INDEX_NAME'
  #####  Types Exists ##### 
  curl -XHEAD 'http://ES_HOST_SERVEAR:9200/INDEX_NAME/INDEX_TYPE'

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-379439-1-1.html 上篇帖子: elasticsearch高级配置之线程池设置 下篇帖子: ElasticSearch 源码分析 插件机制
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表