Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(multi-networks): configure scylla correctly with the right interface #9500

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
from sdcm.provision.helpers.certificate import (
create_ca, install_client_certificate, install_encryption_at_rest_files, create_certificate,
export_pem_cert_to_pkcs12_keystore, CA_CERT_FILE, CA_KEY_FILE, JKS_TRUSTSTORE_FILE, TLSAssets)
from sdcm.provision.network_configuration import network_interfaces_count
from sdcm.remote import RemoteCmdRunnerBase, LOCALRUNNER, NETWORK_EXCEPTIONS, shell_script_cmd, RetryableNetworkException
from sdcm.remote.libssh2_client import UnexpectedExit as Libssh2_UnexpectedExit
from sdcm.remote.remote_long_running import run_long_running_cmd
Expand Down Expand Up @@ -3030,6 +3031,9 @@ def disable_daily_triggered_services(self):

def get_nic_devices(self) -> List:
"""Returns list of ethernet network interfaces"""
if self.scylla_network_configuration:
return [self.scylla_network_configuration.device]

result = self.remoter.run('/sbin/ip -o link show |grep ether |awk -F": " \'{print $2}\'', verbose=True)
return result.stdout.strip().split()

Expand Down Expand Up @@ -4723,6 +4727,9 @@ def node_setup(self, node: BaseNode, verbose: bool = False, timeout: int = 3600)
node.clean_scylla_data()
node.remoter.sudo(cmd="rm -f /etc/scylla/ami_disabled", ignore_status=True)

if network_interfaces_count(self.params) > 1:
node.run_scylla_sysconfig_setup()

if append_scylla_node_exporter_args := self.params.get('append_scylla_node_exporter_args'):
configuration_file = '/etc/default/scylla-node-exporter'
with remote_file(remoter=node.remoter,
Expand Down
6 changes: 6 additions & 0 deletions sdcm/provision/scylla_yaml/node_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ def broadcast_address(self) -> Optional[str]:
return self._public_ip_address
return None

@property
def listen_interface(self):
if self.node.scylla_network_configuration:
return self.node.scylla_network_configuration.device
return None

@property
def enable_ipv6_dns_lookup(self) -> bool:
return self._is_ip_ssh_connections_ipv6
Expand Down
1 change: 1 addition & 0 deletions sdcm/provision/scylla_yaml/scylla_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Config: # pylint: disable=too-few-public-methods
broadcast_address: str = None # ""
api_port: int = None # 10000
api_address: str = None # ""
listen_interface: str = None # "eth0"
ssl_storage_port: int = None # 7001
background_writer_scheduling_quota: float = None # 1.0
auto_adjust_flush_quota: bool = None # False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"enable_ipv6_dns_lookup": true,
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth1",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"enable_ipv6_dns_lookup": false,
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"listen_interface": "eth1",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
"alternator_enforce_authorization": false,
"auto_bootstrap": true,
"enable_ipv6_dns_lookup": false,
"listen_interface": "eth0",
"hinted_handoff_enabled": false
}
4 changes: 2 additions & 2 deletions unit_tests/test_scylla_yaml_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def network_interfaces(self):
dns_private_name="",
dns_public_name="",
device_index=0,
device_name='',
device_name='eth0',
mac_address=''
),
NetworkInterface(ipv4_public_address=None,
Expand All @@ -469,7 +469,7 @@ def network_interfaces(self):
dns_private_name="",
dns_public_name="",
device_index=1,
device_name='',
device_name='eth1',
mac_address=''
)
]
Expand Down