Skip to content

Instantly share code, notes, and snippets.

@downspot
Last active November 26, 2023 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save downspot/fcbabea3aa5eecc5d6979bce726a7075 to your computer and use it in GitHub Desktop.
Save downspot/fcbabea3aa5eecc5d6979bce726a7075 to your computer and use it in GitHub Desktop.
DataStax Cassandra
- disable nodesync
nodesync disable
- run repair
nodetool repair --full
(optional nodetool repair -j ‘max 4 threads’ -pr to reduce
pressure on cluster full repair, run one node at a time)
- verify network topology and replication factor change if needed
for i in `cqlsh $(hostname) -e 'DESC KEYSPACES' | xargs` ; do cqlsh
$(hostname) -e 'DESC KEYSPACE '$i'' | grep "CREATE KEYSPACE" ; done
- update DSE and Opscenter (on existing cluster)
yum -y update dse-full (one node at a time and verify after startup)
/etc/init.d/dse start
tail -f /var/log/cassandra/system.log (verify logs)
yum -y update opscetner
tail -f /var/log/cassandra/opscenter.log (verify logs)
- add nodes into Opscenter (install and configuration)
yum -y install dse-full
either done with Opscetner (preferred way) or copy /etc/dse to new
nodes and modfiy configs /etc/dse/cassandra/cassandra.yaml &
/etc/dse/cassandra/cassandra-rackdc.properties
- start DSE
/etc/init.d/dse start
- verify logs
tail -f /var/log/cassandra/system.log
- alter keyspace to reflect new DC
cqlsh $(hostname) -e "ALTER KEYSPACE foo WITH replication = {'class':
'NetworkTopologyStrategy', 'us-east-1': '3', ‘us-west-2': 3};"
- run rebuild from old DC and verify
nodetool rebuild -- datacenter_name
nodetool netstats
diff <(nodetool -h localhost netstats) <(sleep 5 && nodetool -h
localhost netstats)
- enable nodesync
nodesync enable
Reference:
https://docs.datastax.com/en/dse/6.8/dse-admin/datastax_enterprise/operations/opsAddDCToCluster.html
sstableloader:
This option should be used if the cluster topology is different.
Doc link: https://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/tools/toolsSStables/toolsBulkloader.html
nodetool refresh:
In this case the toptology needs to be identical i.e DC, number of nodes and racks should be similar.
Doc link: https://docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/operations/opsSnapshotRestoreNewCluster.html
allocate_tokens_for_local_replication_factor: 3
https://docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterpise/operations/opsAddDCToClusterDesigDC.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment