I find myself running more and more Cassandra clusters and when we were on Chef 0.9.8 I was being lazy and just cloning my Cassandra cookbook per cluster. Not exactly a way to scale the manageability of your config
Now I’ve refactored the cookbook to allow me to manage multiple clusters by extracting the
initial_token from a databag. Once we start implementing the new Environments feature in Chef 0.10 I’ll be able to simplify this further.
I’m debating having the cookbook auto-generate tokens and assign them as well as re-generate/nodetool move/re-balance when I’ve added another node with that cluster specified in the databag. That’s a big project and for now I’m too much of a control freak to automate that, but I’m thinking on it.
I’ve also made it so the cookbook auto-generates the
cassandra-topology.properties for the
PropertyFileSnitch based off of location info stored in the databag.
Finally upgraded to Chef 0.10.6 from 0.9.8.
Hot, sweet, environments and encrypted data bag action.
Except… well… the chef-client would ocassionally die… quetly.
No log, no debug output, no exit codes, just poof… no more chef-client daemon.
(This is not the point there you guys tell me I should use cron or runit or daemontools or something to run chef, I’ve heard it)
The lovely folks at Opscode said that running on ruby 1.8.7 rather than ruby 1.9.2 was the culprit and then drew my attention to the super-happy-awesome Opscode Chef Omnibus installer here (avaliable as rpms, debs, tgz, etc..)
It installs (almost) everything you need into /opt and lets Chef run in it’s own ‘embedded’ ruby 1.9.2 environment keeping my system ruby clean.
So, expanding upon my previous post, I wrote a simple python script that would kill all queries running on a MySQL instance based on a host wildcard or runtime of a query.
Yes, yes, I know about mk-kill, but I enjoy writing little scripts. Writing trivial scripts is always a great way to get better.
Lets talk about Cassandra maintenance.
Nothing crazy here… these are just some notes I jotted down for folks I work with explaining a cronjob I put into production as well as providing the simple script. Thought some other people might benefit.
Went to Staples the other day to grab some assorted accessories for work and I saw they had some Brookstone USB Desktop Missile Launchers in the clearence section, so I grabbed one.
What fun, I thought. Plugged it into my work desktop (running LinuxMint Debian Edition) only to find there were no linux drivers for this particular device.
This turned into a nice little weekend project
For some internal notification system I was attempting to write a script that would occasionally clear a list in Bronto, our email delivery platform.
They have a lovely little SOAP API, but almost all of the examples were in PHP or Java. Since I am running this as a cronjob, and me being more of a Pythonist, I thought Python was a better place for me to implement this.
The Bronto team, while not terribly proficient in Python, were as helpful as they could be. My major stumbling blocks were getting the authentication mechanism to work correctly, then it took a while to discover how to properly pass arguments to the API.
Eventually I’ll do more stuff with it, but for now, I thought I’d publish this in case it might be useful for someone else using Python with thier API.
Code starts below. Mind you, I am not a developer, be kind