Skip to content

Conversation

@dolsem
Copy link

@dolsem dolsem commented Feb 3, 2024

Currently cassandra-migrate does not provide a way to customize cluster options, such as policies for load balancing, address translation (crucial when the cluster is in a private subnet and you need to map internal ips to external hostnames), etc.

This PR adds a way to override cluster options by defining an init file, e.g. cassandra-migrate.init.py, with contents like:

from cassandra.cluster import Cluster
from cassandra.policies import WhiteListRoundRobinPolicy

def create_cluster(**kwargs):
  kwargs['load_balancing_policy'] = WhiteListRoundRobinPolicy(['127.0.0.1'])
  return Cluster(**kwargs)

I'd like to know if there is interest in merging this PR. If there is, I will add tests and documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant