Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Monday, 25 March 2019

How to list all the indices in Elasticsearch ?

For listing all the indices from unix command line, type the following command.

curl -X GET http://eshost:9200/_cat/indices


For checking this from the browser, simply type the following URL in the browser

http://eshost:9200/_cat/indices



Where eshost is the hostname of the elasticsearch server. You can replace it with the IP address of the server also. 9200 is the default port used by elasticsearch

Wednesday, 19 November 2014

Creating Random File of any size in linux

Sometimes we require some random file of some specific size for testing some performance such as file transfer. There are several ways to create such files.

Method 1
If you just want a file with some specific size, you can use the following command.

dd if=/dev/urandom of=dummyfile.txt bs=2G count=1

The bs is the block size, 2G means 2 GB. If you make the count as 2, then 2 GB *2 = 4 GB random file will be generated.

Method 2
If you are concerned about the schema, you can generate the data using a simple approach.
First create a file with a sample data set of 1 or 2 records in a file. Let us call that file name as A.txt

Then using a simple shell script, we can make it very big.



Depending upon the size requirement, you can increase the value of limit to any number.

Method 3
Use any online / offline data generation tools. This will be required only if you need random data with some specific schema and discrete values.
Some useful links are listed below

1) http://www.generatedata.com/
2) http://c2.com/cgi/wiki?TestDataGenerator

How to check the memory utilization of cluster nodes in a Kubernetes Cluster ?

 The memory and CPU utilization of a Kubernetes cluster can be checked by using the following command. kubectl top nodes The above command...