Serverspec is a Ruby-based system that can run Rspec formatted tests against a host. It can check for a long list of system details and status such as total memory, CPU count, running services, and more, including custom shell callouts. It compares the results of the checks with predefined thresholds and reports a pass or fail condition for each test.
A single test can be as simple as:
describe file('/etc/hadoop/conf/hdfs-site.xml') do
it {should be_file}
end
Or more complex using Ruby plugins, such as Nokogiri for XML parsing in this example:
Most Serverspec-based systems produce a report for a given host and a given set of tests. I needed to query a bunch of hosts, and entire cluster actually. There aren’t as many people doing that as I had thought. The systems usually then dump out a report listing all the errors or produce a set of JSON files with the details for success and failure.
Taking up a notch, Vincent Bernat’s Github project called serverspec-example does almost everything I need, including formatting the JSON into a web accessible report. I can then mouse over or click on the status and get more details. It’s a great example of using serverspec.
I made a few tweaks – querying YARN for a list of nodes instead of predefining nodes in a text file. I also wrote a custom set of checks specifically for HDFS and the hardware. I set some thresholds that are part of a larger effort to make sure system requirements are met for apps I am going to run on the cluster (Actian Vortex SQL Analytics on Hadoop).
Vincent was grouping hosts into certain roles which run different tests and output reports on different tabs (the multi-tab “Disk” example in the screenshot). I don’t need that yet as I am not pre-defining roles but checking across the whole cluster and treating everything as a data node. But I could see doing that at some point when I break out leader nodes and data nodes which will have different requirements for me.
I’m still working on finalising my version of these changes but wanted to share my progress so far and encourage you to try this very productive way of accessing your cluster.
- Geography + Data - July 15, 2021
- DIY Battery – Weekend Project – Aluminum + Bleach? - January 17, 2021
- It’s all about the ecosystem – build and nurture yours - May 1, 2020
- Learnings from TigerGraph and Expero webinar - April 1, 2020
- 4 Webinars This Week – GPU, 5G, graph analytics, cloud - March 30, 2020
- Diving into #NoSQL from the SQL Empire … - February 28, 2017
- VID: Solving Performance Problems on Hadoop - July 5, 2016
- Storing Zeppelin Notebooks in AWS S3 Buckets - June 7, 2016
- VirtualBox extension pack update on OS X - April 11, 2016
- Zeppelin Notebook Quick Start on OSX v0.5.6 - April 4, 2016
No Comments Yet