网站运维、系统运维管理研究

Maatkit是非常不错的mysql管理工具

Maatkit是非常不错的mysql管理工具,网络评价非常不错。包含以下主要工具:
1、mk-table-checksum 检查主从表是否一致的有效工具
2、mk-table-sync 有效保证表一致的工具,不必重载从表而能够保证一致。
3、mk-visual-explain  exlpain解释工具
4、mk-heartbeat 主从同步的监视工具,能够给出从落后于主多少
5、mk-parallel-dump 多线程的mysqldump工具
6、mk-parallel-restore 多线程的表回复工具
7、mk-query-profiler 查询检测分析工具
8、mk-deadlock-logger 死锁的记录工具,支持innodb
9、mk-duplicate-key-checker key侦测工具
10、mk-show-grants 权限管理显示工具
11、mk-slave-restart slave的检测和重启工具
12、mk-slave-delay slave delay replication 的工具
13、mk-slave-prefetch  This tool implements Paul Tuckfield’s famous“oracle” algorithm to read ahead of the slave SQL thread in the relaylogs, rewriting queries as SELECT and executing them to warm theslave’s caches. This can help an I/O-bound slave SQL thread run fasterunder some

给Cacti安装mysql服务监控插件

给Cacti安装监控mysql插件

插件一(可用,推荐):

来源:http://code.google.com/p/mysql-cacti-templates/

一,脚本下载以及设置

wget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2.tar.gz
tar -xzvf mysql-cacti-templates-1.1. 继续阅读 »

几个有用的mysql脚本

From:http://www.faemalia.net/mysqlUtils/

dbmon.pl A simple script to monitor MySQL queries and log them into a file for future processing. Optionally will kill long-running queries. There are a couple of supporting scripts:
listQueries.py If you want to process the logs for long-running queries.
getServerIndexes.pl This will go t 继续阅读 »

通过tungsten replicator实现mysql多主一从的备份架构

Tungsten是一套用于数据库集群和复制的软件集合,包括replication, management, SQL routing, and proxying。Ppc2009大会对这套软件专门做了介绍,下载地址如下:http://sourceforge.net/project/showfiles.php?group_id=256125

tungsten replicator则是这套软件中用于数据复制的一个组件。通过在主从服务器上部署的java程序对主数据库的binlog进行跟踪,并将更新的内容解析出来发送到从服务器,而从服务器的java则将接收到的更新写入从数据库。
/>
 

继续阅读 »

MySQL配置文件例子翻译

#BEGIN CONFIG INFO
#DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载大
#TYPE: SYSTEM
#END CONFIG INFO

#
# 此mysql配置文件例子针对4G内存
# 主要使用INNODB
#处理复杂队列并且连接数量较少的mysql服务器
#
# 将此文件复制到/etc/my.cnf 作为全局设置,
# mysql-data-dir/my.cnf 作为服务器指定设置
# (@localstatedi 继续阅读 »

开源数据库切分技术

原贴:http://www.dbanotes.net/database/database_sharding.html

从 Shard 到 Sharding
“Shard” 这个词英文的意思是”碎片”,而作为数据库相关的技术用语,似乎最早见于大型多人在线角色扮演游戏(MMORPG)中。”Sharding” 姑且称之为”分片”。

Sharding 不是一门新技术,而是一个相对简朴的软件理念。如您所知,MySQL 5 之后才有了数据表分区功能,那么在此之前,很多 MySQL 的潜在用户都对 MySQL 的扩展性有所顾虑,而是否具备分区功能 继续阅读 »

批量导出mysql权限一句话脚本

由于迁移库和合并库需要,经常要导出mysql的权限及合并 mysql的权限

下面是把mysql库所有权限导出到一个文件中的一句话脚本

mysql -p'XXXXX' -e “select user,'@',host from mysql.user”|awk '(NR>1){print “`”$1″`”$2″`”$3″`”}'|w 继续阅读 »

MySQL performance tuning primer script 中文注释版(转)

mysql tuner-primer 是一个比较简单好用的检查mysql运行状态的shell脚本,它主要通过查询mysql中的variables设定和status 并结合当前系统情况给出mysql运行的状态和建议,主要包括以下内容的检查
slow query慢速查询
binlog 二进制日志
max connections 最大连接数
threads 线程数
key buffer size 关键字缓冲
query cache 查询缓存
sort operations 排序
join operations 多表联接
tmp tables 临时表
open files 打开文件数
table cache 表缓存
table locking 锁表
table scans 表扫描
innodb status
total memory used 内存使用

文件下载:
tuning-primer.zip

返回顶部