More cluster framework fixes for BroControl.

This commit is contained in:
Seth Hall 2011-07-15 01:11:37 -04:00
parent 3c7f7d571c
commit 5245e6596c
6 changed files with 15 additions and 14 deletions

View file

@ -3,6 +3,12 @@
@if ( Cluster::node != "" ) @if ( Cluster::node != "" )
# Give the node being started up it's peer name.
redef peer_description = Cluster::node;
# Add a cluster prefix.
@prefixes += cluster
# Only load the communication framework if it really looks like someone is # Only load the communication framework if it really looks like someone is
# trying to start up a cluster node. # trying to start up a cluster node.
@load frameworks/communication @load frameworks/communication

View file

@ -62,9 +62,6 @@ export {
const node = getenv("CLUSTER_NODE") &redef; const node = getenv("CLUSTER_NODE") &redef;
} }
# Give the node being started up it's peer name.
redef peer_description = Cluster::node;
event bro_init() event bro_init()
{ {
if ( node != "" && node !in nodes ) if ( node != "" && node !in nodes )

View file

@ -1,4 +1,4 @@
##! This is the core Bro script support for the notion of a cluster manager. ##! This is the core Bro script to support the notion of a cluster manager.
##! ##!
##! The manager is passive (the workers connect to us), and once connected ##! The manager is passive (the workers connect to us), and once connected
##! the manager registers for the events on the workers that are needed ##! the manager registers for the events on the workers that are needed
@ -7,15 +7,14 @@
##! This is where the cluster manager sets it's specific settings for other ##! This is where the cluster manager sets it's specific settings for other
##! frameworks and in the core. ##! frameworks and in the core.
@prefixes += cluster-manager
## Turn off remote logging since this is the manager and should only log here. ## Turn off remote logging since this is the manager and should only log here.
redef Log::enable_remote_logging = F; redef Log::enable_remote_logging = F;
## Use the cluster's archive logging script. ## Use the cluster's archive logging script.
redef Log::default_rotation_postprocessor = "archive-log"; redef Log::default_rotation_postprocessor = "archive-log";
## The cluster manager does not capture packets.
redef interfaces = "";
## We're processing essentially *only* remote events. ## We're processing essentially *only* remote events.
redef max_remote_events_processed = 10000; redef max_remote_events_processed = 10000;

View file

@ -1,6 +1,5 @@
## No packet capture on proxy. @prefixes += cluster-proxy
redef interfaces = "";
## The proxy only syncs state; does not forward events. ## The proxy only syncs state; does not forward events.
redef forward_remote_events = F; redef forward_remote_events = F;

View file

@ -1,4 +1,6 @@
@prefixes += cluster-worker
## Don't do any local logging. ## Don't do any local logging.
redef Log::enable_local_logging = F; redef Log::enable_local_logging = F;
@ -11,3 +13,6 @@ redef Log::default_rotation_postprocessor = "delete-log";
## Record all packets into trace file. ## Record all packets into trace file.
# TODO: should we really be setting this to T? # TODO: should we really be setting this to T?
redef record_all_packets = T; redef record_all_packets = T;
# TODO: Workers need to have a filter for the notice log which doesn't
# do remote logging since we forward the notice event directly.

View file

@ -15,11 +15,6 @@ event bro_init() &priority=9
Communication::nodes["control"] = [$host=n$ip, $connect=F, Communication::nodes["control"] = [$host=n$ip, $connect=F,
$class="control", $events=control_events]; $class="control", $events=control_events];
# The node being started up is this node so we create a dummy
# communication entry to point at this host for control.
if ( i == node )
Communication::nodes[i] = [$host=n$ip, $p=n$p, $connect=F, $class="control", $sync=F];
if ( me$node_type == MANAGER ) if ( me$node_type == MANAGER )
{ {
if ( n$node_type == WORKER && n$manager == node ) if ( n$node_type == WORKER && n$manager == node )