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 / 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)

@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 / 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 / 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
#!/bin/bash
dt=`date +%D`
log="du.log"
df > /tmp/du$$
while read line
do
fields=`echo $line | awk '{print NF}'`
@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

Table definition:

CREATE TYPE physician(
    physician_first_name text,
    physician_last_name text,
    physician_license_state_code1 text,
    physician_license_state_code2 text,
    physician_license_state_code3 text,
    physician_license_state_code4 text,
system.graph('geo1').create()
:remote config alias g geo1.g
:remote config timeout max
//create the geo schema elements for this graph
graph.schema().propertyKey("point").Point().create();
graph.schema().propertyKey("line").Linestring().create();
graph.schema().propertyKey("polygon").Polygon().create();
graph.tx().commit();
#!/bin/bash
#this gnarly one liner will download dsbulk and download an entire keyspace worth of data into your local machine (assuming it fits!)
if [ -z "$CAS_HOST" ]; then
echo "Comma separated contact points (or set CAS_HOST environment variable):"
read CAS_HOST
fi
if [ -z "$KEYSPACE" ]; then
echo "Keyspace (or set KEYSPACE environment variable):"
read KEYSPACE
@phact
phact / user-defined-compaction.sh
Last active June 21, 2019 15:58
surgical script that kicks off user defined compactions to purge tombstones in c*
#!/bin/bash
#set -x
DATA_DIRECTORY="/var/lib/cassandra/data"
CASS_TOOLS_BIN_DIRECTORY="/DSE_DIR_HERE/resources/cassandra/tools/bin/"
KEYSPACE_NAME="assethub"
TABLE_NAME="clusters"