Saturday, December 8, 2018

Some Handy Elassandra Commands

Some of the Elassandra handy statements.

1) Verify Elassandra/ElasticSerach is running.
curl http://127.0.0.1:9200

2) Health status of node.
curl -X GET "127.0.0.1:9200/_cat/health?v"

3) List of nodes and its load:
curl -X GET "127.0.0.1:9200/_cat/nodes?v"

4) Listing all indices.
curl -X GET "127.0.0.1:9200/_cat/indices?v"

5) Delete Index.
curl -XDELETE 'http://127.0.0.1/index_name'

6) Rebuild Index.
nodetool rebuild_index keyspace_name table_name elastic_<table_name>_idx

7) File Descriptors:
curl -X GET "127.0.0.1:9200/_nodes/stats/process?filter_path=**.max_file_scriptors&pretty"
In limits.conf keep nofile to higher values. (/etc/security/limits.conf)

8) Checking how many search contexts are open  --depends on file descriptors.
curl -X GET "127.0.0.1:9200/_nodes/stats/indices/search?pretty"

9) Deleting _all search contexts -- depends on file descriptors
curl -X DELETE "127.0.0.1:9200/_search/scroll/_all"

10) Get Mapping & Setting Details:
curl -X GET "127.0.0.1:9200/index_name/_mapping?pretty"
curl -X GET "127.0.0.1:9200/index_name/_settings?pretty"

11) Flush the segments
curl -X POST "127.0.0.1:9200/_flush"

12) Updating settings (similar to analyzers but close and open).
curl -X PUT "127.0.0.1:9200/index_name/_settings" -H 'Content-Type: application/json' -d '
{
     "index" : {
          "refresh_interval" : "2s"
     }
}
'

13) Master/Node details
curl -X GET "127.0.0.1:9200/_cat/master?v"
v=> Verbose

14) Help
curl -X GET "127.0.0.1:9200/_cat/master?help"

15) Headers.
curl -X GET "127.0.0.1:9200/_cat/nodes?h=ip,port,heapPercent,name"

16) Numeric Formats.
curl -X GET "127.0.0.1:9200/_cat/indices?bytes=b&pretty" -H "Accept: application/json" | sort -rnk8

Here, 8=> * column
bytes, time, size can be sorted.

***

No comments:

Post a Comment