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 · 8 comments
Closed

Update README with what has changed #201

johnbellone opened this issue Jul 25, 2015 · 8 comments
Milestone

Comments

@johnbellone
Copy link
Contributor

No description provided.

@johnbellone johnbellone modified the milestones: 0.10.2, 1.0.0 Jul 25, 2015
@johnbellone johnbellone reopened this Aug 6, 2015
@csghuser
Copy link

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
Copy link
Contributor Author

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

@csghuser
Copy link

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
Copy link
Contributor Author

I'll give it a run.

@csghuser
Copy link

Seems to work ok with just

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

(removing the env part)

@csghuser
Copy link

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
Copy link
Contributor

scalp42 commented Aug 27, 2015

@csghuser I opened #212 if you can try

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants