chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING

前端js文件突然加载失效查看浏览器console显示错误net::ERR_INCOMPLETE_CHUNKED_ENCODING google后可能应为 输出代理文件大小超过配置proxy_temp_file_write_size时候,nginx会将文件写入到临时目录下。如果没有权限,chrom就会直接failed而不输出东西 查看nginx error.log 2019/09/25 15:21:28 [crit] 3269#3269: *202613489 pwritev() "/var/cache/nginx/proxy_temp/3/66/0000177663" failed (28: No space left on device) while reading upstream, client: 61.158.152.7, server: api........... 发现原来是没有磁盘空间了,释放空间后显示正常

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

redis异常重启后返回 MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. 估计是同步磁盘的时候强行重启导致 更改配置 config set stop-writes-on-bgsave-error no 如果还不能解决 更换rdb文件并重新同步db文件 config set dir /tmp/some/directory/other/than/var config set dbfilename temp.rdb bgsave

mysql 关联查询 索引失效

接手一个新项目数据导出需求 大致sql如下 select b.* from wms_sku_uuids a inner JOIN wms_entity_operate_log b on a.uuid=b.entity_code where a.uuid="00617531" and a.`status`=9 附表大约650w条记录 explain 发现附表每次都是全量查找 怀疑是不是sql语句的问题 于是换成where in 子查询的方式附表还是全量 show create table   查询都覆盖到的索引 百度后发现数据类型不同或相同类型字符编码不同会造成不走索引于是 SHOW FULL COLUMNS FROM wms_sku_uuids; 1556009056879 发现字符编码的确不同  字符编码同步后 1556009283207  

nginx 禁止ip访问

继上次jenkins漏洞后小博客最近又被搞了 各种链接超时 状态504 登录服务器 top 查看 进程正常 ps  -aux | grep php-fpm  查看进程数正常 netstat -tunlpa | grep 9000 发现大量链接阻塞 查看nginx error.log 大量504 追踪 nginx access.log 发现有个ip不停POST某链接 cat /var/log/nginx/access.log| jq ".clientip" |sed 's/\"//g' | sort | uniq  -c  |  sort -n -r  查找有问题的ip 打开nginx配置 server 增加deny ip 重启nginx 网站能正常访问  查看日志问题ip访问返回状态403

mysql 批量建表 存储过程

delimiter // CREATE procedure create_table() BEGIN DECLARE `@i` int(11); DECLARE `@sqlstr` varchar(65000); SET `@i`=0; WHILE `@i` < 256 DO SET @sqlstr = CONCAT( "CREATE TABLE box_item_pool_", `@i`, "( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `_unique` varchar(64) NOT NULL DEFAULT '' COMMENT '分表后唯一标示', `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', `box_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '盒子ID', `prod_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID, 目前是product_master.id', `prod_code` varchar(32) NOT NULL DEFAULT '' COMMENT '商品CODE, 目前是product_master.code', `product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'product.id', `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `_unique` (`_unique`) USING BTREE, KEY `user_box` (`user_id`,`box_id`), KEY `box` (`box_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;" ); prepare stmt from @sqlstr; execute stmt; SET `@i` = `@i` + 1; END WHILE; END; call create_table(); drop procedure create_table; //

ibatis java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timest

java.sql.SQLException:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 原因:因为数据库里面存储了这样子的值,所以查询的时候报错了 解决方案:在url路径哪里加上一句话 jdbc.url=jdbc:mysql://ip地址\:端口号/数据库名称?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull