I have been setting up sensu on CentOS7.2 for the first time following the official docs over and over however I have not been able to get it to work:
I cannot seem to connect to the API. Uchiwa gives the error:
ALERT
Datacenter site1 returned:
Connection error. Is the Sensu API running?`
I have tried: curl -I http://localhost:4567/clients
...I do not get a response.
Here is /var/log/sensu/sensu-api.log http://pastebin.com/wHEHE0bH
I have been creating a script to make the setup repeatable. Please see my script below which shows my config: http://pastebin.com/QEt5Msku If you run the script on CentOS7 it should repeat this issue.
Fix:
Issue in answer below. After following a non official guide that successfully installed sensu on a fresh VM, I compared the two setup steps and after a couple of builds on fresh VMs swapping out the steps bit by bit I figured out replacing the repo with one from a non official guide that pointed to a slightly different URL fixed my problem (repo for CentOS6 but it works on 7, it just installs a non current verson 0.20.3).
echo '[sensu]
name=sensu-main
baseurl=http://repos.sensuapp.org/yum/el/6/x86_64/
gpgcheck=0
enabled=1' > /etc/yum.repos.d/sensu.repo
The problem is that sensu 0.23 resolves localhost to an ipv6 address but redis is not listening to the ipv6 address. The solution is to change
"host": "localhost"
to"host": "127.0.0.1"
. There is an issue on Sensus git pageFor your information, you should have looked in the sesu-server logs too and posted them here.
For anyone seeking more info, you can check out the Sensu issue related to this bug. The issue for me was a conflict between the default host resolution on my OS, and the default Redis config as installed from the repo. My solution was: