<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-11973631</id><updated>2026-08-24T16:50:51.248+05:30</updated><category term="Flex"/><category term="ElasticSearch"/><category term="ActionScript"/><category term="Scala"/><category term="Certificate"/><category term="Logstash"/><category term="TLS"/><category term="Windows"/><category term="Array"/><category term="Java"/><category term="Kafka"/><category term="MPlayer"/><category term="Maven"/><category term="SSL"/><category term="Ubuntu"/><category term="linux"/><category term="Akka"/><category term="Artifact"/><category term="Clearcase"/><category term="Convert"/><category term="Eclipse"/><category term="FlexMojos"/><category term="Menu"/><category term="Regular Expression"/><category term="Security"/><category term="Windows 7"/><category term="install"/><category term="unix"/><category term="AdvancedDataGrid"/><category term="Aggregation"/><category term="Ant"/><category term="Apache POI"/><category term="BouncyCastle"/><category term="Bucket"/><category term="ByteArray"/><category term="Context Menu"/><category term="Crash"/><category term="CruiseControl"/><category term="Curator"/><category term="Currency"/><category term="Cygwin"/><category term="DBTest"/><category term="DataGrid"/><category term="Debugger"/><category term="Digital"/><category term="Disconnect"/><category term="Duplicates"/><category term="Exception"/><category term="Flash"/><category term="Flash Player"/><category term="FlashUnit"/><category term="Google Chrome"/><category term="HierarchicalCollectionView"/><category term="Iteration"/><category term="JUnit"/><category term="JVM"/><category term="Keytool"/><category term="Kibana"/><category term="Log"/><category term="MEncoder"/><category term="MongoDB"/><category term="Nested"/><category term="Number"/><category term="Open Command Window Here"/><category term="OpenSSL"/><category term="OutOfMemory"/><category term="Painless"/><category term="Pattern"/><category term="Performance"/><category term="Pipeline"/><category term="PlayerGlobal"/><category term="Prettyfy"/><category term="Print"/><category term="Remote Desktop"/><category term="Root"/><category term="Ruby"/><category term="SBT"/><category term="Scale"/><category term="Selection"/><category term="Socket"/><category term="Solaris"/><category term="Spark"/><category term="Spray"/><category term="String"/><category term="Sybase IQ"/><category term="TeamCity"/><category term="TextInput"/><category term="ToolTip"/><category term="Trace"/><category term="Truststore"/><category term="Unit test"/><category term="Upgrade"/><category term="Vim"/><category term="Watcher"/><category term="XML"/><category term="XMLList"/><category term="XSLT"/><category term="Zookeeper"/><category term="alpakka"/><category term="bash"/><category term="blog"/><category term="blogger"/><category term="certgen"/><category term="code snippet"/><category term="commands"/><category term="corrupt"/><category term="csv"/><category term="curl"/><category term="cut"/><category term="descendants"/><category term="fat32"/><category term="font"/><category term="index"/><category term="key value"/><category term="kill"/><category term="mac"/><category term="mount"/><category term="nohup"/><category term="openNodes"/><category term="osx"/><category term="parser"/><category term="play"/><category term="preprocessor"/><category term="process"/><category term="profile"/><category term="proxy"/><category term="redirection"/><category term="stream"/><category term="subtitles"/><category term="syntax"/><category term="syntax highlight"/><category term="tab"/><category term="undelete"/><category term="vimrc"/><category term="wget"/><title type='text'>Rahul Singhai Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>66</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11973631.post-2677505081185700244</id><published>2020-12-15T20:45:00.000+05:30</published><updated>2020-12-15T20:45:05.514+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Certificate"/><category scheme="http://www.blogger.com/atom/ns#" term="curl"/><category scheme="http://www.blogger.com/atom/ns#" term="proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="wget"/><title type='text'>wget and curl behind corporate proxy throws certificate is not trusted or certificate doesn&#39;t have a known issuer</title><summary type="text">If you try to run wget or curl in Ununtu/Debian behind corporate proxy, you might receive errors like:


ERROR: The certificate of &#39;apertium.projectjj.com&#39; is not trusted.
ERROR: The certificate of &#39;apertium.projectjj.com&#39; doesn&#39;t have a known issuer.



