The page Concepts >> Director says, “The director can be run inside of a supervisor as well.”, but goes on to warn of special considerations, “However, child supervisor processes will use the same IP address of the director. etc”
The Concepts section wording suggests that it’s better to not run the Director in a supervisor, but then the only execution instructions are for starting within a supervisor.
What’s the right thing to do here?
What’s the command to start a self-standing Director?
So, the remarks like, “…can be run inside of a supervisor as well…” and “When run in a supervisor…”, are just misleading? Running in a supervisor is the normal, correct way to do it, not a secondary, unusual option?
hab-sup(GS): Starting gossip failure detector
hab-sup(CN): Starting census health adjuster
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
Then I tried …
hab start core/hab-director ./default.toml
…but got…
error: Found argument './default.toml' which wasn't expected, or isn't valid in this context
USAGE:
hab-sup start <pkg_ident_or_artifact> --permanent-peer
For more information try --help
See the “Using the Director” section of the docs [0]. You’ll need to apply the config file via hab config apply after you start the director. We’re working on making this easier in a future release by specifying a toml file as part of the hab start command (like you tried above).
So I just ignore the hemorrhage of error messages ?
you@yourhost:~/projects/todos$ sudo hab start core/hab-director
hab-sup(MN): Starting core/hab-director
hab-sup(TP): Child process will run as user=root, group=hab
hab-sup(GS): Supervisor 192.168.122.198: 9e8f6c94-b42a-4239-98d7-df57ac39fc4f
hab-sup(GS): Census hab-director.default: 47d81527-5d14-43ab-a305-b9c5a5c4e0e8
hab-sup(GS): Starting inbound gossip listener
hab-sup(GS): Starting outbound gossip distributor
hab-sup(GS): Starting gossip failure detector
hab-sup(CN): Starting census health adjuster
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
hab-director(SV): Starting
hab-director(O): No services specified in configuration
hab-sup(SV): hab-director - process 27159 died with exit code 1
hab-sup(SV): hab-director - Service exited
: : :
: : :
: : :
: : :
Ok, so, after some additional help on Slack, I learned that some initial setup is required :
# Make sure we have access to Director
sudo hab install core/hab-director > /dev/null 2>&1;
# Link Director into the Path of the host machine
sudo hab pkg binlink core/hab-director hab-director;
With that in place, I was able to get Director to start two packages with…
# Launch a Director supervised group as defined in ./myGroup.toml
sudo hab-director start -c myGroup.toml;
…where ./myGroup.toml looks like :
# Launch billmeyer.mongodb with --group tutorial and --org your0rg
# Additionally, pass in --permanent-peer to the start command
[cfg.services.billmeyer.mongodb.tutorial.your0rg]
start = "--permanent-peer --strategy at-once"
# Launch the tutorial into the same group and org. No config required
[cfg.services.your0rg.tutorial.tutorial.your0rg]
The next step was to try to change the configuration of the package your0rg/tutorial, using the command hab config apply.
I copied and modified the TOML file, to become ./myGroup_01.toml :
# Launch billmeyer.mongodb with --group tutorial and --org your0rg
# Additionally, pass in --permanent-peer to the start command
[cfg.services.billmeyer.mongodb.tutorial.your0rg]
start = "--permanent-peer --strategy at-once"
# Launch the tutorial into the same group and org. No config required
[cfg.services.your0rg.tutorial.tutorial.your0rg]
port=3033
I applied that new configuration with this command :
» Applying configuration
↑ Applying configuration for hab-director.default into ring via [192.168.122.198:9634]
Joining peer: 192.168.122.198:9634
Failed to create a gossip client for 192.168.122.198:9634
Could not connect to any initial peers; attempt 1 of 10.
Joining peer: 192.168.122.198:9634
Failed to create a gossip client for 192.168.122.198:9634
Could not connect to any initial peers; attempt 2 of 10.
Joining peer: 192.168.122.198:9634
Failed to create a gossip client for 192.168.122.198:9634
Could not connect to any initial peers; attempt 3 of 10.
Obviously, I have specified something incorrectly, but how can I find out which one?
How would one go about incorporating configuring director to run multiple services and kicking it off within the plan/config/hooks of a package? So that when I hab start myapp, the plan/config/hooks within myapp start multiple services with directory?
Hmm. Well, I think the appropriate way of doing that (for now) might be to leverage systemd to call the director so its all preconfigured and can be launched with a simple service call?