Skip to content

Instantly share code, notes, and snippets.

View bradfordpythian's full-sized avatar

Ronald Bradford bradfordpythian

  • Pythian
  • Trumbull CT USA
View GitHub Profile
[ `rpm -qa | grep "^git-" | wc -l` -eq 0 ] && sudo yum install -y git-core
cd /tmp
if [ `rpm -qa | grep sysbench-0.5-6 | wc -l` -eq 0 ]
then
[ ! -f "sysbench-0.5-6.el6.x86_64.rpm" ] && wget http://repo.percona.com/release/6/RPMS/x86_64/sysbench-0.5-6.el6.x86_64.rpm
sudo rpm -ivh sysbench-0.5-6.el6.x86_64.rpm
fi
@bradfordpythian
bradfordpythian / upgrade_percona.sh
Last active February 15, 2017 20:20
Upgrade Percona Server to 5.6.35
# This is based on updating environment created by https://gist.github.com/bradfordpythian/60036b603cf1973c29a0516eead55bc4
# which includes TokuDB
# Currently installed Percona software
rpm -qa | grep -i percona
# URL Retrieved from https://www.percona.com/downloads/Percona-Server-5.6/
cd /tmp
wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.35-80.0/binary/redhat/6/x86_64/Percona-Server-5.6.35-80.0-rf113994f31-el6-x86_64-bundle.tar
@bradfordpythian
bradfordpythian / install_tokudb.sh
Last active February 17, 2017 16:05
CentOS 6.x TokuDB 5.6 Installation
# This snippet performs the following for RedHat/CentOS/OL 6.x system
#
# - Clean Installation of Percona Server 5.6.26
# - Clean Installation of TokuDB for said version (e.g. if already exists on server)
# - Configuration and verification of TokuDB
#
# NOTE: Installing via yum is not permitted
# To simulate a base system run:
# vagrant init centos/6; vagrant up --provider virtualbox
Redhat OS Rules /etc/redhat-release | wc -l
Jemalloc installed rpm -qa | grep jemalloc | wc -l
Hugepages are disabled grep "[never]" /sys/kernel/mm/transparent_hugepage/enabled | wc -l
SELinux is permissive sestatus | grep "^Current" | grep "permissive" | wc -l
#!/bin/sh
SCRIPT_NAME=`basename $0 | sed -e "s/\.sh$//"`
[ -z "${TMP_DIR}" ] && TMP_DIR="/tmp"
TMP_FILE="${TMP_DIR}/${SCRIPT_NAME}.tmp.$$"
usage() {
echo "USAGE: ${SCRIPT_NAME} <rules-file>"
@bradfordpythian
bradfordpythian / install_ghost.sh
Last active June 20, 2023 17:57
Install gh-ost - MySQL Online Schema Change Tool
# Latest version can be identifed at https://github.com/github/gh-ost/releases/latest
cd /tmp
[ -z "${GHOST_VERSION}" ] && GHOST_VERSION="20170109081400"
wget https://github.com/github/gh-ost/releases/download/v1.0.34/gh-ost-binary-linux-${GHOST_VERSION}.tar.gz
tar xvfz gh-ost-binary-linux-${GHOST_VERSION}.tar.gz
file gh-ost
sudo mv gh-ost /usr/local/bin
@bradfordpythian
bradfordpythian / running_threads.sql
Created February 3, 2017 20:15
Overview of whats running in the MySQL instance at this time.
SELECT 'Threads running' AS text, variable_value AS value FROM information_schema.global_status WHERE variable_name='Threads_running'
union
SELECT 'Threads created' AS text, variable_value AS value FROM information_schema.global_status WHERE variable_name='Threads_created'
union
SELECT 'Connections used' AS text, variable_value AS value FROM information_schema.global_status WHERE variable_name='max_used_connections'
union
SELECT 'Connection max' AS text, variable_value AS value FROM information_schema.global_variables WHERE variable_name='max_connections';
SELECT 'ALL running processes' AS host, '' AS command, COUNT(*) AS cnt
FROM information_schema.processlist
@bradfordpythian
bradfordpythian / docker_mysql.sh
Created December 30, 2016 14:43
MySQL Docker Helper functions
wget https://raw.githubusercontent.com/ronaldbradford/mysql-docker-minimal/master/dockerhelper.sh
. ./dockerhelper.sh
# Docker Registered functions are: docker_mysql, docker_percona, docker_mariadb
@bradfordpythian
bradfordpythian / vagrant_ubuntu_1004.sh
Created December 19, 2016 21:23
Install and update Ubuntu 10.04 via Vagrant
BOX="ubuntu-10.04"
if [ `vagrant box list | grep "^${BOX}" | wc -l` -eq 0 ]
then
vagrant box add ${BOX} http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-10.04_chef-provisionerless.box
fi
echo '# VagrantFile
Vagrant.configure(2) do |config|
# https://www.percona.com/doc/percona-xtrabackup/2.3/installation/yum_repo.html
# For CentOS/RHEL/OL
if [ -f "/etc/redhat-release" ]
then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install -y libev
yum install -y http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
yum list | grep xtrabackup
yum install -y percona-xtrabackup
fi