Random thoughts of a warped mind…

September 17, 2014

Reconfig for service discovery

Filed under: Amazon EC2,Chef,Git,Linux,Redhat OpenShift,Ruby,Virtualization — Srinivas @ 09:49

Imagine a constantly changing fleet of servers… New servers (or virtual machines) going online as capacity is needed or being taken offline as load drops… Maybe you already use Chef/Puppet to bootstrap your servers and use their node attributes to populate N servers in a load balancer (Haproxy for example) configuration. 

Now adding/removing a new server (a backend, maybe a rails/tomcat server, whatever) would mean that chef-client has to run on all the haproxy boxes so they know about the new backend (or the one that went away). This would work if you  run chef-client every 5 minutes or so? But why? Chef/Puppet are primarily meant to bootstrap your servers and not to sync state. Enter Reconfig and service discovery.

(more…)

August 4, 2014

PubKey for SSH public key setup

Filed under: Amazon EC2,Chef,Linux,Redhat OpenShift,Virtualization — Srinivas @ 13:13

Built and started using PubKey for managing user SSH public keys (add, update and revoke access) on my personal EC2 and Google compute fleet… Try it out – https://www.pubkey.in/console/ . Docs available on http://docs.pubkey.in and for you lazy sysads, there is a Chef cookbook available too from https://github.com/onepowerltd/pkagent_cookbook :-)

 

 

August 13, 2013

Dump http requests in-transit with tcpdump

Filed under: All,Amazon EC2,Linux,Virtualization — Srinivas @ 14:57

Note to self -

tcpdump -A -s 0 ‘tcp port 80 and (((ip[2:2] – ((ip[0]&0xf)<<2)) – ((tcp[12]&0xf0)>>2)) != 0)’

Handy on haproxy/varnish boxes to see requests/responses in realtime for debugging on-the-fly… As opposed to having to dump to trace file and analyzing off-server with wireshark or similar…

August 2, 2013

Cloudfront woes – “Your request contains one or more invalid invalidation paths.” – Use custom regexp for URI::encode

Filed under: All,Amazon EC2,EC2,Linux,Ruby — Srinivas @ 12:27

AWS Cloudfront is a content delivery network part of Amazons EC2/AWS stack which lets you serve static assets from a source (S3 bucket or custom origin server) by caching it across numerous edge locations. Occassionally the underlying content can change which needs the cache to be refreshed – This is done via a Cloudfront cache invalidation request which specifies a distribution id and a list of paths to refresh (e.g. /index.html or /imgs/logo.png etc).

(more…)

May 24, 2013

Sinatra app on Redhats OpenShift PaaS

Filed under: Development,EC2,Git,Linux,Redhat OpenShift,Ruby,Virtualization — Srinivas @ 02:08

Got to poke around a bit today into Redhats Open Shift PaaS… This is quite similar to Herokus platform in the sense you could pick up a “dev platform”, build an app locally and push it to the PaaS and run it from there…

For the impatient, rush over to the App on Openshift and  pull the code from github

(more…)

Older Posts »

Powered by WordPress