`
ycsk
  • 浏览: 153847 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
文章列表
因为mysql的slave报错,导致slave落后master很远。找资料查看同步状态。 引用 mysql> show slave status\G *************************** 1. row ***************************                Slave_IO_State: Waiting for master to send event                   Master_Host: 192.168.0.103                   Master_User: root                 ...
引用 100920 10:50:21 mysqld_safe Starting mysqld daemon with databases from /byread/data InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: mmap(11010048000 bytes) failed; errno 12 InnoDB: Fatal error: cannot allocate the memory for the buffer pool 1 ...

Nginx的status信息

引用 Active connections: 145 server accepts handled requests 36380 36380 38382 Reading: 6 Writing: 5 Waiting: 134 引用 active connections -- number of all open connections including connections to backends server accepts handled requests -- nginx accepted 16630948 connections, handled 16630948 con ...
Mongodb启动: nohup /byread/bin/mongodb/bin/mongod --dbpath=/byread/mongodb 2>&1 >> /byread/logs/mongodb/mongodb.log & 关闭: db.shutdownServer() kill -2 PID kill -15 PID 创建索引 db.things.ensureIndex({j:1}); 1升序,-1降序 索引的作用比较大,下面列出索引前和索引后的两个状态,锁表时间大大减少。 引用 [root@bookweb byread]# /byread/bin/ ...
今天观察Nginx的错误日志,发现有一些客户端下载文件时,报下列错误。 引用 2010/07/17 09:26:53 [alert] 505#0: *764839 sendfile() failed (22: Invalid argument), 为了查出原因,在服务器上对此请求的IP进行抓包分析,发现原来是HTTP包头中的Range字段有问题。 请求包头中的Range字段信息: 引用 Range: bytes=281851- 回应包头中的信息: 引用 Content-Length: -77764 Content-Range: bytes  281851-204086/204087 分 ...
引用 The Content-Range entity-header is sent with a partial entity-body to specify where in the full entity-body the partial body should be applied. HTTP 回应Content-Range用于指出在整个数据文件中发送部分的数据范围。 引用 A server sending a response with status code 416 (Requested range not satisfiable) SHOULD include a Cont ...
Nginx的perl模块中的sendfile支持续传功能。 1、获取客户端请求的偏移位置。 $range = $r->header_in("Range"); $start = 0; if( $range =~ /bytes=(\d+)-/ ) { $start = $1; } 2、获取文件大小并返回正确的头部信息 @s=stat($r->filename); $conlen = $s[7] - $start; $r->header_out('Content-Length',$con ...
因为公司业务需要记录每一个用户某一个类型的文件最后一次请求,提供继续阅读功能,所以在Nginx里加了一个小模块,当有用户请求进来时,响应数据并在Memcached和Mongodb记录此URL。 配置Nginx 引用 perl_modules perl/lib; perl_require bookvisit.pm; 引用 location ~* ^.+\.bcs$ { perl bookvisit::handler; root /byread/books/vipbook; } package bookvisit; use warnings; use nginx; use ...
今天遇到了数据库的死锁问题,导致应用无法提供服务。当时只好重启tomcat,现在还是会不断的提示死锁,只是服务还能跑。 引用 100528 14:16:03 *** (1) TRANSACTION: TRANSACTION 1 720592357, ACTIVE 0 sec, process no 3588, OS thread id 1337043264 inserting mysql tables in use 1, locked 1 LOCK WAIT 3 lock struct(s), heap size 1216, undo log entries 1 MySQL thread id ...
MySQL的二进制日志文件很大,运行时间长了会占用很大的磁盘空间。MySQL提供了自动删除二进制日志文件的功能,但默认是不打开的。可以通过参数expire_logs_days来进行设置。你也可以通过命令来清除指定日期或文件名之前的日志。 purge binary logs before '2010-05-10 00:00:00'; 在网上看到有人遇到参数设置和命令不起作用的问题,大概原因是手工删除过二进制的文件。MySQL有一个文件mysql-bin.index来保存当前日志文件的索引,如果你手工删除过文件,但又没有更新索引文件,在MySQL执行命令时会导致出错无法工作。
今天做主从读写分离时,发现MySQL从库出现键冲突,同步停止工作。看到网上 http://www.pinoytux.com/linux/tip-mysql-replication-error-duplicate-entry-for-key 这篇章说可能是因为主库表为MyISAM时,会出现这样的问题,我的主库表就是MyISAM,准备工作正常后,将从库做主库。 临时的解决方法是: slave stop; set GLOBAL sql_slave_skip_counter = 1; slave start; show slave status;
今天迁移了一个数据库,出现以下报错: 引用 InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes InnoDB: than specified in the .cnf file 0 5242880 bytes! 100519 14:57:57 [ERROR] Plugin 'InnoDB' init function returned error. 100519 14:57:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE fa ...
上次说MySQL出现问题后,slave也不能同步了,具体报错信息如下: 引用 100313 10:59:23 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'masterlog.000194' position 963415201 我们的Slave只同步了主库的一张MyISAM表。我的解决方案如下: 1、在一台机器上(A)用每日凌晨innobackupex备份主库恢复出一个数据库 2、在A机器上配置一下Slave,同步主库对应的表 3、停止A机器上的Slave 4、关闭A机器上的数 ...
新版本对权限控制有一些变动,当我使用innobackupex恢复数据后,查看Mysql的错误日志发现以下错误: 引用 100517  9:59:14 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist 100517  9:59:14 [ERROR] Column count of mysql.db is wrong. Expected 22, found 15. Created with MySQL 0, now running 50143. Please use mysql_upgr ...
因为开发之初数据库没有进行好的设计,有很多表的查询字段没有创建索引,系统运行几年以后,表的记录数达到了几千万,这时性能问题突显出来。 诱因是在系统繁忙的时间,突发来了很多无索引的查询,导致一个关键的表被锁。这时候系统无法对外提供服务。 采取措施: 在mysql中kill所有的慢查询语句。但还是不停的有查询进来,停止应用,iptables封掉数据库端口,再kill。 这时出现了奇怪的状态,数据库自动重启了,查看数据库错误日志: 引用 mysqld got signal 11; This could be because you hit a bug. It is also possible t ...
Global site tag (gtag.js) - Google Analytics