wget https://apertium.projectjj.com/apt/apertium-packaging.public.gpg
ERROR: cannot verify apertium.projectjj.com&#39;s certificate, issued by &#39;</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/2677505081185700244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/2677505081185700244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2677505081185700244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2677505081185700244'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2020/12/wget-and-curl-behind-corporate-proxy.html' title='wget and curl behind corporate proxy throws certificate is not trusted or certificate doesn&#39;t have a known issuer'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.1277583</georss:point><georss:box>23.197117063821153 -35.284008299999996 79.817584736178844 35.028491700000004</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6722739364807117412</id><published>2019-06-03T21:29:00.001+05:30</published><updated>2019-06-03T21:29:08.127+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><title type='text'>ElasticSearch [FORBIDDEN/12/index read-only / allow delete (api)]</title><summary type="text">While trying to index a document, if ElasticSearch throws following exception:
elasticsearch.exceptions.AuthorizationException: AuthorizationException(403, &#39;cluster_block_exception&#39;, &#39;blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];&#39;)
then, this means that ElasticSearch has cluster-wide locked writes to all indices.

As a temporary solution, you can unlock writes to the cluster (</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6722739364807117412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6722739364807117412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6722739364807117412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6722739364807117412'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2019/06/elasticsearch-forbidden12index-read.html' title='ElasticSearch [FORBIDDEN/12/index read-only / allow delete (api)]'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6318291457127915035</id><published>2018-05-24T20:53:00.000+05:30</published><updated>2018-10-25T20:54:33.471+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="Kafka"/><category scheme="http://www.blogger.com/atom/ns#" term="Security"/><category scheme="http://www.blogger.com/atom/ns#" term="SSL"/><category scheme="http://www.blogger.com/atom/ns#" term="TLS"/><title type='text'>Securing ElasticSearch / Kafka clusters with SSL</title><summary type="text">By default, there is no encryption, authentication, or ACLs configured in Elasticsearch/Kafka. Any client can communicate to ES nodes / Kafka brokers via the PLAINTEXT port. It is critical that access via this port is restricted to trusted clients only. Network segmentation and/or authorization ACLs can be used to restrict access to trusted IPs in such cases. If neither is used, the cluster is </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6318291457127915035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6318291457127915035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6318291457127915035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6318291457127915035'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2018/05/securing-elasticsearch-kafka-clusters.html' title='Securing ElasticSearch / Kafka clusters with SSL'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqiLhz2QYKSMQQw-LGWXpBnV7HW1NzcJOzFD3LsTalHwbMHBO5BvBZe4qi-3GfK5WuXvS7IjN-81F0lDu_CzgPjFDhlU6Knn_qq70zhk5FI2PYXUCE0535_L1Fzqgzqox-EIiT/s72-c/EncryptionAndAuthenticationWithSSL.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-2442228801004149949</id><published>2018-05-06T00:21:00.001+05:30</published><updated>2018-05-06T00:26:02.471+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Logstash"/><title type='text'>Logstash throws error while installing plugins</title><summary type="text">While trying to install logstash plugin, I was getting below error:
$ /work/logstash/logstash-5.5.2/bin/logstash-plugin install logstash-input-cloudwatch
WARNING: A maven settings file already exist at ~/.m2/settings.xml, please review the content to make sure it include your proxies configuration.
Validating logstash-input-cloudwatch
Installing logstash-input-cloudwatch
Error Bundler::</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/2442228801004149949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/2442228801004149949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2442228801004149949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2442228801004149949'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2018/05/logstash-throws-error-while-installing.html' title='Logstash throws error while installing plugins'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6294504578170758124</id><published>2018-01-30T20:29:00.000+05:30</published><updated>2018-07-30T20:30:29.856+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Akka"/><category scheme="http://www.blogger.com/atom/ns#" term="alpakka"/><category scheme="http://www.blogger.com/atom/ns#" term="csv"/><category scheme="http://www.blogger.com/atom/ns#" term="key value"/><category scheme="http://www.blogger.com/atom/ns#" term="parser"/><category scheme="http://www.blogger.com/atom/ns#" term="Scala"/><category scheme="http://www.blogger.com/atom/ns#" term="stream"/><title type='text'>Read and parse CSV containing Key-value pairs using Akka Streams</title><summary type="text">Let&#39;s say we want to read and parse a CSV file containing Key value pairs.
We will be using Alpakka&#39;s CSVParser for this.

A snippet of a file (src/main/resources/CountryNicCurrencyKeyValueMap.csv) that shows mapping from Country NIC code to currency code with pipe (|) as field delimiter:
AD|EUR
AE|AED
AF|AFN
AG|XCD
AI|XCD
AL|ALL
AM|AMD
AN|ANG
AO|AOA
AQ|AQD
AR|ARS
AS|EUR
AT|EUR
AU|AUD
AW|ANG
AX|</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6294504578170758124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6294504578170758124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6294504578170758124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6294504578170758124'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2018/01/read-and-parse-csv-containing-key-value.html' title='Read and parse CSV containing Key-value pairs using Akka Streams'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-420796707769423351</id><published>2018-01-01T17:14:00.000+05:30</published><updated>2018-04-08T18:50:24.267+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kafka"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance"/><category scheme="http://www.blogger.com/atom/ns#" term="Zookeeper"/><title type='text'>Kafka performance tuning</title><summary type="text">Performance Tuning of Kafka is critical when your cluster grow in size. Below are few points to consider to improve Kafka performance:
Consumer group ID: Never use same exact consumer group ID for dozens of machines consuming from different topics.  All of those commits will end up on the same exact partition of __consumer_offsets, hence the same broker, and this might in turn cause performance </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/420796707769423351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/420796707769423351' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/420796707769423351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/420796707769423351'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2018/01/kafka-performance-tuning.html' title='Kafka performance tuning'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-8878171706751809365</id><published>2017-09-29T19:58:00.000+05:30</published><updated>2017-10-06T21:48:21.241+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="Upgrade"/><title type='text'>Migrating ElasticSearch 2.x to ElasticSearch 5.x</title><summary type="text">In my previous blog post, I described how to install and configure an ElasticSearch 5.x cluster.
In this blog post, we will look at how to migrate data.
Consult this table to verify that rolling upgrades are supported for your version of Elasticsearch.

Full cluster upgrade (2.x to 5.x)We will have to do full cluster upgrade and restart.

Install Elasticsearch Migration Helper on old cluster. </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/8878171706751809365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/8878171706751809365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/8878171706751809365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/8878171706751809365'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/09/migrating-elasticsearch-2x-to.html' title='Migrating ElasticSearch 2.x to ElasticSearch 5.x'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6189226992646502120</id><published>2017-09-28T23:24:00.000+05:30</published><updated>2017-10-05T23:28:07.286+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><title type='text'>ElasticSearch max file descriptors too low error</title><summary type="text">ElasticSearch 5.x requires a minimum of Max file descriptors 65536 and Max virtual memory areas 262144.
It throws an error on start-up if these are set to very low value.
ERROR: bootstrap checks failed
max file descriptors [16384] for elasticsearch process is too low, increase to at least [65536]
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Check </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6189226992646502120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6189226992646502120' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6189226992646502120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6189226992646502120'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/09/elasticsearch-max-file-descriptors-too.html' title='ElasticSearch max file descriptors too low error'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-2893957888038632945</id><published>2017-09-28T22:43:00.000+05:30</published><updated>2018-04-08T19:22:55.978+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Curator"/><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><title type='text'>ElasticSearch Curator</title><summary type="text">Curator is a tool from Elastic to help manage your ElasticSearch cluster.
For certain logs/data, we use one ElasticSearch index per year/month/day and might keep a rolling 7 day window of history.
This means that every day we need to create, backup, and delete some indices.
Curator helps make this process automated and repeatable.

InstallationCurator is written in Python, so will need pip to </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/2893957888038632945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/2893957888038632945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2893957888038632945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2893957888038632945'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/09/elasticsearch-curator.html' title='ElasticSearch Curator'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-459288060067196072</id><published>2017-09-28T22:41:00.000+05:30</published><updated>2017-10-05T22:42:26.962+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="certgen"/><category scheme="http://www.blogger.com/atom/ns#" term="Certificate"/><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="SSL"/><category scheme="http://www.blogger.com/atom/ns#" term="TLS"/><title type='text'>ElasticSearch cluster SSL/TLS configuration</title><summary type="text">ElasticSearch X-pack documentation a good description on how to secure your ElasticSearch cluster using SSL/TLS.
I used certgen to generate certificates for all the nodes as below:

Create a&amp;nbsp;instances.yml file:
vim /work/elk/elasticsearch-5.6.2/config/x-pack/instances.yml
instances:
  - name: &quot;hostname-00&quot;
    ip:
      - &quot;192.126.0.163&quot;
      - &quot;192.0.2.2&quot;
      - &quot;198.51.100.1&quot;
    dns:
</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/459288060067196072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/459288060067196072' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/459288060067196072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/459288060067196072'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/09/elasticsearch-cluster-ssltls.html' title='ElasticSearch cluster SSL/TLS configuration'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-4095358712035641569</id><published>2017-09-28T18:15:00.000+05:30</published><updated>2017-10-06T19:56:46.879+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="Kibana"/><category scheme="http://www.blogger.com/atom/ns#" term="Logstash"/><title type='text'>Setting up ELK 5.x (ElasticSearch, Logstash, Kibana) cluster</title><summary type="text">We recently upgraded from ElasticSearch 2.4.3 to 5.6.2.
Below are the steps that we used to install and configure new ELK cluster.

ElasticSearchInstallationmkdir -p /work/elk/data/data-es562
mkdir -p /work/elk/data/logs-es562
mkdir -p /work/elk/data/repo-es562
cd /work/elk/
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.2.tar.gz
tar -zxvf elasticsearch-5.6.2.</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/4095358712035641569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/4095358712035641569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/4095358712035641569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/4095358712035641569'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/09/setting-up-elk-elasticsearch-logstash.html' title='Setting up ELK 5.x (ElasticSearch, Logstash, Kibana) cluster'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6961499142897675480</id><published>2017-09-27T20:26:00.000+05:30</published><updated>2017-10-06T19:56:14.880+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="Logstash"/><category scheme="http://www.blogger.com/atom/ns#" term="TLS"/><title type='text'>A sample Logstash config to connect to ElasticSearch with TLS</title><summary type="text">Following up my previous blog post below is a sample Logstash config that can be used to connect to the ElasticSearch for the output of data:
cd /work/elk/logstash-5.2.6/
vim ./config/twitter_feeds_consumer/twitter_feeds_consumer.conf

input {
  kafka {
    topics =&gt; [&quot;twitter_feeds_kafka_topic_name&quot;]
    bootstrap_servers =&gt; &quot;kafka-broker-1.domain.name:9092,kafka-broker-2.domain.name:9092&quot;
    #</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6961499142897675480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6961499142897675480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6961499142897675480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6961499142897675480'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/09/a-sample-logstash-config-to-connect-to.html' title='A sample Logstash config to connect to ElasticSearch with TLS'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-7271881823669259011</id><published>2017-07-27T20:24:00.000+05:30</published><updated>2018-07-27T22:08:26.006+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="Painless"/><category scheme="http://www.blogger.com/atom/ns#" term="Watcher"/><title type='text'>Aggregation based comparison in Watch condition and hard-coded variables</title><summary type="text">Watch: Compare Vs Script conditionIf you need to do comparisons with aggregation buckets in watchers, then instead of this:
&quot;condition&quot;: {
  &quot;compare&quot;: {
    &quot;ctx.payload.aggregations.agg1.buckets.0.doc_count&quot;: {
      &quot;gte&quot;: 5
    }
  }
}

please prefer this, as this takes care of &quot;Index out of bound&quot; exceptions:
&quot;condition&quot;: {
  &quot;script&quot;: {
    &quot;source&quot;: &quot;return (ctx.payload.aggregations.agg1.</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/7271881823669259011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/7271881823669259011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/7271881823669259011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/7271881823669259011'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2017/07/aggregation-based-comparison-in-watch.html' title='Aggregation based comparison in Watch condition and hard-coded variables'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-7741681106701777233</id><published>2016-10-12T01:30:00.000+05:30</published><updated>2017-05-09T22:25:47.173+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kafka"/><title type='text'>Kafka MirrorMaker in Kafka 0.10.0.1+</title><summary type="text">Check MirrorMaker.scala for more details.
Target cluster setupDownload and install Kafka (target cluster). Select appropriate version and download its tgz from Kafka Downloads page.
tar -zxf kafka_2.11-0.10.0.1.tgz
cd kafka_2.11-0.10.0.1
Configure Target Kafka cluster&#39;s ZooKeeper
vim ./config/zookeeper.properties
# the directory where the snapshot is stored.
dataDir=/work/kafka_2.11-0.10.0.1/</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/7741681106701777233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/7741681106701777233' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/7741681106701777233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/7741681106701777233'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2016/10/kafka-mirrormaker-in-kafka-01001.html' title='Kafka MirrorMaker in Kafka 0.10.0.1+'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-3467467526596327724</id><published>2016-09-29T20:31:00.000+05:30</published><updated>2017-10-05T22:19:29.322+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Certificate"/><category scheme="http://www.blogger.com/atom/ns#" term="Keytool"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenSSL"/><category scheme="http://www.blogger.com/atom/ns#" term="SSL"/><category scheme="http://www.blogger.com/atom/ns#" term="TLS"/><category scheme="http://www.blogger.com/atom/ns#" term="Truststore"/><title type='text'>Generating Multi-Domain (SAN) Certificates</title><summary type="text">The Subject Alternative Name field lets you specify additional host names (sites, IP addresses, common names, etc.) to be protected by a single SSL Certificate, such as a Multi-Domain (SAN) or Extend Validation Multi-Domain Certificate.
Benefits
Secure Host Names on Different Base Domains in One SSL Certificate: A Wildcard Certificate can protect all first-level subdomains on an entire domain, </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/3467467526596327724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/3467467526596327724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/3467467526596327724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/3467467526596327724'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2016/09/generating-multi-domain-san-certificates.html' title='Generating Multi-Domain (SAN) Certificates'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-8953628080668121288</id><published>2016-07-29T21:02:00.000+05:30</published><updated>2017-08-04T22:40:58.023+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Aggregation"/><category scheme="http://www.blogger.com/atom/ns#" term="Bucket"/><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch"/><category scheme="http://www.blogger.com/atom/ns#" term="Pipeline"/><category scheme="http://www.blogger.com/atom/ns#" term="Selection"/><title type='text'>ElasticSearch pipeline bucket selector aggregation</title><summary type="text">ElasticSearch has a concept of bucket selection generated from aggregation.
This works as a pipeline, where first aggregation generates buckets, and then bucket selection further filters out buckets.

We have an ElasticSearch index &#39;daily_reports&#39;, where a row represents a particular version of report.
When a report is created a new row is inserted in the index with a new &#39;reportId&#39; field value </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/8953628080668121288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/8953628080668121288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/8953628080668121288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/8953628080668121288'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2016/07/elasticsearch-pipeline-bucket-selector.html' title='ElasticSearch pipeline bucket selector aggregation'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6071352237108952562</id><published>2015-10-15T00:00:00.000+05:30</published><updated>2018-03-23T16:16:22.185+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Logstash"/><category scheme="http://www.blogger.com/atom/ns#" term="Nested"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby"/><title type='text'>Logstash: Looping through nested JSON in ruby filter</title><summary type="text">Suppose we have a JSON payload (may be a stream coming from Kafka) that looks like this:
{&quot;regionName&quot;:&quot;asia&quot;,&quot;nodes&quot;:[{&quot;node&quot;:&quot;router.dc1.singhaiuklimited.com&quot;,&quot;weight&quot;:&quot;0&quot;},{&quot;node&quot;:&quot;router.dc2.singhaiuklimited.com&quot;,&quot;weight&quot;:&quot;100&quot;}]}
{&quot;regionName&quot;:&quot;asia&quot;,&quot;nodes&quot;:[{&quot;node&quot;:&quot;router.dc1.singhaiuklimited.com&quot;,&quot;weight&quot;:&quot;0&quot;},{&quot;node&quot;:&quot;router.dc1.singhaiuklimited.com&quot;,&quot;weight&quot;:&quot;0&quot;},{&quot;node&quot;:&quot;router.dc2.</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6071352237108952562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6071352237108952562' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6071352237108952562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6071352237108952562'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2015/10/logstash-looping-through-nested-json-in.html' title='Logstash: Looping through nested JSON in ruby filter'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-195706920810991254</id><published>2015-02-25T20:21:00.000+05:30</published><updated>2016-03-03T17:48:16.104+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="osx"/><category scheme="http://www.blogger.com/atom/ns#" term="profile"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Add Environment variables and aliases to Bash on Mac OSX</title><summary type="text">Refrences:
1. http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
2. http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

Add following in ~/.profile (or ~/.bash_profile, or ~/.bashrc, or /etc/profile if you have access):
export JAVA_VERSION=1.8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/195706920810991254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/195706920810991254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/195706920810991254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/195706920810991254'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2008/06/setup-bash-custom-prompt-ps1.html' title='Add Environment variables and aliases to Bash on Mac OSX'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-7003913836957765911</id><published>2014-05-11T20:44:00.000+05:30</published><updated>2017-10-11T21:19:40.371+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB"/><title type='text'>mongoDB</title><summary type="text">
MongoDBA cross-platform open-source document-oriented NoSQL database with an Enterprise level distribution that includes additional security and management features. MongoDB is supported and steered by the company MongoDB.

What do we mean by NoSQL?The NoSQL database category loosely incorporates all databases which do not have a rigid schema and are not queryable via a structured query language</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/7003913836957765911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/7003913836957765911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/7003913836957765911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/7003913836957765911'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2014/05/mongodb.html' title='mongoDB'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Loughborough, UK</georss:featurename><georss:point>52.772099 -1.2061659999999392</georss:point><georss:box>52.6952345 -1.3675274999999392 52.848963499999996 -1.0448044999999393</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-6307975299415582188</id><published>2013-07-01T16:05:00.000+05:30</published><updated>2015-06-29T18:31:07.443+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Scala"/><category scheme="http://www.blogger.com/atom/ns#" term="Spark"/><title type='text'>Spark Tutorial and Cheatsheet</title><summary type="text">Main resources:
Scala Cheat Sheet
Reactive Cheat Sheet
Spark Cheat sheet
Spark Quick start
Spark programming guide
Spark Streaming: processing real-time data streams
Spark SQL and DataFrames: support for structured data and relational queries
MLlib: built-in machine learning library
GraphX: Spark’s new API for graph processing

Scala programming examples:

Define a object with main function -- </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/6307975299415582188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/6307975299415582188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6307975299415582188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/6307975299415582188'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2013/07/spark-tutorial-and-cheatsheet.html' title='Spark Tutorial and Cheatsheet'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-2801551509724376601</id><published>2013-03-16T18:29:00.000+05:30</published><updated>2015-03-16T18:30:35.038+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Scala"/><category scheme="http://www.blogger.com/atom/ns#" term="Spray"/><title type='text'>Making Spray based ReST API publicly / remotely accessible</title><summary type="text">Recently I developed a demo Spray based ReST API and ran it on Windows.
While I was able to access it locally using http://localhost:port/service link, but remotely I was not.
I made following two changes to fix the issue:
1. In your application&#39;s application.conf file make hostname as 0.0.0.0
- 127.0.0.1 or localhost is foe listening only on the loopback interface.
- 0.0.0.0 for listening on all</summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/2801551509724376601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/2801551509724376601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2801551509724376601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2801551509724376601'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2013/03/making-spray-based-rest-api-publicly.html' title='Making Spray based ReST API publicly / remotely accessible'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Loughborough, Loughborough, Leicestershire, UK</georss:featurename><georss:point>52.772099 -1.2061659999999392</georss:point><georss:box>52.6952345 -1.3675274999999392 52.848963499999996 -1.0448044999999393</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-5322026563560997810</id><published>2013-02-16T19:16:00.000+05:30</published><updated>2016-02-16T19:43:26.121+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BouncyCastle"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Security"/><title type='text'>SecurityException with Bouncy Castle</title><summary type="text">I am using BouncyCastle library to encrypt the data transfer with Kakfa.
While my program run fine from IntelliJ, but when I package a fat JAR and run, it throws following exception:

java.lang.SecurityException: JCE cannot authenticate the provider BC
    at javax.crypto.Cipher.getInstance(Cipher.java:657)
    at javax.crypto.Cipher.getInstance(Cipher.java:596)
    at </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/5322026563560997810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/5322026563560997810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/5322026563560997810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/5322026563560997810'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2013/02/securityexception-with-bouncy-castle.html' title='SecurityException with Bouncy Castle'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-2899799701938153516</id><published>2012-10-24T21:10:00.000+05:30</published><updated>2017-10-24T21:10:45.768+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Akka"/><category scheme="http://www.blogger.com/atom/ns#" term="Scala"/><title type='text'>Akka: Printing list of actors</title><summary type="text">To print the list of actors that are running in the actor system, you can add following scheduler that will print actor path every 10 seconds:

import akka.actor.{Actor, ActorIdentity, ActorLogging, ActorRef, Cancellable, Props}

class TestActor extends Actor with ActorLogging {
  private var scheduler: Cancellable = _

  @scala.throws[Exception](classOf[Exception])
  override def preStart(): </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/2899799701938153516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/2899799701938153516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2899799701938153516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/2899799701938153516'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2012/10/akka-printing-list-of-actors.html' title='Akka: Printing list of actors'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>London, UK</georss:featurename><georss:point>51.5073509 -0.12775829999998223</georss:point><georss:box>51.1912379 -0.77320529999998222 51.8234639 0.51768870000001777</georss:box></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-1331727385576189135</id><published>2012-10-11T21:14:00.000+05:30</published><updated>2014-11-04T21:15:15.087+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><category scheme="http://www.blogger.com/atom/ns#" term="Iteration"/><category scheme="http://www.blogger.com/atom/ns#" term="Scala"/><title type='text'>Scala simple concepts</title><summary type="text">A simple iteration over Array in Scala can be done as:
  val xs:Array[String] = Array[String](&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;)
  for((x,i) &lt;- xs.iterator.zipWithIndex) println(i + &quot;th element is &quot; + x)
  for((x,i) &lt;- xs.view.zipWithIndex) println(i + &quot;th element is &quot; + x) 
  for (i &lt;- xs.indices) println(i + &quot;th element is &quot; + xs(i))
  for (i &lt;- 0 until xs.length) println(i + &quot;th element is &quot; + xs(i))
  </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/1331727385576189135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/1331727385576189135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/1331727385576189135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/1331727385576189135'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2012/10/scala-simple-concepts.html' title='Scala simple concepts'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11973631.post-9071799119512723360</id><published>2012-09-19T23:00:00.000+05:30</published><updated>2014-09-04T19:01:28.334+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="kill"/><category scheme="http://www.blogger.com/atom/ns#" term="process"/><category scheme="http://www.blogger.com/atom/ns#" term="SBT"/><category scheme="http://www.blogger.com/atom/ns#" term="Scala"/><title type='text'>Terminating a run or test in Scala Build Tool (SBT)</title><summary type="text">When running a program or test in SBT, if you want to exit from it (and not from SBT) try adding following lines in your build.sbt file:
fork := true

To directly add forking in an SBT session, type
set fork := true

This will not detach and open a new consule from the original sbt console.
But, users can kill this separately.
The way to do this in Max OS or Windows is to search a Java process </summary><link rel='replies' type='application/atom+xml' href='http://rahulsinghai.blogspot.com/feeds/9071799119512723360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/11973631/9071799119512723360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/9071799119512723360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11973631/posts/default/9071799119512723360'/><link rel='alternate' type='text/html' href='http://rahulsinghai.blogspot.com/2012/09/terminating-run-or-test-in-scala-build.html' title='Terminating a run or test in Scala Build Tool (SBT)'/><author><name>Rahul Singhai</name><uri>http://www.blogger.com/profile/17730272205955752967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Bedford, Bedford, UK</georss:featurename><georss:point>52.1359729 -0.46665459999996983</georss:point><georss:box>52.0580089 -0.62801609999996977 52.2139369 -0.30529309999996984</georss:box></entry></feed>