Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README with what has changed #201

Closed
johnbellone opened this Issue Jul 25, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@johnbellone
Copy link
Contributor

johnbellone commented Jul 25, 2015

No description provided.

@johnbellone johnbellone modified the milestones: 0.10.2, 1.0.0 Jul 25, 2015

@johnbellone johnbellone closed this Aug 6, 2015

@johnbellone johnbellone reopened this Aug 6, 2015

@csghuser

This comment has been minimized.

Copy link

csghuser commented Aug 12, 2015

Would it be possible to amend the readme with example configuration for setting up a consul server vs setting up a consul agent? I've just switched to version 1.0.0 and finding my old wrapper cookbook no longer works, but I'm not entirely sure how this is done with this latest version.

Documentation regarding multiple checks for a single service would also be very much appreciated

Thanks

@johnbellone

This comment has been minimized.

Copy link
Contributor Author

johnbellone commented Aug 12, 2015

Take a look at the basic usage that i just updated. Let me know if there are any other questions!

@csghuser

This comment has been minimized.

Copy link

csghuser commented Aug 13, 2015

Many thanks for that, that seems to be setting up the config fine now. Although, testing with a docker Centos 6.6 image, it seems to be having problems configuring the consul service. I get this error when trying to converge:

[2015-08-13T07:00:53+00:00] ERROR: consul_service[consul] (consul::default line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: poise_service[consul] (/tmp/kitchen/cookbooks/consul/recipes/default.rb line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: service[consul] (/tmp/kitchen/cookbooks/consul/recipes/default.rb line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'

It appears to attempt to setup an init script with the following line:

cd "/var/lib/consul" && daemon --user "consul" --pidfile "/var/run/consul.pid" "/usr/bin/env consul agent -config-file=/etc/consul.json -config-dir=/etc/consul" >/dev/null 2>&1 ) &

If I try to run this manually, I get:

/usr/bin/env: consul: No such file or directory

It appears that consul is not in the current path. The init script sets up the path as:

export PATH="/usr/local/bin:/usr/bin:/bin"

However the consul binary is here:

/srv/consul/0.5.2

I don't think Centos 6.5 is supported, but I have tried to run it within a virtual machine (non docker), and when I do no init script is created, it appears to start consul in a different way.

@johnbellone

This comment has been minimized.

Copy link
Contributor Author

johnbellone commented Aug 13, 2015

I'll give it a run.

@csghuser

This comment has been minimized.

Copy link

csghuser commented Aug 13, 2015

Seems to work ok with just

      def command
        "consul agent -config-file=#{config_file} -config-dir=#{config_dir}"
      end

(removing the env part)

@csghuser

This comment has been minimized.

Copy link

csghuser commented Aug 13, 2015

Going back to the issue of having multiple checks for a service (using the example at the bottom of this page https://consul.io/docs/agent/checks.html), prior to version 1.0.0 I was able to use multiple checks in the following way:

consul_check_def node['consul_agent']['service_name'] do
    id 'disk-util'
    name 'Disk Util'
    notes 'Critical 95%, warning 90% used'
    script '/usr/local/bin/check_disks.sh -v / -c 95 -w 90'
    interval '1m'
    notifies :reload, 'service[consul]'
end

consul_check_def node['consul_agent']['service_name'] do
    id 'cpu-load'
    name 'CPU Load'
    notes 'Auto detects load/cpus'
    script '/usr/local/bin/check_load.sh -a'
    interval '1m'
    notifies :reload, 'service[consul]'
end

If I use the same approach now, with the new syntax, it simply overwrites the Disk check and all I have remaining is the CPU check.

Based on the example above from the consul website, would it be possible for us to having the following syntax for multiple services?

consul_definition node['consul_agent']['service_name'] do
  type 'checks'
  parameters(
    {
            id: 'disk-util',
            name: 'Disk Util',
            notes: 'Critical 95%, warning 90% used',
            script: '/usr/local/bin/check_disks.sh -v / -c 95 -w 90',
            interval: '1m'
    },
    {
            id: 'cpu-load',
            name: 'CPU Load',
            notes: 'Auto detects load/cpus',
            script: '/usr/local/bin/check_load.sh -a',
            interval: '1m'
    }
  )
    notifies :reload, 'consul_service[consul]',:delayed
end

If I try that now I get:

ERROR: Option type must be equal to one of: check, service!  You passed "checks".

Thanks for your help with this, it is very much appreciated.

@scalp42

This comment has been minimized.

Copy link
Contributor

scalp42 commented Aug 27, 2015

@csghuser I opened #212 if you can try

@johnbellone johnbellone closed this Dec 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.