mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This is a preliminary implementation of a subset of the functionality set out in our cluster controller architecture. The controller is the central management node, existing once in any Zeek cluster. The agent is a node that runs once per instance, where an instance will commonly be a physical machine. The agent in turn manages the "data cluster", i.e. the traditional notion of a Zeek cluster with manager, worker nodes, etc. Agent and controller live in the policy folder, and are activated when loading policy/frameworks/cluster/agent and policy/frameworks/cluster/controller, respectively. Both run in nodes forked by the supervisor. When Zeek doesn't use the supervisor, they do nothing. Otherwise, boot.zeek instructs the supervisor to create the respective node, running main.zeek. Both controller and agent have their own config.zeek with relevant knobs. For both, controller/types.zeek provides common data types, and controller/log.zeek provides basic logging (without logger communication -- no such node might exist). A primitive request-tracking abstraction can be found in controller/request.zeek to track outstanding request events and their subsequent responses.
33 lines
995 B
Text
33 lines
995 B
Text
@load base/frameworks/supervisor/control
|
|
@load policy/frameworks/cluster/controller/types
|
|
|
|
module ClusterAgent::API;
|
|
|
|
export {
|
|
const version = 1;
|
|
|
|
# Agent API events
|
|
|
|
global set_configuration_request: event(reqid: string,
|
|
config: ClusterController::Types::Configuration);
|
|
global set_configuration_response: event(reqid: string,
|
|
result: ClusterController::Types::Result);
|
|
|
|
# Notification events, agent -> controller
|
|
|
|
# Report agent being available.
|
|
global notify_agent_hello: event(instance: string, host: addr,
|
|
api_version: count);
|
|
|
|
# Report node state changes.
|
|
global notify_change: event(instance: string,
|
|
n: ClusterController::Types::Node,
|
|
old: ClusterController::Types::State,
|
|
new: ClusterController::Types::State);
|
|
|
|
# Report operational error.
|
|
global notify_error: event(instance: string, msg: string, node: string &default="");
|
|
|
|
# Report informational message.
|
|
global notify_log: event(instance: string, msg: string, node: string &default="");
|
|
}
|