Java

I get NoNodeAvailableException on long-running processes using SSL TransportClient with Found.no

This is because Found attaches multiple IPs to your 0298347602938ahdf.us-east-1.aws.found.io hostname. So if you use a TransportClient with ssl on port 9343 and add the first IP you find with client.addTransportAddress(new InetSocketTransportAddress(host, port)), it’ll eventually stop working because it’s stuck with an old, invalid IP. The solution is to lookup all the IPs on the hostname …

I get NoNodeAvailableException on long-running processes using SSL TransportClient with Found.no Read More »

When I index something in Elasticsearch, why doesn’t it show in my search straight after?

I got burnt by this little architectural nuance in Elasticsearch recently. While batch processing items in a content store, updating their status, then searching for more items, I kept getting stale data and didn’t understand why. It turned out that Elasticsearch is _near_ realtime, with a default 1s refresh interval. So if you index and query within …

When I index something in Elasticsearch, why doesn’t it show in my search straight after? Read More »

Centralising Clojure/Java logging with Logback, LogStash, ElasticSearch, and Kibana

Checking logs when you have more than one servers is painful. Use Logback/Logstash-forwarder to send json-formatted logs to a central server running Logstash/ElasticSearch/Kibana, where you can then slice and dice logs to your heart’s content with the power of ElasticSearch and Kibana. Confs and docs available here: https://github.com/vaughnd/centralised-logging

Integrating Logback with Clojure

I’ve uploaded a sample project showing you how to integrate Logback with Clojure. There are simpler Clojure logging libraries like Timbre , but using a standardised Java logging has the handy advantage of letting you control logging from non-clojure code as well as redirecting to separate log files and appenders.