I need help getting Riak to work with Chef.
Currently every time I chef an amazon box with Riak 1.4.8 using the default basho riak cook book I have to manually ssh into the machine kill -9 the beam.smp process then rm -rf /var/lib/riak/ring then I can finally do sudo riak start and it will work.
Prior to that I get:
Node 'riak@' not responding to pings.
I have even created a shell script:
#!/bin/bash
# Generated by Chef for <%= @node[:fqdn] %>
#<%= @node[:ec2][:local_ipv4] %>
# This script should be run by root.
riak stop
riakPid="/var/run/riak/riak.pid"
if [ -e "$riakPid" ]; then
kill -9 $(<${riakPid})
fi
rm -f /var/run/riak/*
rm -f /var/lib/riak/ring/*
riak start
And Chef says:
bash[/etc/riak/clearOldRiakInfo.sh] ran successfully
For the above script.
If I manually run that script everything works fine. Why is this not cheffing properly.
UPDATE: This has been solved by creating a script to delete the ring directory when the machine gets cheffed.
This would only happen when I would create a new machine from scratch as the fqdn would get set correctly after Riak had started and created the ring. If I manually went on the box and deleted the ring then it would rechef perfectly fine. So I have to create the script so that the very first chef run on the machine would clean out the ring info.