I know how to start chef-client with --local mode, but it takes very long to load local repository and everything. I am wondering if I can run chef-client as a long-running service (chef-zero server?) So I can run chef client without starting local-mode server every time.
Asked
Active
Viewed 398 times
1
-
1o_O ??? why not using a real chef-server in this case ? – Tensibai Feb 02 '15 at 08:41
-
local mode is taking forever because ohai is doing a live inventory of your system every time. if you have stuff like nfs mounts, its taking an inventory of all that. still researching a way to stop that. – au_stan Mar 06 '15 at 20:04
2 Answers
2
Yes, you can start a chef-zero server simply using the chef-zero
executable:
# chef-zero
>> Starting Chef Zero (v2.2.1)...
>> WEBrick (v1.3.1) on Rack (v1.5) is listening at http://127.0.0.1:8889
>> Press CTRL+C to stop

StephenKing
- 36,187
- 11
- 83
- 112
-
chef-zero command is not available in last version of Chef client or Chef DK. Do you know any other option to start the daemon? Thanks. – sekrett Aug 26 '16 at 07:16
-
1`chef-solo` recently [switched](https://github.com/chef/chef/pull/4919) to what was `chef-zero` before. I am not entirely sure if it's intended to remove `chef-zero` from the `/opt/chefdk/bin/` folder. It's still contained in `/opt/chefdk/embedded/bin/`, which is not contained in `$PATH`. I wasn't able to spot a commit in 12.13 stating this fact. – StephenKing Aug 26 '16 at 07:24
0
Wonderful, now chef-client can be run in daemon mode, sleep interval is configurable, also you can send USR1 signal to trigger converge immediately. It is all described in documentation: https://docs.chef.io/ctl_chef_client.html

sekrett
- 1,205
- 1
- 15
- 17