This file contains 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
#!/usr/bin/env python2 | |
# coding=utf8 | |
import sys, os | |
import random | |
import time | |
if __name__ == "__main__": | |
curtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) |
This file contains 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 | |
# | |
# 该脚本简单封装了UFile客户端工具filemgr的增量上传功能 | |
# | |
if [ $# -lt 2 ];then | |
echo "usage:$0 bucket syncdir [prefix]" | |
exit 1 | |
fi |
This file contains 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 | |
if [ $# -lt 1 ];then | |
echo "usage:$0 iplist" | |
exit 1 | |
fi | |
iplist=$1 | |
i=0 |
This file contains 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
#!/usr/bin/env python2 | |
""" | |
Queries the slowlog database table and outputs it in | |
the normal MySQL slow log text format. | |
Run this script by: | |
python /path/to/slow_log_dump.py dbip dbport dbusr dbpwd [start_time] [end_time] > /path/to/slow_log_dump.log | |
Then you can run the normal mysqldumpslow parser on the output file (slow_log_dump.log) |
This file contains 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
1. raid | |
1.1 查看物理卷信息 | |
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall | |
1.2 查看逻辑卷+物理卷 | |
/opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -aall | |
1.2.1 查看逻辑卷 | |
/opt/MegaRAID/MegaCli/MegaCli64 -ldinfo -lall -aall |
This file contains 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
1. 建立DB节点 | |
(其中2台为master,另一台为slave); | |
以master1作为主库 | |
master1特殊配置: | |
# custom | |
server-id = 1001 | |
log_bin = mysql-bin | |
log_bin_index = mysql-bin.index | |
log-slave-updates |
This file contains 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
#!/usr/bin/perl | |
# First written by orczhou.com [email protected] | |
# This program is free software; you can redistribute it and/or modify it under | |
# the terms of the GNU General Public License as published by the Free Software | |
# Foundation; version 2 of the License. | |
# How faster it is: | |
# $ls -lh backup.sql.gz | |
# -rw-r--r-- 1 mysql dba 14G Nov 21 04:49 backup.sql.gz |
This file contains 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 | |
if [ $# -lt 1 ];then | |
echo "usage:$0 process_name" | |
exit 1 | |
fi | |
process_name="$1" | |
function straceall() |
This file contains 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
测试磁盘IO性能的几种方法 | |
在磁盘测试中最关心的几个指标分别为:iops(每秒执行的IO次数)、bw(带宽,每秒的吞吐量)、lat(每次IO操作的延迟)。 | |
当每次IO操作的block较小时,如512bytes/4k/8k等,测试的主要是iops。 | |
当每次IO操作的block较大时,如256k/512k/1M等,测试的主要是bw。 | |
1. 最简单的dd | |
dd是linux自带的磁盘读写工具,可用于测试顺序读写。 | |
一般而言,磁盘读写有两种方式:BufferIO、DirectIO,DirectIO可以更好的了解纯磁盘读写的性能。 | |
1.1 dd测试DirectIO |
This file contains 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 | |
if [ $# -lt 2 ];then | |
echo "usage:$0 deleted_list existed_list" | |
exit 1 | |
fi | |
deleted_list=$1 | |
existed_list=$2 |
NewerOlder