Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jayjanssen
jayjanssen / gist:9487973
Created March 11, 2014 15:18
PXC config
[mysqld]
datadir = /var/lib/mysql
query_cache_size=0
query_cache_type=0
binlog_format = ROW
innodb_buffer_pool_size = 128M
#^^ or however much you can allocate to MySQL on this machien
@jayjanssen
jayjanssen / keepalived.conf
Created March 19, 2014 17:16
Basic Keepalived and PXC setup
vrrp_script chk_pxc {
script "/usr/bin/clustercheck"
interval 1
}
vrrp_instance PXC {
state MASTER
interface eth1
virtual_router_id 51
priority 100
nopreempt
@jayjanssen
jayjanssen / gist:394c18e64fdd31e6cab7
Last active August 29, 2015 14:01
Percona Training scoreboard -- node.js
// To Install: (requires EPEL)
// yum install nodejs nodejs-async -y
// To start:
// export NODE_PATH=/usr/lib/node_modules/
// screen node scoreboard.js
var http = require('http');
var async = require('async');
@jayjanssen
jayjanssen / gist:41bcf7a6cd358afb655d
Created June 25, 2014 17:55
test windows vagrant-aws file
Vagrant.configure("2") do |config|
config.vm.box = "perconajayj/centos-x86_64"
config.vm.provider :aws do |aws, override|
aws.instance_type = 'm1.small'
aws.region = 'us-east-1'
aws.access_key_id = "YOUR KEY"
aws.secret_access_key = "YOUR SECRET KEY"
aws.keypair_name = "KEYPAIR NAME"
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
@jayjanssen
jayjanssen / gist:1d1edde1541864a5e9c4
Created August 5, 2014 13:36
Find Non Innodb Tables
select engine, table_schema, table_name from information_schema.TABLES
WHERE table_schema NOT IN ('performance_schema','information_schema','mysql')
and engine != 'Innodb';
select table_schema, engine, count(*) as non_innodb_tables from information_schema.TABLES where table_schema NOT IN ('performance_schema','information_schema','mysql')
and engine != 'Innodb' group by table_schema, engine with rollup;
@jayjanssen
jayjanssen / gist:bcdc33f8ae52f4ecfa69
Created July 10, 2015 12:49
MaxScale + PXC with RW splitting
[maxscale]
threads=4
[PXC Monitor]
type=monitor
module=galeramon
servers=node1,node2,node3
user=maxscale
passwd=maxscale
monitor_interval=1000
@jayjanssen
jayjanssen / gist:8ee0659dc0618ba60268
Created July 15, 2015 18:42
Can I read the gcache mmap?
package main
import "github.com/riobard/go-mmap"
import "fmt"
import "os"
func main() {
file, err := os.Open( "/gcache/galera.cache")
if err != nil {
panic( err )
@jayjanssen
jayjanssen / denyhosts-remove-ip.sh
Created June 23, 2011 17:25
denyhosts ip removal script
#!/bin/sh
HOST=$1
cd /var/lib/denyhosts
for i in `ls`; do mv $i $i.old; grep -v $HOST $i.old >> $i; done
cp /etc/hosts.deny /tmp/hosts.deny
grep -v $HOST /tmp/hosts.deny > /etc/hosts.deny
@jayjanssen
jayjanssen / gist:1048955
Created June 27, 2011 14:27
node-zookeeper wrapper that handles the zookeeper server coming and going
// connection manager object is responsible for maintaining the connection to zk
var connection_manager = (function() {
var cm = {};
// Start connection immediately (global for all instances)
var zk_trying = false;
var zkclass;
var zk;
// tries to make a connection (if one isn't already being attempted), waits for timeout