Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastián Estévez phact

View GitHub Profile
View gist:8e0b2791558f94472a82
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="/usr/share/dse/" />
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory"
class="com.datastax.bdp.cassandra.index.solr.DSENRTCachingDirectoryFactory">
<double name="maxmergesizemb">5.0</double>
<double name="maxcachedmb">32.0</double>
View gist:ff1dbdca93b18813292c
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">900</int>
<str name="handler">org.apache.solr.handler.component.SearchHandler</str>
<lst name="params">
<str name="debugQuery">true</str>
<str name="q">*:*</str>
</lst>
</lst>
View gist:9c89cade6020a738fa1e
root@solr-4:/home/ilyabeyrak# ./pcstat.x86_64 /data/solr.data/ResultlyData.StreamData/index/_*
|------------------------------------------------------------------------+----------------+------------+-----------+---------|
| Name | Size | Pages | Cached | Percent |
|------------------------------------------------------------------------+----------------+------------+-----------+---------|
| /data/solr.data/ResultlyData.StreamData/index/_q7uyc_2.del | 367349 | 90 | 90 | 100.000 |
@phact
phact / gist:6604e6140f489f22dbb8
Created Sep 27, 2014
C* 2.1 nodetool repair stacktrace
View gist:6604e6140f489f22dbb8
When we run "nodetool repair", we get the ClassCastException below.
ERROR [AntiEntropyStage:1537] 2014-09-27 01:07:52,137 CassandraDaemon.java:166 - Exception in thread Thread[AntiEntropyStage:1537,5,main]
java.lang.ClassCastException: null
ERROR [RepairJobTask:3] 2014-09-27 01:07:52,137 RepairJob.java:127 - Error occurred during snapshot phase
java.lang.RuntimeException: Could not create snapshot at /172.31.20.226
at org.apache.cassandra.repair.SnapshotTask$SnapshotCallback.onFailure(SnapshotTask.java:77) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.net.ResponseVerbHandler.doVerb(ResponseVerbHandler.java:48) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:62) ~[apache-cassandra-2.1.0.jar:2.1.0]
@phact
phact / backup_scripts_opsc.md
Last active Jul 3, 2017
Backup Script for OpsCenter
View backup_scripts_opsc.md

##steps

Step 1 Distribute your scripts to the servers and execute the setup:

./backup.sh <ip> [<ip> <ip> ...] 

Step 2 Set up

in the OpsC UI, schedule a backup with the backup script path configured

View gist:5af3f12cf89628f08134
cat /var/log/cassandra/system.log | grep failed | grep range |sed 's/.* range (//g' | sed 's/].*//' | sed 's/^/nodetool repair -st /' |sed 's/,/ -et /' |sort|uniq > failed.sh
View gist:8d62d6963f369f13c14e
View server_start.sh
#!/bin/bash
# Script to start the job server
set -e
get_abs_script_path() {
pushd . >/dev/null
cd $(dirname $0)
appdir=$(pwd)
popd >/dev/null
}
View threadDump.sh
#!/bin/sh
if [ $# -ne 3 ]; then
echo "Usage: $0 pid interval count"
exit 1
fi
PID=$1
INTERVAL=$2
COUNT=$3
View topthreads.py
#!/usr/bin/env python
# topthreads.py - takes the top and thread dump output from multidump.sh and produces a
# list of the top threads by average CPU consumption including Java thread names
# usage: topthreads.py [top file] [thread dump file]
import sys
import collections
import re
topfile = open(sys.argv[1])
dumpfile = open(sys.argv[2])