[Bro] Bro cluster requirements and manager logging backlog bug

Hovsep Levi hovsep.sanjay.levi at gmail.com
Fri Jan 6 11:14:21 PST 2017


Here's the problem I'm having so far.  I've included most of the modified
code below.  I think I'm using the wrong data type for logger_str_array ?


[bro at mgr /opt/bro]$ bin/broctl start
starting logger-1 ...
starting logger-2 ...
starting logger-3 (was crashed) ...
starting logger-4 ...
logger-3 terminated immediately after starting; check output with "diag"
logger-2 terminated immediately after starting; check output with "diag"
logger-1 terminated immediately after starting; check output with "diag"
logger-4 terminated immediately after starting; check output with "diag"

==== stderr.log
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 146: not a record (logger-1$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 147: not a record (logger-2$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 148: not a record (logger-3$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 149: not a record (logger-4$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 150: not a record (logger-1$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 151: not a record (logger-2$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 152: not a record (logger-3$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 153: not a record (logger-4$manager)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 22: uninitialized list value ($node_type=Cluster::WORKER,
$ip=10.1.1.1, $zone_id=, $p=47778/tcp, $interface=myri0,
$logger=logger-2$<error> = manager, $proxy=proxy-10)
error in
/opt/bro_data/spool/installed-scripts-do-not-touch/auto/cluster-layout.bro,
line 22: bad record initializer ([$node_type=Cluster::WORKER, $ip=10.1.1.1,
$zone_id=, $p=47778/tcp, $interface=myri0, $logger=logger-2$<error> =
manager, $proxy=proxy-10])



from install.py...

#------------------------------------------------------------------------------------------#
# For using multiple loggers create a unique string for each
# and store in loggers_str_array[].  Reset loggerstr to an empty
# string for the manager definition found in the next section below.
#------------------------------------------------------------------------------------------#
        if loggers:
            # Use the first logger in list, since only one logger is
allowed.
#            logger = loggers[0]
            manager_is_logger = "F"
#            loggerstr = '$logger="%s", ' % logger.name
            loggerstr = ""
            for l in loggers:
                lstr = '$logger="%s"' % l.name
                loggers_str_array.append(lstr)

        else:
            # If no logger exists, then manager does the logging.
            manager_is_logger = "T"
            loggerstr = ""

        ostr = "# Automatically generated. Do not edit.\n"
        ostr += "redef Cluster::manager_is_logger = %s;\n" %
manager_is_logger
        ostr += "redef Cluster::nodes = {\n"



#------------------------------------------------------------------------------------------#
# For the cluster-layout replace the single definition of a logger with
# all loggers defined in loggers[].
#
#------------------------------------------------------------------------------------------#
        # Control definition.  For now just reuse the manager information.
        ostr += '\t["control"] = [$node_type=Cluster::CONTROL, $ip=%s,
$zone_id="%s", $p=%s/tcp],\n' % (util.format_bro_addr(manager.addr),
config.Config.zoneid, broport.use_port(None))

        # Logger definition
#        if loggers:
#            ostr += '\t["%s"] = [$node_type=Cluster::LOGGER, $ip=%s,
$zone_id="%s", $p=%s/tcp],\n' % (logger.name,
util.format_bro_addr(logger.addr), logger.zone_id, broport.use_port(logger))
# Multi-logger setup for testing
# Define an array of loggers for assigning to workers
#
        if loggers:
            for l in loggers:
                ostr += '\t["%s"] = [$node_type=Cluster::LOGGER, $ip=%s,
$zone_id="%s", $p=%s/tcp],\n' % (l.name, util.format_bro_addr(l.addr),
l.zone_id, broport.use_port(l))



#------------------------------------------------------------------------------------------#
# For the workers assign a logger by balancing the total number
# of loggers across the total worker count.
#
# Where loggerstr was previously used loggers_str_array[] is now used
#------------------------------------------------------------------------------------------#

        # Workers definition
        for w in workers:
            p = w.count % len(proxies)
            logger_index = w.count % len(loggers)
#            ostr += '\t["%s"] = [$node_type=Cluster::WORKER, $ip=%s,
$zone_id="%s", $p=%s/tcp, $interface="%s", %s$manager="%s",
$proxy="%s"],\n' % (w.name, util.format_bro_addr(w.addr), w.zone_id,
broport.use_port(w), w.interface, loggerstr, manager.name, proxies[p].name)
            ostr += '\t["%s"] = [$node_type=Cluster::WORKER, $ip=%s,
$zone_id="%s", $p=%s/tcp, $interface="%s", %s$manager="%s",
$proxy="%s"],\n' % (w.name, util.format_bro_addr(w.addr), w.zone_id,
broport.use_port(w), w.interface, loggers_str_array[logger_index],
manager.name, proxies[p].name)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20170106/1b75de98/attachment-0001.html 


More information about the Bro mailing list