Centos6安装aria2

aria2是一款开源的下载工具,支持http,FTP,bt,magnet(磁力),可分段多线程下载,断点续传等

  1. #64位系统
  2. yum groupinstall -y 'Development tools'
  3.  
  4. rpm -Uvh http://pkgs.repoforge.org/aria2/aria2-1.16.4-1.el6.rf.x86_64.rpm
  5.  
  6. 如果缺少依赖
  7. error: Failed dependencies:
  8.         libnettle.so.4()(64bit) is needed by aria2-1.16.4-1.el6.rf.x86_64
  9. rpm -Uvh http://pkgs.repoforge.org/nettle/nettle-2.2-1.el6.rf.x86_64.rpm
  10. rpm -Uvh http://pkgs.repoforge.org/nettle/nettle-devel-2.2-1.el6.rf.x86_64.rpm

从MySQL备份中恢复单个表

  1. sed -n -e '/DROP TABLE.*$Table_Name/,/UNLOCK TABLES/p' MySQL_Backup.sql >> MySQL.$Table_Name.restore
  2.  
  3. mysql:
  4. use $DB_Name
  5. source MySQL.$Table_Name.restore

torshammer

  1. #enable epel & install tor
  2. #ulimit -n 1024000
  3. #service tor start
  4.  
  5. curl -L 'http://downloads.sourceforge.net/project/torshammer/Torshammer/1.0/Torshammer%201.0.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ftorshammer%2Ffiles%2FTorshammer%2F1.0%2F&ts=1439278986&use_mirror=nchc' -o torshammer.zip
  6.  
  7. unzip torshammer.zip

net_speeder网络加速

  1. wget http://net-speeder.googlecode.com/files/net_speeder-v0.1.tar.gz
  2. #项目github地址 https://github.com/snooda/net-speeder
  3. yum install libnet libpcap libnet-devel libpcap-devel gcc -y
  4. bash build
  5. ./net_speeder eth0 "ip"

MySQL不中断在线添加从库

  1. #全备份(这数据不能直接用的,或许有未提交的事务或者事务还在日志里并未写入硬盘)
  2. $Master: innobackupex --user='root' --password='$Password' --defaults-file=/etc/my.cnf /data/test/fulltest --socket=/tmp/mysql.sock 
  3.  
  4. #apply-log(apply log后的数据才可直接使用)
  5. $Master: innobackupex --apply-log /data/test/fulltest/2015-06-04_16-41-51/
  6.  
  7. #恢复
  8. $Slave:清空New_Slavedatadir
  9.  
  10. #移动ib_logfile文件到MySQL的log文件夹
  11. $Slavemv ib_logfile* /path/to/mysql/log/
  12.  
  13. #修改my.cnf
  14. 修改server-id=xx
  15.  
  16. #启动mysql服务
  17. $Slaveservice mysqld start
  18.  
  19. #查看文件xtrabackup_binlog_info查看binlog位置并change master;
  20. $SlaveCHANGE MASTER TO MASTER_HOST='$masterip', MASTER_PORT=3306,MASTER_USER='$repl_user',MASTER_PASSWORD='$slavepass',MASTER_LOG_FILE='$bin.000001',MASTER_LOG_POS=481;
  21.  
  22. #启动从库服务
  23. $Slaveslave start

参考:percona-xtrabackup-setting_up_replication