From 1e25bc514cd2f644b9de72778639a6d2aec44068 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 18 Jan 2022 12:28:47 +0100 Subject: [PATCH 1/4] clusterd: Start netlog received on 'macheteinfach' The individual netlog services send messages from system logfiles (e.g. /var/log/messages), which they consider interesting, to the clusterd of a specific node. The receiving clusterd uses syslog() to log these messages, so they end up in /var/log/message of that node. Let the clusterd of 'macheteinfach' listen to messages from the netlog services instead of that on 'lol'. We use 'macheteinfach', because the only current consumer of these messages is /project/azubi, which happens to run on 'macheteinfach'. This way, this project no longer needs to use ssh to get to the right logfile. --- clusterd/clusterd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clusterd/clusterd b/clusterd/clusterd index 7b78e93..028b121 100755 --- a/clusterd/clusterd +++ b/clusterd/clusterd @@ -2148,7 +2148,7 @@ if (defined $options{'push'}) { My::Select::timeout(rand(60),\&send_stat); My::Select::timeout(0,\&sample_rproc) unless Donald::Tools::is_alpha; $my_hostname eq $STAT_TARGET and My::Cluster::Updown::init(); - $my_hostname eq 'lol' and My::NetlogReceiver::init(); + $my_hostname eq 'macheteinfach' and My::NetlogReceiver::init(); My::Select::timeout(600,\&check_overload); My::Select::run(); From 9b06cb5771548892185dae57db7e83095007fa1a Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 18 Jan 2022 12:34:21 +0100 Subject: [PATCH 2/4] netlog: Send netlog messages to 'macheteinfach' Send 'interesting' messages to the clusterd on macheteinfach instead to that one on 'lol'. See previous commit. --- netlog/netlog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlog/netlog b/netlog/netlog index 11d79e8..e448adf 100755 --- a/netlog/netlog +++ b/netlog/netlog @@ -67,7 +67,7 @@ sub check_idle { sub netlog { my ($log)=@_; unless (defined $send_socket) { - $send_socket=new IO::Socket::INET(PeerAddr=>'lol',PeerPort=>1028) or return; + $send_socket=new IO::Socket::INET(PeerAddr=>'macheteinfach',PeerPort=>1028) or return; } if ($send_socket->send(pack('n',length($log)).$log)) { $send_socket_active=Donald::Select::time(); From 381abcd8b858d76f83729c688b979a9e183adfd4 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 18 Jan 2022 12:53:56 +0100 Subject: [PATCH 3/4] clusterd: Send stat messages to afk Each clusterd sends regular status messages (version and load information) to a single clusterd which currently just collects them for operator review. buczek@macheteinfach:~/git/mxtools (phaseout-lol)$ telnet lol 234 Trying 141.14.29.220... Connected to lol. Escape character is '^]'. clusterd 20220118-124724 stupid console For historical messages, grep "clusterd" from /var/log/messages on lol (or "tail -f /var/log/messages |grep cluster") v abelson : ['DOWN',0,28,'0.01','V1.108 - 20170215-151907',0,'434420.8','4.9.38.mx64.164'] ace : ['UP','95647416.84',1,0,'20220118-124724',0,'921594.24','5.10.70.mx64.403'] acedia : ['UP',0,1,'0.72','20220118-124724','0.00104166666666667','30613821.35','5.10.24.mx64.375'] afk : ['UP','95647391.2',1,'0.1','20220118-124724',0,'5941821.44','4.14.87.mx64.236'] agentwhiskey : ['UP',0,1,'0.07','20220118-124724',0,460800,'5.10.82.mx64.414'] [...] Connection closed by foreign host. The utility of this can be debated and maybe we should remove that completely. Anyway, for now send status messages to "afk" instead of "lol", because "lol" is going to be taken out of commission. --- clusterd/clusterd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clusterd/clusterd b/clusterd/clusterd index 028b121..7121b85 100755 --- a/clusterd/clusterd +++ b/clusterd/clusterd @@ -1243,7 +1243,7 @@ sub loadavg { # AXP : (system load average) , LINUX: (system load average, pl } } -our $STAT_TARGET='lol'; +our $STAT_TARGET='afk'; our $STAT_SEQ=0; sub send_stat { My::Select::timeout_requeue(600); From 86feb86378d290b9999ca11fa423a638d71552e1 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 18 Jan 2022 13:10:09 +0100 Subject: [PATCH 4/4] clusterd: Change area router for 141.14.31.255 to wtf Some of the communications of clusterd is based on ip broadcasts. If the nodes are distributed over multiple ipv4 networks, different nodes need to do the broadcasts, because without special router setups, you can't broadcasts to remote subnets. For this reason, one node is a designated broadcaster for each subnet. This node is called "area router" in the code. Data to be sent to all nodes is sent via unicast to each area router which, in turn, brodcast it to the networks they are resposible for. Move the area router role for network 141.14.16/0 with broadcast address 141.14.31.255 from lol to wtf. --- clusterd/clusterd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clusterd/clusterd b/clusterd/clusterd index 7121b85..5625d04 100755 --- a/clusterd/clusterd +++ b/clusterd/clusterd @@ -1656,8 +1656,7 @@ sub sync_cluster_pw { our %AREA_ROUTER= ( -lol => '141.14.31.255', -# orkrist=> '10.14.0.255', + wtf => '141.14.31.255', ); our $area_socket;