cluster: Rename setup-connections to setup-subscriptions

Now that all the logic about establishing connections among nodes has
moved to the broker policy script, the setup-connections name seems
unfortunate, transition away from it.
This commit is contained in:
Arne Welzel 2025-09-25 18:10:38 +02:00
parent 351bd7b81b
commit d122894d0d
6 changed files with 52 additions and 49 deletions

View file

@ -1,48 +1,3 @@
##! This script establishes communication among all nodes in a cluster
##! as defined by :zeek:id:`Cluster::nodes`.
@deprecated "Remove in v9.1: Load base/frameworks/cluster/setup-subscriptions instead"
@load ./main
@load ./pools
module Cluster;
event zeek_init() &priority=-5
{
if ( getenv("ZEEKCTL_CHECK_CONFIG") != "" )
return;
local self = nodes[node];
for ( i in registered_pools )
{
local pool = registered_pools[i];
if ( node in pool$nodes )
Cluster::subscribe(pool$spec$topic);
}
switch ( self$node_type ) {
case NONE:
return;
case CONTROL:
break;
case LOGGER:
Cluster::subscribe(Cluster::logger_topic);
break;
case MANAGER:
Cluster::subscribe(Cluster::manager_topic);
break;
case PROXY:
Cluster::subscribe(Cluster::proxy_topic);
break;
case WORKER:
Cluster::subscribe(Cluster::worker_topic);
break;
default:
Reporter::error(fmt("Unhandled cluster node type: %s", self$node_type));
return;
}
Cluster::subscribe(nodeid_topic(Cluster::node_id()));
Cluster::subscribe(node_topic(node));
}
@load ./setup-subscriptions