Skip to content

Instantly share code, notes, and snippets.

@ibspoof
ibspoof / restore_node_from_opscenter_backups.ini
Last active February 22, 2019 16:04
Restore a single nodes SSTables from OpsCenters S3 Backup Location using multi-threaded downloads
[s3]
#s3 bucket name
bucket_name = my_backups
download_threads = 6
# other s3 access is defined in the default aws cli settings file
[opscenter]
backup_job_uuid = # get this from s3 bucket
[node]
@ibspoof
ibspoof / nodetool_diff.py
Last active December 28, 2019 00:22
nodetool tablestat difference tool
#!/usr/bin/env python
import re
import sys
REGEX_KEYSPACE = re.compile(r'^Keyspace: (.*)|^Keyspace : (.*)')
REGEX_TABLE = re.compile(r'^\t\tTable: (.*)')
REGEX_READ_CNT = re.compile(r'^\t\tLocal read count: (.*)')
REGEX_WRITE_CNT = re.compile(r'^\t\tLocal write count: (.*)')
##
@ibspoof
ibspoof / dse_5_0_x_installer.sh
Last active May 19, 2017 01:09
Azure/AWS Installer Script for DSE 5.0.x
#!/bin/bash
########################################################################
### ###
### Install Script to install DSE 5.0 on Ubuntu or CentOS ###
### created by Brad Vernon brad.vernon@datastax.com ###
### ###
########################################################################
# AWS Instance gathering, do not delete
@ibspoof
ibspoof / downgrade_oss_to_dse.md
Last active June 23, 2017 13:46
Steps to Migrate from Apache Cassandra OSS to DSE Cassandra

Steps to Migrate from OSS C* 3.x to DSE 5.x

1. Change Existing Nodes to GPFS

  1. Change cassandra-rackdc.properties to:
  2. dc=datacenter1
  3. rack=rack1
  4. Change cassandra.yaml snitch: GossipingPropertyFileSnitch
  5. Rolling restart of nodes: nodetool flush && nodetool drain && service cassandra stop
  6. Update application specific keyspaces to use NetworkTopology w/ only existing DC
  7. ALTER KEYSPACE {keyspace} WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '3'} AND durable_writes = true;
EPOCH_START=1472838
JBOD_DRIVES=/app/cassandra/datastax/dse-data*
SNAPSHOT_DATE="Sep 2"
SNAPSHOT_TIME="10:4"
## don't edit below
declare -A refresh_tables
SNAPS=$(ls -R $JBOD_DRIVES | grep $EPOCH_START | grep "app/")
nmap -p9042 10.200.20.0/24 --open
from fabric.api import *
from fabric.api import env
import time
import re
# env.hosts = ['10.200.20.146', '10.200.20.156', '10.200.20.168', '10.200.20.154']
env.hosts = ['10.200.20.158', '10.200.20.146', '10.200.20.156', '10.200.20.168', '10.200.20.154']
env.user = 'datastax'
SNAPS=$(ls -R /app/cassandra/datastax/dse-data* | grep 1469291 | grep app)
while read -r line; do
MOVE_FROM=$(echo $line | awk -F":" '{print $1}')
#echo "MOVE_FROM = $MOVE_FROM"
TABLE_NAME=$(echo $line | awk -F"/" '{print $7}' | awk -F"-" '{print $1}')
#echo "TABLENAME = $TABLE_NAME"
'F-14D Super Tomcat' Grumman 1987 2.34
'MiG-23 Flogger' Russian-made 1964 2.35
'Su-27 Flanker' U.S.S.R. 1981 2.35
# File location /usr/share/dse/resources/tomcat/conf/server.xml or /dse/resources/tomcat/conf/server.xml
# Find
<Host name="localhost" appBase="../solr/web"...
#insert below XML node
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/tmp/"
prefix="solr_access." suffix=".log" pattern="%h %u %t &quot;%r&quot; %s %B %D %v"
resolveHosts="false" rotatable="true" fileDateFormat="yyyy-MM-dd"/>