上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: -- mysql慢查询日志相关参数-- 慢查询日志时间show variables like "long_query_time"; -- 将时间设置为2sset global long_query_time=2; -- 是否开启慢查询日志show variables like "slow_query_log";-- 打开慢查询日志set global slow_query_log='ON'; -- 查询一下文件show variables like "%slow%";使用mysqldumpslow可以将日志转化为可读格 阅读全文
posted @ 2014-02-12 10:43 ifeixiang 阅读(747) 评论(0) 推荐(0) 编辑
摘要: http://www.nowo.com/disk-performance-monitoring-in-zabbix/http://virtuallyhyper.com/2013/06/monitor-disk-io-stats-with-zabbix/ 阅读全文
posted @ 2014-01-04 18:06 ifeixiang 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Idiorm – 轻量级ORM库Snappy – 快照/PDF库Buzz – 简单的HTTP请求库Omnipay – 支付处理库ShellWrap – 优美的命令行包装器 阅读全文
posted @ 2014-01-02 00:18 ifeixiang 阅读(199) 评论(0) 推荐(0) 编辑
摘要: What is Docker?Docker is an open-source project to easily create lightweight, portable, self-sufficient containers from any application. The same container that a developer builds and tests on a laptop can run at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more.do 阅读全文
posted @ 2013-12-23 22:26 ifeixiang 阅读(674) 评论(0) 推荐(0) 编辑
摘要: 就像在windows下创建两个点以上的文件无法删除一样,linux下也可以有同样的技巧:[root@localhost ~]# touch test/.immutable[root@localhost ~]# chattr +i test/.immutable[root@localhost ~]# chattr +i test/[root@localhost ~]# mkdir test/foobarmkdir: cannot create directory `test/foobar': Permission denied[root@localhost ~]# touch test/ 阅读全文
posted @ 2013-12-23 22:12 ifeixiang 阅读(3871) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/xiongpq/p/3384681.html 阅读全文
posted @ 2013-12-19 18:25 ifeixiang 阅读(1670) 评论(0) 推荐(0) 编辑
摘要: 官方文档:部分备份:http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/partial_backups_innobackupex.htmlhttp://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/restoring_individual_tables_ibk.html增量备份:http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/incremental_backups_innobac 阅读全文
posted @ 2013-12-18 19:19 ifeixiang 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 默认情况下,计划任务没有开启,可以能过下面命令开启(一) 查看当前是否已开启事件计划:SHOW VARIABLES LIKE 'event_scheduler';(二) 开启事件计划(调度器)开关有4种方法: SET GLOBAL event_scheduler = ON;键值1或者ON表示开启;0或者OFF表示关闭; 阅读全文
posted @ 2013-12-17 17:07 ifeixiang 阅读(769) 评论(0) 推荐(0) 编辑
摘要: 在数据库服务器上,可以架构多个Mysql服务器,进行单机多实例的读写分离;可以通过mysqld_multi来进行多实例的管理,mysqld_multi是用perl写的脚本,原理是通过mysql_admin来进行多个数据库的操作;多实例的配置文件也有点不同,可以看作是多个mysql配置的集合;mysq... 阅读全文
posted @ 2013-12-16 19:27 ifeixiang 阅读(2419) 评论(0) 推荐(0) 编辑
摘要: 定义合适的数据类型对Mysql性能提升非常重要IPV4地址的存储:IPV4地址,例如:127.0.0.1 = 10000000 00000000 00000000 00000001,实际上是一个32位的无符号整数,用小数点分隔开方便阅读,并不是字符串,所以存储时,应该使用unsigned int来存储。显示的时候用INET_ATON来转换成ip格式,更新或插入时使用INET_NTOA转换成整数插入。时间的存储:很多人喜欢用INT来存储时间,实际上,这并不能带来任何性能上的提交;使用内置的DATETIME和TIMESTAMP更方便,因为Mysql内置的很多时间函数可以对时间进行处理。一般情况下, 阅读全文
posted @ 2013-12-15 22:44 ifeixiang 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 先使用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 阅读(359) 评论(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 阅读(4593) 评论(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 阅读(3686) 评论(0) 推荐(0) 编辑
摘要: https://tools.percona.com/ 阅读全文
posted @ 2013-11-21 18:24 ifeixiang 阅读(297) 评论(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 阅读(2244) 评论(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 阅读(7171) 评论(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 阅读(672) 评论(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 阅读(1691) 评论(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 阅读(55906) 评论(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 阅读(2778) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页