mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00

This is based on commit 2731def9159247e6da8a3191783c89683363689c from the zeek-docs repo.
28 lines
821 B
Text
28 lines
821 B
Text
event zeek_init()
|
|
{
|
|
if ( ! Supervisor::is_supervisor() )
|
|
return;
|
|
|
|
Broker::listen("127.0.0.1", 9999/tcp);
|
|
|
|
local cluster: table[string] of Supervisor::ClusterEndpoint;
|
|
cluster["manager"] = [$role=Supervisor::MANAGER, $host=127.0.0.1, $p=10000/tcp];
|
|
cluster["logger"] = [$role=Supervisor::LOGGER, $host=127.0.0.1, $p=10001/tcp];
|
|
cluster["proxy"] = [$role=Supervisor::PROXY, $host=127.0.0.1, $p=10002/tcp];
|
|
cluster["worker"] = [$role=Supervisor::WORKER, $host=127.0.0.1, $p=10003/tcp, $interface="en0"];
|
|
|
|
for ( n, ep in cluster )
|
|
{
|
|
local sn = Supervisor::NodeConfig($name=n);
|
|
sn$cluster = cluster;
|
|
sn$directory = n;
|
|
|
|
if ( ep?$interface )
|
|
sn$interface = ep$interface;
|
|
|
|
local res = Supervisor::create(sn);
|
|
|
|
if ( res != "" )
|
|
print fmt("supervisor failed to create node '%s': %s", n, res);
|
|
}
|
|
}
|