11 2013 档案

摘要:先使用sync命令以确保文件系统的完整性,sync 命令运行 sync 子例程,将所有未写的系统缓冲区写到磁盘中,包含已修改的 i-node、已延迟的块 I/O 和读写映射文件。再执行下面任意一条命令:Writing to this file causes the kernel to drop clean caches,dentries and inodes from memory, causing that memory to becomefree.To free pagecache, use echo 1 > /proc/sys/vm/drop_caches;to free dent 阅读全文
posted @ 2013-11-28 11:10 ifeixiang 阅读(360) 评论(0) 推荐(0) 编辑
摘要:使用Percona XtraBackup先安装依赖包yum install -y perl-DBD-MySQL perl-DBI perl-Time-HiRes libaio*到Percona官网下载Percona XtraBackup,安装然后执行热备份,官网有详细教程:http://www.percona.com/doc/percona-xtrabackup/2.1/howtos/setting_up_replication.html最后面的参数是备份的目录;#使用默认的 /etc/my.cnf 配置文件innobackupex --user=xxx --password=xxx /ho. 阅读全文
posted @ 2013-11-23 15:52 ifeixiang 阅读(4611) 评论(0) 推荐(0) 编辑
摘要:git提交的时候,本地已经提交,却怎么也推送不到服务器,也没显示错误,只显示 everything-up-to-date ;原因是git不在master分支,而是处于detached head(匿名分支提交)状态,即git Head指向了其中一个提交,而不是master分支,所以,在detached HEAD里面做的任何操作,例如提交操作,都可以正常进行,但是不会更新任何已命名的分支。(你可以认为这是在更新一个匿名分支。)一旦此后切换到别的分支,比如说master,那么这个提交节点(可能!!!如果使用了git gc,那就没了:-()再也不会被引用到,然后就会被丢弃掉了。如果要保存这个匿名分支, 阅读全文
posted @ 2013-11-22 16:12 ifeixiang 阅读(3765) 评论(0) 推荐(0) 编辑
摘要:https://tools.percona.com/ 阅读全文
posted @ 2013-11-21 18:24 ifeixiang 阅读(299) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/perl -wuse strict;use warnings;use Tie::File;##### Thinkphp日志分析# 日志基本格式:{$now} ".$_SERVER['REQUEST_URI']." | {$level}: {$message}\r\n", $type,$destination,$extra# 使用方法:#sub parse_log{ my $file = shift; open my $fd , "){ # 2013-11-18 01:30:05+08:00 uri i... 阅读全文
posted @ 2013-11-20 12:39 ifeixiang 阅读(2256) 评论(0) 推荐(0) 编辑
摘要:比较好用的工具有:awstatsGoAccess主要是对access.log进行分析;安装GoAccess,官方有详细的介绍,这里记录一下:yum install glib2 glib2-devel GeoIP-devel ncurses-develcd ~/softwaregit clone https://github.com/allinurl/goaccess.git cd goaccessautoreconf -fi./configure --enable-geoip --enable-utf8 make && make install#下面运行GoAcess,相关参数 阅读全文
posted @ 2013-11-15 14:34 ifeixiang 阅读(7195) 评论(1) 推荐(0) 编辑
摘要:一,基本步骤1,创建在主从数据上都创建复制账号,权限选上super, replication slave , replication master(选上这个可以方便从库变成主库);2,配置主库和备库配置文件 /etc/my.cnf#masterlog_bin = mysql_binserver_id = 101 #unique id , 可以是Ip的最后几位#slavelog_bin = mysql_bin #和上面一致server_id = 102relay_log = /var/lib/mysql/mysql-relay-binlog_slave_updates = 1 read_only 阅读全文
posted @ 2013-11-14 10:28 ifeixiang 阅读(685) 评论(0) 推荐(0) 编辑
摘要:mysql -uroot -p#input password use mysql;update user set host='%' where user='root';flush privileges;#ok密码root密码也可以改:先停止正在运行的mysql实例,在配置文件/etc/my.cnf里面加入skip-grant-tables, 重新启动Mysql或者使用bin/safe_mysqld --skip-grant-tables & 启动使用 mysql -u root 连接(现在已经可以无密码连接了)update user set passwo 阅读全文
posted @ 2013-11-14 10:04 ifeixiang 阅读(1692) 评论(0) 推荐(0) 编辑
摘要:在向gitlab提交工程的时候,出现错误提示:remote: GitLab: You are not allowed to access master!remote: error: hook declined to update refs/heads/masterTo sa_gitlab@192.168.xxx:xxx/xxx.git ! [remote rejected] master -> master (hook declined)这个问题主要是由于git工程里的hooks/post-receive和update引起的。可以删除这两个文件;但是问题的根源不在这,在新建工程的hook 阅读全文
posted @ 2013-11-05 15:36 ifeixiang 阅读(56062) 评论(0) 推荐(0) 编辑
摘要:实现virtualbox主机与虚拟机互访,同时虚拟机还可以上网;主要通过配置两块网卡来实现;1,先配置好一台虚拟机Slave1,这里使用CentOS ;2,使用VirtualBox复制这台虚拟机,变成另外一台兄弟虚拟机Slave2;3,刚刚开始Slave2应该是上不了网的,因为网卡MAC地址也是复制过来的;所以需要重新调整; 在VirtualBox设备——更改网络连接——网络里查看网卡的MAC地址,记下来,到Slave2里面 vim /etc/udev/rules.d/70-persistent-net.rules#可以看到两块网卡的配置,将第一行删除,第二行最后的eth1改为eth0se.. 阅读全文
posted @ 2013-11-05 12:25 ifeixiang 阅读(2803) 评论(0) 推荐(0) 编辑