3

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?`

enter image description here

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
5

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 page

For your information, you should have looked in the sesu-server logs too and posted them here.

  • I actually resolved this at 2AM but went to sleep before posting the answer on here. You are right! I spent so many hours on this as the official documentation looked straightforward until i finally created a new VM and just copy pasted the steps in a poorly made guide that installed using a different repo and installed a slightly older version of sensu. – AirCombat Apr 8 '16 at 7:29
-2

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:

Update /etc/hosts to resolve localhost to 127.0.0.1 instead of ::1.

OR

Update redis.conf to bind to ::1 in addition to 127.0.0.1.

If you're running an IPv6-capable host, the latter option is probably the way to go. Hope this helps!

  • What does it say? – Pierre.Vriens May 11 '16 at 19:45
  • It's better to include the bulk of the relevant details directly in your post/answer; link-only answers are considered very low quality, as links can change/go stale/dead over time. This would leave future readers without the actual answer. – Castaglia May 11 '16 at 22:13
  • The solution is included in my answer. This issue is already linked in my answer. – AirCombat May 13 '16 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.