- Setup minion conf
# /etc/salt/minion
master: xxx.xxx.xxx.xxx
master_port: 4506
RewriteCond %{QUERY_STRING} !_DEBUG=1 #RewriteRule ^/(.)$ /$1?_DEBUG=1 [QSA,R,L] RewriteRule ^/(.)$ /$1?_DEBUG=1 [QSA,L]
#301 Redirects for .htaccess
#Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html
Backup
mydumper -B my_db -l 60 -o my_backup_temp_folder
Restore #-d for backup folder, -B for destination database, -t for threads count, -o for overwriting tables
myloader -d ./ -B my_db -t 2 -o
Manually import massive datas without blocking
mysql -u root -p
set global net_buffer_length=1000000; # Set network buffer length to a large byte number
Stop sending requests to node to enable maintenance on it
echo "set server backend_name/svc_name state drain" | socat stdio /var/run/haproxy/admin.sock
Start sending requests to node to disable maintenance on it
echo "set server backend_name/svc_name state ready" | socat stdio /var/run/haproxy/admin.sock
Show statistics
input { | |
syslog { | |
type => "haproxy-access" | |
port => 514 | |
} | |
} | |
filter { | |
grok { | |
type => "haproxy-access" |
Backup from rescue to ssh remote using dd from backup server
ssh [email protected] "dd if=/dev/sdb | gzip" > /tmp/disk-image.raw.gz
Unzip on backup server
gunzip -d /tmp/disk-image.raw.gz
Restore from ssh remote using dd from target