MXS-2481 When Clustrix [un]block health port as well

In the case of Clustrix, it is not sufficient to block the MariaDB
port alone, but the health-check port must be blocked as well.
This commit is contained in:
Johan Wikman 2019-05-22 12:04:08 +03:00
parent 0d3a235851
commit a8487a945a
2 changed files with 29 additions and 0 deletions

View File

@ -87,3 +87,29 @@ int Clustrix_nodes::check_replication()
return res;
}
string Clustrix_nodes::block_command(int node) const
{
string command = Mariadb_nodes::block_command(node);
// Block health-check port as well.
command += ";";
command += "iptables -I INPUT -p tcp --dport 3581 -j REJECT";
command += ";";
command += "ip6tables -I INPUT -p tcp --dport 3581 -j REJECT";
return command;
}
string Clustrix_nodes::unblock_command(int node) const
{
string command = Mariadb_nodes::unblock_command(node);
// Unblock health-check port as well.
command += ";";
command += "iptables -I INPUT -p tcp --dport 3581 -j ACCEPT";
command += ";";
command += "ip6tables -I INPUT -p tcp --dport 3581 -j ACCEPT";
return command;
}

View File

@ -54,4 +54,7 @@ public:
* @return 0 in case of success
*/
int prepare_server(int i);
std::string block_command(int node) const override;
std::string unblock_command(int node) const override;
};