« 2010年02月 | メイン | 2010年04月 »
2010年03月22日
munin
wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm
vi /etc/yum.repos.d/rpmforge.repo
enabled = 0 ※デフォルトではRPMforge リポジトリを有効にしない
wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
yum --enablerepo=rpmforge -y install munin-node
yum --enablerepo=rpmforge -y install munin
/etc/init.d/munin-node start
ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes
ln -s /usr/share/munin/plugins/mysql_isam_space_ /etc/munin/plugins/mysql_isam_space_
ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries
ln -s /usr/share/munin/plugins/mysql_slowqueries /etc/munin/plugins/mysql_slowqueries
ln -s /usr/share/munin/plugins/mysql_threads /etc/munin/plugins/mysql_threads
ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/apache_accesses
ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes
ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/apache_volume
http://muninexchange.projects.linpro.no/?search=&cid=0&os%5B4%5D=on&os%5B7%5D=on&os%5B3%5D=on&os%5B2%5D=on&os%5B5%5D=on&os%5B8%5D=on&os%5B1%5D=on&os%5B6%5D=on&pid=39
2010年03月20日
mysql レプリケーション
mysql Ver 14.12 Distrib 5.0.77
マスタ側
GRANT REPLICATION SLAVE ON *.* TO rep@"192.168.1.0/255.255.255.0" IDENTIFIED BY 'パスワード';
FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
show master status\G
SHOW PROCESSLIST\G
[mysqld]
#log-bin=mysql-bin
log-bin
server-id=2
スレーブ側
start slave;
stop slave;
show slave status\G
CHANGE MASTER TO MASTER_HOST='192.168.1.201', MASTER_USER='rep', MASTER_PASSWORD='パスワード', MASTER_LOG_FILE='mysqld-bin.000002', MASTER_LOG_POS=98;
[mysqld]
server-id=1
#DBたたいてるので必要なしここから
master-host=192.168.1.201
master-user=rep
master-password=パスワード
master-port=3306
replicate-do-db = 'データベース名'
#DBたたいてるので必要なしここまで
log-bin=mysql-bin
特定のデータベースのみダンプ
mysqldump -u root -p --databases 特定 > 特定.dmp