This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install -y epel-release | |
sudo yum install -y ansible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
print "CHANGE MASTER TO" | |
} | |
{ | |
if (NR==4) { | |
print " MASTER_HOST='"$0"'," | |
} | |
if (NR==5) { | |
print " MASTER_USER='"$0"'," | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT @@hostname, @@version, @@version_comment, @@version_compile_machine; | |
SELECT NOW(); | |
SELECT table_schema, | |
SUM(data_length+index_length)/1024/1024 AS total_mb, | |
SUM(data_length)/1024/1024 AS data_mb, | |
SUM(index_length)/1024/1024 AS index_mb, | |
COUNT(*) AS tables, | |
CURDATE() AS today | |
FROM information_schema.tables | |
WHERE table_schema NOT IN ('mysql','sys','performance_schema','information_schema') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT @@hostname, DATABASE() as table_schema, CURDATE() AS today; | |
SELECT if(length(table_name)>30,concat(left(table_name,28),'..'),table_name) AS table_name, | |
engine,row_format as format, table_rows, avg_row_length as avg_row, | |
round((data_length+index_length)/1024/1024,2) as total_mb, | |
round((data_length)/1024/1024,2) as data_mb, | |
round((index_length)/1024/1024,2) as index_mb | |
FROM information_schema.tables | |
WHERE table_schema=DATABASE() | |
ORDER BY 6 DESC | |
LIMIT 15; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ `id -u` -ne 0 ] && echo "ERROR: Script must be run as root" && exit 1 | |
DISK="/dev/sdb" | |
[ `fdisk -l ${DISK} | wc -l` -eq 0 ] && echo "ERROR: A second disk '${DISK}' was not found" && exit 2 | |
fdisk -l ${DISK} | |
pvdisplay ${DISK} | |
[ $? -eq 0 ] && echo "ERROR: Physical Volume for '${DISK}' already exists" && exit 3 | |
pvcreate ${DISK} | |
vgcreate appvg ${DISK} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "centos/6" | |
file_to_disk = './disk2.vdi' | |
config.vm.provider "virtualbox" do |v| | |
unless File.exist?(file_to_disk) | |
v.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] # 500M | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SCRIPT_NAME=`basename $0 | sed -e "s/\.sh$//"` | |
[ -z "${TMP_DIR}" ] && TMP_DIR="/tmp" | |
TMP_FILE="${TMP_DIR}/${SCRIPT_NAME}.tmp.$$" | |
DATE=`date +%Y%m%d.%H%M` | |
[ -z "${LOG_DIR}" ] && LOG_DIR="/opt/pythian/log" | |
[ ! -d "${LOG_DIR}" ] && echo "ERROR: Log directory '${LOG_DIR}' is not accessible." && exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SCRIPT_NAME=`basename $0 | sed -e "s/\.sh$//"` | |
[ -z "${TMP_DIR}" ] && TMP_DIR="/tmp" | |
TMP_FILE="${TMP_DIR}/${SCRIPT_NAME}.tmp.$$" | |
[ -z "${LOG_DIR}" ] && LOG_DIR="/opt/pythian/log" | |
[ ! -d "${LOG_DIR}" ] && echo "ERROR: Log directory '${LOG_DIR}' is not accessible." && exit 1 | |
[ -z "${SCHEMA}" ] && SCHEMA="test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set_target_dir() { | |
local TARGET_DIR=$1 | |
[ -z "${TARGET_DIR}" ] && echo "INTERNAL ERROR: One parameter required ($#) supplied" && exit 1 | |
if [ ! -d "${TARGET_DIR}" ] | |
then | |
sudo mkdir -p ${TARGET_DIR} | |
RC=$? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This snippet performs the following for RedHat/CentOS/OL 6.x system | |
# | |
# - Clean Installation of Percona Server 5.6.26 | |
# | |
# NOTE: Installing via yum is not permitted | |
# To simulate a base system run the following for CentOS 6.6, 6.7 and 6.8: | |
# vagrant init nrel/CentOS-6.6-x86_64; vagrant up --provider virtualbox | |
# vagrant init nrel/CentOS-6.7-x86_64; vagrant up --provider virtualbox | |
# vagrant init centos/6; vagrant up --provider virtualbox |
NewerOlder