Skip to content

Commit 596d6b3

Browse files
committed
Fix: bootstrap: open corosync ports in firewalld
set default ports 5405 if not set in corosync.conf
1 parent b3fb227 commit 596d6b3

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

crmsh/bootstrap.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,11 @@ def firewall_open_basic_ports():
696696
"""
697697
Open ports for csync2, hawk & dlm respectively
698698
"""
699-
configure_firewall(tcp=["30865", "7630", "21064"])
699+
configure_firewall(tcp=[
700+
constants.CSYNC2_PORT,
701+
constants.HAWK_PORT,
702+
constants.DLM_PORT
703+
])
700704

701705

702706
def firewall_open_corosync_ports():
@@ -711,7 +715,7 @@ def firewall_open_corosync_ports():
711715
Also open QNetd/QDevice port if configured.
712716
"""
713717
# all mcastports defined in corosync config
714-
udp = corosync.get_values("totem.interface.mcastport")
718+
udp = corosync.get_values("totem.interface.mcastport") or [constants.COROSYNC_PORT]
715719
udp.extend([str(int(p) - 1) for p in udp])
716720

717721
tcp = corosync.get_values("totem.quorum.device.net.port")
@@ -724,8 +728,7 @@ def init_cluster_local():
724728
if ServiceManager().service_is_active("corosync.service"):
725729
utils.fatal("corosync service is running!")
726730

727-
# FIXME This is temporarily commentted out since issue from new corosync parser
728-
#firewall_open_corosync_ports()
731+
firewall_open_corosync_ports()
729732

730733
# reset password, but only if it's not already set
731734
# (We still need the hacluster for the hawk).

crmsh/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,4 +520,9 @@
520520
NON_FUNCTIONAL_COMMANDS = {'help', 'cd', 'ls', 'quit', 'up'}
521521
NON_FUNCTIONAL_OPTIONS = {'--help', '--help-without-redirect'}
522522
COROSYNC_STATUS_TYPES = ("ring", "quorum", "qdevice", "qnetd", "cpg")
523+
524+
COROSYNC_PORT = 5405
525+
CSYNC2_PORT = 30865
526+
HAWK_PORT = 7630
527+
DLM_PORT = 21064
523528
# vim:ts=4:sw=4:et:

0 commit comments

Comments
 (0)