Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View phact's full-sized avatar

Sebastián Estévez phact

View GitHub Profile
@phact
phact / pi.yaml
Created February 17, 2016 09:08
cassandra.yaml for tiny boxes
# Cassandra storage config YAML
# NOTE:
# See http://wiki.apache.org/cassandra/StorageConfiguration for
# full explanations of configuration directives
# /NOTE
# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.
cluster_name: SmallCluster
#!/bin/bash
dt=`date +%D`
log="du.log"
df > /tmp/du$$
while read line
do
fields=`echo $line | awk '{print NF}'`
@phact
phact / testing-jobserver.sh
Last active February 2, 2016 18:05
quick test for jobserver and DSE
#quick test for jobserver and DSE
#jobserver docs for more details -- https://github.com/spark-jobserver/spark-jobserver/tree/v0.5.2
#setup
git clone https://github.com/spark-jobserver/spark-jobserver.git
cd spark-jobserver/
git checkout tags/v0.5.2
#build job
sbt job-server-tests/package
@phact
phact / solr_side_join.txt
Created August 28, 2015 20:44
Solr Side Join to replace collections / dynamic fields
CREATE KEYSPACE IF NOT EXISTS docstore WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
CREATE TABLE IF NOT EXISTS docstore.metadata (
userid text,
docid text,
joinkey text,
title text,
body text,
PRIMARY KEY(userid, docid));
@phact
phact / perf_off.sh
Last active August 29, 2015 14:28
Turn off DSE perf services
#Cassandra
dsetool perf clustersummary disable
dsetool perf cqlsysteminfo disable
dsetool perf dbsummary disable
dsetool perf resourcelatencytracking disable
dsetool perf userlatencytracking disable
dsetool perf cqlslowlog disable
dsetool perf cqlslowlog -1
#Search
@phact
phact / Bootstrap_channel_error.md
Created May 15, 2015 19:08
Bootstrap fails channel error

###Bootstrapping node sees StreamException and then gives up -- DSEDeamon shuts down

ERROR [main] 2015-05-15 12:46:50,652 CassandraDaemon.java (line 584) Exception encountered during startup
java.lang.RuntimeException: Error during boostrap: Stream failed
        at org.apache.cassandra.dht.BootStrapper.bootstrap(BootStrapper.java:86)
        at org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:1010)
        at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:813)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:626)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:515)

at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:437)

#!/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])
#!/bin/sh
if [ $# -ne 3 ]; then
echo "Usage: $0 pid interval count"
exit 1
fi
PID=$1
INTERVAL=$2
COUNT=$3
#!/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
}