linux

Parallel load a mysqldump

< class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-teaser">

pload.sh

#!/usr/bin/env bash

[[ $# -ne 6 ]] && echo "$(basename $0) <dumpfile> <# of splits/chunks. max 20> <# of mysql clients> <db user> <db password> <db schema>" && exit 1
user=$4
password=$5
schema=$6

#add multiple hosts if available
declare -a hosts=('127.0.0.1' '127.0.0.1')
MYSQL_CMD=mysql

dumpfile=$1
splits=$2
clients=$3

declare -a splitfiles=('xaa'  'xab'  'xac'  'xad'  'xae'  'xaf'  'xag'  'xah'  'xai'  'xaj'  'xak'  'xal' 'xam'  'xan'  'xao'  'xap'  'xaq'  'xar'  'xas'  'xat')

# split file

Tags: 

LVM Add Disks Cheat Sheet

< class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-teaser">
$ fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xec3e2922.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Tags: 

Subscribe to linux