Wednesday, February 8, 2017

Elastic search Cluster: Identify Masternode

Use the following queries to identify the master node in an Elasticsearch cluster

There are many ways to identify the master node

Method1:

curl -XGET 'http://localhost:9200/_cat/nodes?pretty=true'

The entry of master node will be denoted by *

xyz.local 100.72.76.15 50 65 0.87 d * xyz

Method2:


1. Get the logical ID of the master node

curl -XGET 'http://localhost:9200/_cluster/state/master_node?pretty=true'

{
  "cluster_name" : "xxxxxx",
  "master_node" : "<Logical ID of master node>"
}

2. From the logical ID of the master_node obtained in step 1, identify the host

curl -XGET 'http://localhost:9200/_nodes/<logical ID of master node>/name?pretty=true'

{
  "cluster_name" : "xxxxxx",
  "nodes" : {
    "<Logical ID of master node" : {
      "name" : "<server_name>",
      "transport_address" : "inet[/100.72.76.19:9300]",
      "host" : "<server FQDN>",
      "ip" : "100.72.76.15",
      "version" : "1.7.1",
      "build" : "b88f43f",
      "http_address" : "inet[/100.72.76.19:9200]"
    }
  }
}

Tuesday, February 7, 2017

Elastic search: Shards and Replicas Performance

1. Having more shards enhances the indexing performance and allows to distribute a big index across machines.

2. Having more replicas enhances the search performance and improves the cluster availability

Monday, February 6, 2017

HTTP status code 200 and 204

The response code 200 literally means "OK" and is the code most often used when responding to a GET request. A POST request, however, may result in code 204 ("No Content") being sent back, meaning "Everything went OK but I don't really have anything to show you."

Ref: https://www.jeffknupp.com/blog/2014/03/03/what-is-a-web-framework/

Thursday, February 2, 2017

Daemon process

Daemon process -
  • detached from its parent, 
  • all standard I/O redirected to /dev/null, and 
  • the current directory changed to the root, / .

Wednesday, February 1, 2017

List files by their size - bash

To list files by their size

ls -Sl

To list top 5 files by their size

ls -S |  head -n 5