08 2016 档案

摘要:zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./logstash -e 'input{stdin{}} output{stdout{codec=>rubydebug}}'Settings: Default pipeline workers: 1... 阅读全文
posted @ 2016-08-31 15:33 czcb 阅读(118) 评论(0) 推荐(0) 编辑
摘要:DBHost=192.168.32.55DBName= zabbixDBUser=zabbixuserDBPassword=zabbixpassStartTrappers=20MaxHousekeeperDelete=5000 CacheSize=1024MStartDBSyncer... 阅读全文
posted @ 2016-08-31 14:06 czcb 阅读(262) 评论(0) 推荐(0) 编辑
摘要:DBHost=192.168.32.55DBName= zabbixDBUser=zabbixuserDBPassword=zabbixpassStartTrappers=20MaxHousekeeperDelete=5000 CacheSize=1024MStartDBSyncer... 阅读全文
posted @ 2016-08-31 14:06 czcb 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-31 13:40 czcb 阅读(1329) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-31 13:40 czcb 阅读(274) 评论(0) 推荐(0) 编辑
摘要:启动 kibana# /usr/local/kibana-4.1.1-linux-x64/bin/kibanazjtest7-redis:/usr/local/kibana-4.5.3-linux-x64/bin# ./kibana log [10:50:33.506] [info][o... 阅读全文
posted @ 2016-08-31 11:15 czcb 阅读(321) 评论(0) 推荐(0) 编辑
摘要:在和 codec/multiline 搭配使用的时候,需要注意一个问题,grok 正则和普通正则一样,默认是不支持匹配回车换行的。就像你需要 =~ //m 一样也需要单独指定,具体写法是在表达式开始位置加 (?m) 标记。如下所示:match => { "message" => "(?m)... 阅读全文
posted @ 2016-08-31 09:31 czcb 阅读(1488) 评论(0) 推荐(0) 编辑
摘要:看elk 看到一个正则;\s+(?\d+(?:\.\d+)?)\s+回顾下:(?:pattern) 匹 配 pattern 但不获取匹配结果,也就是说这是一个非获取匹配,不进行存储供以后使用。这在使用 “或” 字符 (|) 来组合一个模式的各个部分是很有用。例如, ‘industr(?:y|ie... 阅读全文
posted @ 2016-08-30 22:38 czcb 阅读(1021) 评论(0) 推荐(0) 编辑
摘要:(pattern) 匹配 pattern 并获取这一匹配。所获取的匹配可以从产生的 Matches 集合得到,在VBScript 中使用 SubMatches 集合,在JScript 中则使用 $0…$9 属性。要匹配圆括号字符,请使用 ‘\(’ 或 ‘\)’。 (?:pattern) 匹 配 ... 阅读全文
posted @ 2016-08-30 22:12 czcb 阅读(221) 评论(0) 推荐(0) 编辑
摘要:(pattern) 匹配 pattern 并获取这一匹配。所获取的匹配可以从产生的 Matches 集合得到,在VBScript 中使用 SubMatches 集合,在JScript 中则使用 $0…$9 属性。要匹配圆括号字符,请使用 ‘\(’ 或 ‘\)’。 (?:pattern) 匹 配 ... 阅读全文
posted @ 2016-08-30 22:12 czcb 阅读(171) 评论(0) 推荐(0) 编辑
摘要:[elk@dr-mysql01 mysql]$ cat logstash_mysql.confinput { file { type => "zj_mysql" path => ["/data01/applog_backu... 阅读全文
posted @ 2016-08-30 21:02 czcb 阅读(346) 评论(0) 推荐(0) 编辑
摘要:[elk@dr-mysql01 mysql]$ cat logstash_mysql.confinput { file { type => "zj_mysql" path => ["/data01/applog_backu... 阅读全文
posted @ 2016-08-30 21:02 czcb 阅读(127) 评论(0) 推荐(0) 编辑
摘要:# User@Host: zjzc_app[zjzc_app] @ [10.252.148.16xx] Id: 6043127# Query_time: 2.581184 Lock_time: 0.000336 Rows_sent: 6 Rows_examined: 6331310SET... 阅读全文
posted @ 2016-08-30 20:24 czcb 阅读(129) 评论(0) 推荐(0) 编辑
摘要:# User@Host: zjzc_app[zjzc_app] @ [10.252.148.16xx] Id: 6043127# Query_time: 2.581184 Lock_time: 0.000336 Rows_sent: 6 Rows_examined: 6331310SET... 阅读全文
posted @ 2016-08-30 20:24 czcb 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-30 17:58 czcb 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-30 17:58 czcb 阅读(119) 评论(0) 推荐(0) 编辑
摘要:2016/08/30 14:52:02 [error] 11325#0: *346 open() "/var/www/zjzc-web-frontEnd/%27%22%2f%3E%3C%2fscript%3E%3Cscript%3Ealert%28%29%3C%2fscript%3E" fail... 阅读全文
posted @ 2016-08-30 15:00 czcb 阅读(962) 评论(0) 推荐(0) 编辑
摘要:log_format main '$remote_addr [$time_local] "$request" ' '$request_body $status $body_bytes_sent "$http_referer" "$http_us... 阅读全文
posted @ 2016-08-30 14:53 czcb 阅读(205) 评论(0) 推荐(0) 编辑
摘要:121.40.205.143 [30/Aug/2016:14:03:08 +0800] "GET /resources/images/favicon.ico HTTP/1.1" - 200 4286 "https://uatest.winfae.com/products/productList.... 阅读全文
posted @ 2016-08-30 14:21 czcb 阅读(201) 评论(0) 推荐(0) 编辑
摘要:grok:解析任意文本并构造它:Grok 是当前最好的方式在logstash 解析蹩脚的非结构化日志数据 到一些结构化的可查询的。这个工具是完美的对于syslog logs, apache和其他webserver logs,mysqllogs,在一般情况下,任何日志格式通常对于人是友好的而不是对... 阅读全文
posted @ 2016-08-30 13:57 czcb 阅读(509) 评论(0) 推荐(0) 编辑
摘要:nginx 多路径: location / { root /t/deploy/zjdev/deployedApps/zjzc-web-frontEnd/; index index.html index.htm; } ... 阅读全文
posted @ 2016-08-30 09:38 czcb 阅读(632) 评论(0) 推荐(0) 编辑
摘要:[root@dr-mysql01 tomcat]# cat logstash_tomcat.conf input { file { type => "zj_api" path => ["/data01/applog_bac... 阅读全文
posted @ 2016-08-29 20:08 czcb 阅读(632) 评论(0) 推荐(0) 编辑
摘要:2016-08-29 17:40:01,19 INFO com.zjzc.common.utils.HttpUtil - 请求接口: https://www.zjcap.cn/pay/interface/querypayorder, 耗时=-173 ^\s*%{TIMESTAMP_ISO8601... 阅读全文
posted @ 2016-08-29 18:40 czcb 阅读(399) 评论(0) 推荐(0) 编辑
摘要:2016-08-29 17:40:01,191 INFO com.zjzc.common.utils.HttpUtil - 请求接口: https://www.zjcap.cn/pay/interface/querypayorder, 耗时=-173 ^\s+%{TIMESTAMP_ISO... 阅读全文
posted @ 2016-08-29 17:49 czcb 阅读(838) 评论(0) 推荐(0) 编辑
摘要:log_format main '$remote_addr [$time_local] "$request" ' '$request_body $status $body_bytes_sent "$http_referer" "$http_user_... 阅读全文
posted @ 2016-08-29 17:41 czcb 阅读(318) 评论(0) 推荐(0) 编辑
摘要:log_format main '$remote_addr [$time_local] "$request" ' '$request_body $status $body_bytes_sent "$http_referer" "$http_user_... 阅读全文
posted @ 2016-08-29 17:41 czcb 阅读(161) 评论(0) 推荐(0) 编辑
摘要:logstash 正则调试;nginx 配置;log_format main '$remote_addr [$time_local] "$request" ';logstash: "message" =>"%{IPORHOST:clientip} \[%{HTTPDATE:time}\] \... 阅读全文
posted @ 2016-08-29 15:39 czcb 阅读(402) 评论(0) 推荐(0) 编辑
摘要:nginx 配置:http { include mime.types; default_type application/octet-stream; log_format main '$http_host $server_addr $remote_addr ... 阅读全文
posted @ 2016-08-29 09:54 czcb 阅读(222) 评论(0) 推荐(0) 编辑
摘要:What does “acl cdn_name hdr_beg(host) -i foor.bar.com” mean in HAProxy's configuration?在Haproxy 里配置是什么意思、它是顶替一个ACL 叫做cdn_name,使用 hdr_beg(host) -i fo... 阅读全文
posted @ 2016-08-28 13:54 czcb 阅读(461) 评论(0) 推荐(0) 编辑
摘要:1.2. HTTP request-----------------First, let's consider this HTTP request : Line Contents number 1 GET /serv/login.php?lang=en&profile... 阅读全文
posted @ 2016-08-28 13:37 czcb 阅读(228) 评论(0) 推荐(0) 编辑
摘要:下面是日志的样子55.3.244.1 GET /index.html 15824 0.043正则的例子%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}配置文件里是怎么写得?... 阅读全文
posted @ 2016-08-27 23:32 czcb 阅读(431) 评论(0) 推荐(0) 编辑
摘要:http://xiaorui.cc/2015/01/27/logstash%E4%BD%BF%E7%94%A8grok%E6%AD%A3%E5%88%99%E8%A7%A3%E6%9E%90%E6%97%A5%E5%BF%97%E9%81%87%E5%88%B0%E7%9A%84%E9%97%A... 阅读全文
posted @ 2016-08-27 22:20 czcb 阅读(451) 评论(0) 推荐(0) 编辑
摘要:/***第一种nginx 配置: location / { root /var/www/zjzc-web-frontEnd; index index.html; }zjtest7-frontend:/var/www/zjzc-w... 阅读全文
posted @ 2016-08-26 20:07 czcb 阅读(288) 评论(0) 推荐(0) 编辑
摘要:(?:\s+?) 0个或者多个空格 阅读全文
posted @ 2016-08-26 17:55 czcb 阅读(82) 评论(0) 推荐(0) 编辑
摘要:input { file { type => "zj_mysql" path => ["/data01/applog_backup/zjzc_log/zj-mysql01-slowlog.*"] } ... 阅读全文
posted @ 2016-08-26 15:24 czcb 阅读(408) 评论(0) 推荐(0) 编辑
摘要:自带的全局变量,默认值为“\n". perl中”行“的概念就由$/决定[root@zjzc01 binlog]# cat binlog.sh ls -ltr mysql-bin.* | grep -v index | awk '{print $NF}' | while read Adoech... 阅读全文
posted @ 2016-08-26 13:28 czcb 阅读(192) 评论(0) 推荐(0) 编辑
摘要:$/ 改变换行符[root@zjzc01 binlog]# cat a1.pl open (A,";print $lines;[root@zjzc01 binlog]# perl a1.pl update ClientActionTrack set[root@zjzc01 binlog]# ca... 阅读全文
posted @ 2016-08-26 13:14 czcb 阅读(355) 评论(0) 推荐(0) 编辑
摘要:$/ 改变换行符[root@zjzc01 binlog]# cat a1.pl open (A,";print $lines;[root@zjzc01 binlog]# perl a1.pl update ClientActionTrack set[root@zjzc01 binlog]# ca... 阅读全文
posted @ 2016-08-26 13:14 czcb 阅读(325) 评论(0) 推荐(0) 编辑
摘要:update 语句示例:UPDATE `zjzc`.`QRTZ_SCHEDuler_state` SET `ip`='220.191.34.246' WHERE `sn`='3117764' and`startTime`='2016-07-20 00:02:40';UPDATE QRTZ_SCH... 阅读全文
posted @ 2016-08-26 12:58 czcb 阅读(212) 评论(0) 推荐(0) 编辑
摘要:update 语句示例:UPDATE `zjzc`.`QRTZ_SCHEDuler_state` SET `ip`='220.191.34.246' WHERE `sn`='3117764' and`startTime`='2016-07-20 00:02:40';UPDATE QRTZ_SCH... 阅读全文
posted @ 2016-08-26 12:58 czcb 阅读(369) 评论(0) 推荐(0) 编辑
摘要:if ( $#ARGV < 2 ){ print "please input like binglog-0001 '2013-07-01 00:00:00' '2013-07-02 00:00:00'!\n"; exit(-1); ... 阅读全文
posted @ 2016-08-26 10:49 czcb 阅读(151) 评论(0) 推荐(0) 编辑
摘要:to_days()Given a date date, returns a day number (the number of days since year 0).给定一个date 日期,返回天数Create Table: CREATE TABLE `ClientActionTrack` ( ... 阅读全文
posted @ 2016-08-26 10:23 czcb 阅读(3289) 评论(0) 推荐(0) 编辑
摘要:mysql> explain select * from ClientActionTrack where startTime>'2016-08-25 00:00:00' and startTime explain extended select * from ClientActionTrack ... 阅读全文
posted @ 2016-08-26 09:57 czcb 阅读(1359) 评论(0) 推荐(0) 编辑
摘要:一致性保证:ZooKeeeper 是一个高性能的,可扩展的服务。不管是读和写操作是被设计成快速,虽然读比写快。这样做的原因是在读的情况下,Zookeeper 可以提供旧的数据,反过来又是由于Zookeeper的一致性保证;顺序一致性;从客户端更新会按他们发送的顺序应用原子性;更新成功还是失败 ... 阅读全文
posted @ 2016-08-25 22:16 czcb 阅读(1397) 评论(0) 推荐(0) 编辑
摘要:zookeeper本身支持单机部署和集群部署,生产环境建议使用集群部署,因为集群部署不存在单点故障问题,并且zookeeper建议部署的节点个数为奇数个,只有超过一半的机器不可用整个zk集群才不可用。zookeeper集群中主要有两个角色leader和flower,每个客户端可以连接集群中的任何... 阅读全文
posted @ 2016-08-25 21:08 czcb 阅读(515) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat geoip.confinput {stdin {} }filter { geoip { source =>"message" }} output { stdout { ... 阅读全文
posted @ 2016-08-25 16:46 czcb 阅读(353) 评论(0) 推荐(0) 编辑
摘要:高级用法 多行匹配:zjtest7-frontend:/root/0825# cat a2.pl print "1111111111111\n";my $_="abc\nABC\nabc";print $_;print "\n";print "2222222222222\n";my $_="ab... 阅读全文
posted @ 2016-08-25 16:26 czcb 阅读(275) 评论(0) 推荐(0) 编辑
摘要:2.3.2 grok 正则捕获:\s+ 和 [\n\t\r\f]+ 一样 1、命名分组格式为(?),反向引用时用\k2、命名分组的匹配的结果存在在变量%+变量中,取命名分组值,$+{grp name}.zjtest7-frontend:/root/0825# cat a1.pl my $str... 阅读全文
posted @ 2016-08-25 15:12 czcb 阅读(134) 评论(0) 推荐(0) 编辑
摘要:2.3.2 grok 正则捕获:\s+ 和 [\n\t\r\f]+ 一样 1、命名分组格式为(?),反向引用时用\k2、命名分组的匹配的结果存在在变量%+变量中,取命名分组值,$+{grp name}.zjtest7-frontend:/root/0825# cat a1.pl my $str... 阅读全文
posted @ 2016-08-25 15:12 czcb 阅读(346) 评论(0) 推荐(0) 编辑
摘要:2.2.2 多行事件编码:zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./plugin list | grep multiIgnoring ffi-1.9.13 because its extensions are not built. Tr... 阅读全文
posted @ 2016-08-25 14:38 czcb 阅读(529) 评论(0) 推荐(0) 编辑
摘要:/*************** 根据type判断input { file { type => "zj_frontend_access" path => ["/data01/applog_backup/zjzc_log/z... 阅读全文
posted @ 2016-08-25 11:27 czcb 阅读(565) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./logstash -e 'input{stdin{}} output{stdout{codec=>rubydebug}}'Settings: Default pipeline workers: 1... 阅读全文
posted @ 2016-08-25 10:50 czcb 阅读(110) 评论(0) 推荐(0) 编辑
摘要:C:\>ping www.zjtest7.com正在 Ping www.zjtest7.com [192.168.32.82] 具有 32 字节的数据:来自 192.168.32.82 的回复: 字节=32 时间 v-test-app01:/t/deploy/zjtest/deployedA... 阅读全文
posted @ 2016-08-25 10:09 czcb 阅读(353) 评论(0) 推荐(0) 编辑
摘要:path : string This extracts the request's URL path, which starts at the first slash and ends before the question mark (without the host part). A t... 阅读全文
posted @ 2016-08-25 09:43 czcb 阅读(448) 评论(0) 推荐(0) 编辑
摘要:[root@dr-mysql01 frontend-error]# cat logstash_error.conf input { file { type => "zj_frontend_error" path => ["... 阅读全文
posted @ 2016-08-24 16:43 czcb 阅读(787) 评论(0) 推荐(0) 编辑
摘要:[root@dr-mysql01 frontend]# cat logstash_frontend.conf input { file { type => "zj_frontend_access" path => ["/d... 阅读全文
posted @ 2016-08-24 15:43 czcb 阅读(367) 评论(0) 推荐(0) 编辑
摘要:input(type="imfile"File="/var/log/nginx/access.log"Tag="zjzc-frontend01-access"Severity="info"Facility="local5")input(type="imfile"File="/var/log/ng... 阅读全文
posted @ 2016-08-24 12:34 czcb 阅读(166) 评论(0) 推荐(0) 编辑
摘要:input(type="imfile"File="/var/log/nginx/access.log"Tag="zjzc-frontend01-access"Severity="info"Facility="local5")input(type="imfile"File="/var/log/ng... 阅读全文
posted @ 2016-08-24 12:34 czcb 阅读(130) 评论(0) 推荐(0) 编辑
摘要:14.3.5.1 Interaction of Table Locking and Transactions 表锁和事务的相互作用LOCK TABLES 和UNLOCK TABLES 交互实用事务如下:1. LOCK TABLES 不是事务安全的和隐式提交任何活动的事务 在尝试锁定表前2.U... 阅读全文
posted @ 2016-08-24 11:01 czcb 阅读(129) 评论(0) 推荐(0) 编辑
摘要:14.3.5.1 Interaction of Table Locking and Transactions 表锁和事务的相互作用LOCK TABLES 和UNLOCK TABLES 交互实用事务如下:1. LOCK TABLES 不是事务安全的和隐式提交任何活动的事务 在尝试锁定表前2.U... 阅读全文
posted @ 2016-08-24 11:01 czcb 阅读(130) 评论(0) 推荐(0) 编辑
摘要:14.3.5 LOCK TABLES and UNLOCK TABLES SyntaxLOCK TABLES tbl_name [[AS] alias] lock_type [, tbl_name [[AS] alias] lock_type] ...lock_type: RE... 阅读全文
posted @ 2016-08-24 10:36 czcb 阅读(131) 评论(0) 推荐(0) 编辑
摘要:14.3.5 LOCK TABLES and UNLOCK TABLES SyntaxLOCK TABLES tbl_name [[AS] alias] lock_type [, tbl_name [[AS] alias] lock_type] ...lock_type: RE... 阅读全文
posted @ 2016-08-24 10:36 czcb 阅读(166) 评论(0) 推荐(0) 编辑
摘要:log_format main '$http_host $server_addr $remote_addr [$time_local] "$request" ' '$request_body $status $body_bytes_sent "$h... 阅读全文
posted @ 2016-08-23 20:47 czcb 阅读(105) 评论(0) 推荐(0) 编辑
摘要:START TRANSACTION, COMMIT, and ROLLBACK Syntax 开始事务,提交和回滚语法那些语句提供了控制事务的使用:1.START TRANSACTION 或者BEGIN 开始一个新的事务2.提交当前事务,让改变永久3.回滚 回滚当前事务,取消它的改变4.设置au... 阅读全文
posted @ 2016-08-23 20:15 czcb 阅读(294) 评论(0) 推荐(0) 编辑
摘要:grok 正则捕获:grok 是Logstash 最重要的插件, 你可以在grok 里预定义好命名正则表达式,在稍后(grok 参数或者其他正则表达式里)引用它。2.3.3 GeoIP 地址查询;GeoIP 是最常见的免费IP地址归类查询库, 同时也有收费版可以采购。GeoIP库可以根据IP地址... 阅读全文
posted @ 2016-08-23 17:40 czcb 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Logstash 使用一个名叫FileWatch的Ruby Gem库来监听文件变化,这个库支持glob扩展文件路径,而且会记录一个叫.sincedb的数据库文件来跟踪被监听日志文件的当前读取位置,所以,不要担心Logstash会漏掉你的数据。使用Redis 或者其他的消息队列系统来作为Logst... 阅读全文
posted @ 2016-08-23 15:41 czcb 阅读(138) 评论(0) 推荐(0) 编辑
摘要:$dbh = DBI->connect("dbi:mysql:database=$db_name;host=$ip;port=3306",$user,$passwd,{ RaiseError => 1, ... 阅读全文
posted @ 2016-08-23 14:42 czcb 阅读(302) 评论(0) 推荐(0) 编辑
摘要:MySQL RR 模式下 事务隔离问题:Session 1:mysql> select * from test;+------+------+| id | name |+------+------+| NULL | a || 2 | b || 3 | c || ... 阅读全文
posted @ 2016-08-23 13:54 czcb 阅读(132) 评论(0) 推荐(0) 编辑
摘要:Session 1:mysql> use zjzc;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup w... 阅读全文
posted @ 2016-08-23 13:24 czcb 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Session 1:mysql> use zjzc;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup w... 阅读全文
posted @ 2016-08-23 13:24 czcb 阅读(120) 评论(0) 推荐(0) 编辑
摘要:事务;事务是任何健壮数据库系统的基本组成,它们 防止错误和数据库腐败通过确保有关数据的改变是原子发生的(不可分割的,要么所有要么什么都不做)这个章节应用于数据库支持事务和 AutoCommit 是关闭的,查看"AutoCommit" 使用对于各种类型的数据库。推荐的方式实现健壮的事务在Perl应... 阅读全文
posted @ 2016-08-23 11:08 czcb 阅读(246) 评论(0) 推荐(0) 编辑
摘要:v-dev-app01:/root# ping www.zjdev.comPING www.zjdev.com (192.168.32.16) 56(84) bytes of data.64 bytes from 192.168.32.16: icmp_seq=1 ttl=64 time=0.2... 阅读全文
posted @ 2016-08-23 10:05 czcb 阅读(622) 评论(0) 推荐(0) 编辑
摘要:[elk@zjtest7-frontend config]$ cat logstash_agent.conf input { file { type => "zj_nginx_access" path => ["/rsys... 阅读全文
posted @ 2016-08-22 22:22 czcb 阅读(509) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat logstash_indexer01.conf input { redis { host => "192.168.32.67" ... 阅读全文
posted @ 2016-08-22 13:52 czcb 阅读(904) 评论(0) 推荐(0) 编辑
摘要:# 更多ELK资料请访问 http://devops.taobao.com一、配置前需要注意:1.Use chmod to modify nginx log file privilege. E.g. chmod 664 access.log2.Modify /etc/default/logsta... 阅读全文
posted @ 2016-08-22 12:39 czcb 阅读(1087) 评论(0) 推荐(0) 编辑
摘要:设置高级的Logstash 管道:一个Logstash 管道在很多实用例子有一个或者多个输入,filter,和output 插件。本节中 创建Logstash 配置文件来指定那些插件和讨论每个插件做什么Logstash 配置文件定义你的Logstash 管道。当你开始一个Logstash 例子,... 阅读全文
posted @ 2016-08-22 11:28 czcb 阅读(403) 评论(0) 推荐(0) 编辑
摘要:The default behavior of the file input plugin is to ignore files whose last modification is greater than 86400s. To change this default behavior and... 阅读全文
posted @ 2016-08-22 10:37 czcb 阅读(196) 评论(0) 推荐(0) 编辑
摘要:基本的Logstash 例子:为了测试你的Logstash 安装,运行最基本的Logstash 管道:cd logstash-2.3.0bin/logstash -e 'input { stdin { } } output { stdout {} }'zjtest7-frontend:/usr/... 阅读全文
posted @ 2016-08-22 09:48 czcb 阅读(101) 评论(0) 推荐(0) 编辑
摘要:基本的Logstash 例子:为了测试你的Logstash 安装,运行最基本的Logstash 管道:cd logstash-2.3.0bin/logstash -e 'input { stdin { } } output { stdout {} }'zjtest7-frontend:/usr/... 阅读全文
posted @ 2016-08-22 09:48 czcb 阅读(130) 评论(0) 推荐(0) 编辑
摘要:安装Logstash:Logstash 需要 Java 7或者以后版本,使用官方的Oracle发布或者一个开源发布版本比如OpenJDK检查Java 版本,运行下面的命令:zjtest7-frontend:/rsyslog/data/nginx/zjzc# java -versionjava v... 阅读全文
posted @ 2016-08-22 09:33 czcb 阅读(93) 评论(0) 推荐(0) 编辑
摘要:安装Logstash:Logstash 需要 Java 7或者以后版本,使用官方的Oracle发布或者一个开源发布版本比如OpenJDK检查Java 版本,运行下面的命令:zjtest7-frontend:/rsyslog/data/nginx/zjzc# java -versionjava v... 阅读全文
posted @ 2016-08-22 09:33 czcb 阅读(128) 评论(0) 推荐(0) 编辑
摘要:--master-data[=#] This causes the binary log position and filename to be appended to the output. If equal to 1, will print ... 阅读全文
posted @ 2016-08-20 22:23 czcb 阅读(116) 评论(0) 推荐(0) 编辑
摘要:--master-data[=#] This causes the binary log position and filename to be appended to the output. If equal to 1, will print ... 阅读全文
posted @ 2016-08-20 22:23 czcb 阅读(144) 评论(0) 推荐(0) 编辑
摘要:在实际应用中,Logstash进程会被氛围两个不同的角色。运行在应用服务器上的尽量减轻运行压力,只做读取和转发,这个角色叫做shipper运行在独立的服务器上完成数据解析处理,负责写入到Elasticsearch的角色,叫做Indexer5.1.1 读取redis 数据:zjtest7-fron... 阅读全文
posted @ 2016-08-19 16:30 czcb 阅读(403) 评论(0) 推荐(0) 编辑
摘要:rsyslog 日志服务器;[root@dr-mysql01 winfae_log]# grep scan0819 wj-proxy01-catalina.out.2016-08-19 [root@dr-mysql01 winfae_log]#源端服务器:[tomcat@Proxy01 logs... 阅读全文
posted @ 2016-08-19 11:26 czcb 阅读(366) 评论(0) 推荐(0) 编辑
摘要:高级用法;多行匹配:grok正则和普通正则一样, 默认是不支持匹配回车换行的。perl的/m选项The /m modifier allows ^ and $ to match immediately before and after an embedded newline, respective... 阅读全文
posted @ 2016-08-19 10:21 czcb 阅读(535) 评论(0) 推荐(0) 编辑
摘要:高级用法;多行匹配:grok正则和普通正则一样, 默认是不支持匹配回车换行的。perl的/m选项The /m modifier allows ^ and $ to match immediately before and after an embedded newline, respective... 阅读全文
posted @ 2016-08-19 10:21 czcb 阅读(174) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/perl -w =pod 命名捕获--给匹配上的内容加上标签 捕获到的内容都会保存在%+散列中,这个散列的key为对应的标签; 方便之处就是利于程序扩展和阅读,不用繁琐的一个一个去数括号来获取匹配变量 =cut zjtest7-frontend:/root/perl# ca... 阅读全文
posted @ 2016-08-19 09:46 czcb 阅读(534) 评论(0) 推荐(0) 编辑
摘要:use base (Critter); 和 BEGIN{ require Critter; @ISA=qw/Critter/; } 这两种写法是等价 阅读全文
posted @ 2016-08-18 22:28 czcb 阅读(143) 评论(0) 推荐(0) 编辑
摘要:use base (Critter); 和 BEGIN{ require Critter; @ISA=qw/Critter/; } 这两种写法是等价 阅读全文
posted @ 2016-08-18 22:28 czcb 阅读(119) 评论(0) 推荐(0) 编辑
摘要:Docker 容器管理: docker create -it centos //这样可以创建一个容器,但该容器并没有启动:create Create a new container 创建一个容器:docker:/root# docker ps CONTAINER ID ... 阅读全文
posted @ 2016-08-18 16:34 czcb 阅读(126) 评论(0) 推荐(0) 编辑
摘要:Docker 容器管理: docker create -it centos //这样可以创建一个容器,但该容器并没有启动:create Create a new container 创建一个容器:docker:/root# docker ps CONTAINER ID ... 阅读全文
posted @ 2016-08-18 16:34 czcb 阅读(152) 评论(0) 推荐(0) 编辑
摘要:1.命令行运行在终端中, 像下面这样运行命令来启动Logstash 进程:[elk@zjtest7-frontend bin]$ ./logstash -e 'input{stdin{}}output{stdout{codec=>rubydebug}}'[elk@zjtest7-frontend... 阅读全文
posted @ 2016-08-18 14:51 czcb 阅读(143) 评论(0) 推荐(0) 编辑
摘要:1.命令行运行在终端中, 像下面这样运行命令来启动Logstash 进程:[elk@zjtest7-frontend bin]$ ./logstash -e 'input{stdin{}}output{stdout{codec=>rubydebug}}'[elk@zjtest7-frontend... 阅读全文
posted @ 2016-08-18 14:51 czcb 阅读(133) 评论(0) 推荐(0) 编辑
摘要:$EscapeControlCharactersOnReceive off #关闭rsyslog默认转译ASCII<32的所有怪异字符,包括换行符等$template tocFormat,"%msg%\n"#$template tocFormat,"%syslogtag%,%msg%\... 阅读全文
posted @ 2016-08-18 13:25 czcb 阅读(241) 评论(0) 推荐(0) 编辑
摘要:$EscapeControlCharactersOnReceive off #关闭rsyslog默认转译ASCII<32的所有怪异字符,包括换行符等$template tocFormat,"%msg%\n"#$template tocFormat,"%syslogtag%,%msg%\... 阅读全文
posted @ 2016-08-18 13:25 czcb 阅读(313) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/perl use DBI; use Encode;$user="root"; $passwd="1234567"; $dbh="192.168.32.232";my $table=; chomp $table;print "\$table is ... 阅读全文
posted @ 2016-08-17 15:13 czcb 阅读(148) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/perl use DBI; use Encode;$user="root"; $passwd="1234567"; $dbh="192.168.32.232";my $table=; chomp $table;print "\$table is ... 阅读全文
posted @ 2016-08-17 15:13 czcb 阅读(155) 评论(0) 推荐(0) 编辑
摘要:zjtest7-redis:/root/zk# cat test_zk.pl use ZooKeeper;use AnyEvent;use AE;use Data::Dumper;use IO::Socket; sub check_port { ... 阅读全文
posted @ 2016-08-16 13:58 czcb 阅读(217) 评论(0) 推荐(0) 编辑
摘要:zjtest7-redis:/root/zk# cat test_zk.pl use ZooKeeper;use AnyEvent;use AE;use Data::Dumper;use IO::Socket; sub check_port { ... 阅读全文
posted @ 2016-08-16 13:58 czcb 阅读(157) 评论(0) 推荐(0) 编辑
摘要:zjtest7-redis:/root/zk# cat a1.pl use ZooKeeper;use AnyEvent;use AE;use Data::Dumper;use IO::Socket; sub check_port { ( $... 阅读全文
posted @ 2016-08-16 11:27 czcb 阅读(160) 评论(0) 推荐(0) 编辑
摘要:zjtest7-redis:/root/zk# cat a1.pl use ZooKeeper;use AnyEvent;use AE;use Data::Dumper;use IO::Socket; sub check_port { ( $... 阅读全文
posted @ 2016-08-16 11:27 czcb 阅读(234) 评论(0) 推荐(0) 编辑
摘要:如果在连接时候zk服务器宕机To create a client session the application code must provide a connection string containing a comma separated list of host:port pairs,... 阅读全文
posted @ 2016-08-16 10:52 czcb 阅读(294) 评论(0) 推荐(0) 编辑
摘要:如果在连接时候zk服务器宕机To create a client session the application code must provide a connection string containing a comma separated list of host:port pairs,... 阅读全文
posted @ 2016-08-16 10:52 czcb 阅读(524) 评论(0) 推荐(0) 编辑
摘要:mysql master:test:/root/zk# cat zk.pluse ZooKeeper;use AnyEvent;use AE;use Data::Dumper;use IO::Socket; my $zk = ZooKeeper->new(hosts => '120.55.1... 阅读全文
posted @ 2016-08-15 21:26 czcb 阅读(140) 评论(0) 推荐(0) 编辑
摘要:mysql master:test:/root/zk# cat zk.pluse ZooKeeper;use AnyEvent;use AE;use Data::Dumper;use IO::Socket; my $zk = ZooKeeper->new(hosts => '120.55.1... 阅读全文
posted @ 2016-08-15 21:26 czcb 阅读(154) 评论(0) 推荐(0) 编辑
摘要:如果要把不同服务器发送过来的日志保存到不同的文件, 可以这样操作::fromhost-ip, isequal, “192.168.0.160″ /var/log/host160.log:FROMHOST-IP, isequal, “192.168.0.161″ /var/log/host161.... 阅读全文
posted @ 2016-08-15 16:08 czcb 阅读(145) 评论(0) 推荐(0) 编辑
摘要:如果要把不同服务器发送过来的日志保存到不同的文件, 可以这样操作::fromhost-ip, isequal, “192.168.0.160″ /var/log/host160.log:FROMHOST-IP, isequal, “192.168.0.161″ /var/log/host161.... 阅读全文
posted @ 2016-08-15 16:08 czcb 阅读(531) 评论(0) 推荐(0) 编辑
摘要:startswithChecks if the value is found exactly at the beginning of the property value. For example, if you search for “val” with:msg, startswith, "v... 阅读全文
posted @ 2016-08-15 13:31 czcb 阅读(137) 评论(0) 推荐(0) 编辑
摘要:startswithChecks if the value is found exactly at the beginning of the property value. For example, if you search for “val” with:msg, startswith, "v... 阅读全文
posted @ 2016-08-15 13:31 czcb 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-15 12:53 czcb 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-15 12:53 czcb 阅读(178) 评论(0) 推荐(0) 编辑
摘要:随后配置logrotate的配置文件/etc/logrotate.conf,加入下面的内容:/var/log/ipwall/messages.log { #日志路径一定要和rsyslog定义的日志文件路径一致 rotate 65535 #滚动65535次... 阅读全文
posted @ 2016-08-12 20:39 czcb 阅读(341) 评论(0) 推荐(0) 编辑
摘要:随后配置logrotate的配置文件/etc/logrotate.conf,加入下面的内容:/var/log/ipwall/messages.log { #日志路径一定要和rsyslog定义的日志文件路径一致 rotate 65535 #滚动65535次... 阅读全文
posted @ 2016-08-12 20:39 czcb 阅读(575) 评论(0) 推荐(0) 编辑
摘要:rsyslog tomcat 服务器:192.168.32.215input(type="imfile"File="/usr/local/apache-tomcat-7.0.55_8082/logs/catalina.out"Tag="zjtest-api01"Severity="info"F... 阅读全文
posted @ 2016-08-12 17:08 czcb 阅读(288) 评论(0) 推荐(0) 编辑
摘要:在另外一种环境中,让我们假定你已经在机器上安装了一个名为“foobar”的应用程序,它会在/var/log下生成foobar.log日志文件。现在,你想要将它的日志定向到rsyslog服务器,这可以通过像下面这样在rsyslog配置文件中加载imfile模块来实现。首先,加载imfile模块,这... 阅读全文
posted @ 2016-08-12 14:42 czcb 阅读(417) 评论(0) 推荐(0) 编辑
摘要:在另外一种环境中,让我们假定你已经在机器上安装了一个名为“foobar”的应用程序,它会在/var/log下生成foobar.log日志文件。现在,你想要将它的日志定向到rsyslog服务器,这可以通过像下面这样在rsyslog配置文件中加载imfile模块来实现。首先,加载imfile模块,这... 阅读全文
posted @ 2016-08-12 14:42 czcb 阅读(1021) 评论(0) 推荐(0) 编辑
摘要:格式::日志设备(类型).(连接符号)日志级别 日志处理方式(action)日志设备(可以理解为日志类型):———————————————————————-auth –pam产生的日志authpriv –ssh,ftp等登录信息的验证信息cron –时间任务... 阅读全文
posted @ 2016-08-12 09:32 czcb 阅读(264) 评论(0) 推荐(0) 编辑
摘要:格式::日志设备(类型).(连接符号)日志级别 日志处理方式(action)日志设备(可以理解为日志类型):———————————————————————-auth –pam产生的日志authpriv –ssh,ftp等登录信息的验证信息cron –时间任务... 阅读全文
posted @ 2016-08-12 09:32 czcb 阅读(624) 评论(0) 推荐(0) 编辑
摘要:perl 跨行匹配;6.6. Matching Within Multiple Lines6.6.1. ProblemYou want to use regular expressions on a string containing more than one logical line, b... 阅读全文
posted @ 2016-08-11 16:15 czcb 阅读(254) 评论(0) 推荐(0) 编辑
摘要:perl 跨行匹配;6.6. Matching Within Multiple Lines6.6.1. ProblemYou want to use regular expressions on a string containing more than one logical line, b... 阅读全文
posted @ 2016-08-11 16:15 czcb 阅读(443) 评论(0) 推荐(0) 编辑
摘要:elk之nginx: ignore_older => 86400,不处理一天以前的文件。zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat logstash_agent.conf input { file { ... 阅读全文
posted @ 2016-08-11 15:13 czcb 阅读(149) 评论(0) 推荐(0) 编辑
摘要:elk之nginx: ignore_older => 86400,不处理一天以前的文件。zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat logstash_agent.conf input { file { ... 阅读全文
posted @ 2016-08-11 15:13 czcb 阅读(131) 评论(0) 推荐(0) 编辑
摘要:1. 获取需要的binlog 日志:[root@zjzc01 binlog]# mysqlbinlog --start-datetime='2016-08-01 00:00:00' --stop-datetime='2016-08-11 12:00:00' mysql-bin.00006* >a... 阅读全文
posted @ 2016-08-11 13:46 czcb 阅读(132) 评论(0) 推荐(0) 编辑
摘要:1. 获取需要的binlog 日志:[root@zjzc01 binlog]# mysqlbinlog --start-datetime='2016-08-01 00:00:00' --stop-datetime='2016-08-11 12:00:00' mysql-bin.00006* >a... 阅读全文
posted @ 2016-08-11 13:46 czcb 阅读(217) 评论(0) 推荐(0) 编辑
摘要:日志格式:$EscapeControlCharactersOnReceive off #关闭rsyslog默认转译ASCII<32的所有怪异字符,包括换行符等$template nginx-zjzc01,"/rsyslog/data/nginx/zjzc/nginx_access01_... 阅读全文
posted @ 2016-08-11 12:15 czcb 阅读(299) 评论(0) 推荐(0) 编辑
摘要:日志格式:$EscapeControlCharactersOnReceive off #关闭rsyslog默认转译ASCII<32的所有怪异字符,包括换行符等$template nginx-zjzc01,"/rsyslog/data/nginx/zjzc/nginx_access01_... 阅读全文
posted @ 2016-08-11 12:15 czcb 阅读(2187) 评论(0) 推荐(0) 编辑
摘要:rsyslog默认会将特殊字符(\t)转换成#009 由全局配置$EscapeControlCharactersOnReceive 决定,如果自己需要根据\t处理输出时,需将该选项改为off。$EscapeControlCharactersOnReceive off #关闭rsyslo... 阅读全文
posted @ 2016-08-11 11:27 czcb 阅读(193) 评论(0) 推荐(0) 编辑
摘要:rsyslog默认会将特殊字符(\t)转换成#009 由全局配置$EscapeControlCharactersOnReceive 决定,如果自己需要根据\t处理输出时,需将该选项改为off。$EscapeControlCharactersOnReceive off #关闭rsyslo... 阅读全文
posted @ 2016-08-11 11:27 czcb 阅读(562) 评论(0) 推荐(0) 编辑
摘要:Using negation can be useful if you would like to do some generic processing but exclude some specific events. You can use the discard action in con... 阅读全文
posted @ 2016-08-11 11:12 czcb 阅读(181) 评论(0) 推荐(0) 编辑
摘要:Using negation can be useful if you would like to do some generic processing but exclude some specific events. You can use the discard action in con... 阅读全文
posted @ 2016-08-11 11:12 czcb 阅读(196) 评论(0) 推荐(0) 编辑
摘要:severity and facility Facility 定义日志消息的来源,以方便对日志进行分类,facility 有以下几种: --kern 内核消息 --user 用户级消息 --mail 邮件系统消息 --daemon 系统服务消息 ... 阅读全文
posted @ 2016-08-11 10:51 czcb 阅读(116) 评论(0) 推荐(0) 编辑
摘要:severity and facility Facility 定义日志消息的来源,以方便对日志进行分类,facility 有以下几种: --kern 内核消息 --user 用户级消息 --mail 邮件系统消息 --daemon 系统服务消息 ... 阅读全文
posted @ 2016-08-11 10:51 czcb 阅读(202) 评论(0) 推荐(0) 编辑
摘要:msgthe MSG part of the message (aka “the message” ;))message 的MSG 部分 rawmsgthe message excactly as it was received from the socket. Should be useful... 阅读全文
posted @ 2016-08-11 10:05 czcb 阅读(426) 评论(0) 推荐(0) 编辑
摘要:msgthe MSG part of the message (aka “the message” ;))message 的MSG 部分 rawmsgthe message excactly as it was received from the socket. Should be useful... 阅读全文
posted @ 2016-08-11 10:05 czcb 阅读(179) 评论(0) 推荐(0) 编辑
摘要:nginx 配置:user nginx;worker_processes 1;syslog local5 nginx-zjzc01;rsyslog 服务器收到的消息:-rw-r--r-- 1 root root 190 Aug 10 16:08 aa.logzjtest7-fronten... 阅读全文
posted @ 2016-08-10 16:26 czcb 阅读(376) 评论(0) 推荐(0) 编辑
摘要:nginx 配置:user nginx;worker_processes 1;syslog local5 nginx-zjzc01;rsyslog 服务器收到的消息:-rw-r--r-- 1 root root 190 Aug 10 16:08 aa.logzjtest7-fronten... 阅读全文
posted @ 2016-08-10 16:26 czcb 阅读(283) 评论(0) 推荐(0) 编辑
摘要:Templates 模板:模板是rsyslog的一个关键特性, 它们允许指定任何格式一个用户可能需要。它们也被用于动态文件命名生成,每个输出在rsyslog 使用模板。这适用于文件,用户消息等。数据库writer 期望它的模板是一个合适的SQL语句,因此这是一个高度自定义的。当没有模板被指定时... 阅读全文
posted @ 2016-08-10 13:57 czcb 阅读(200) 评论(0) 推荐(0) 编辑
摘要:Templates 模板:模板是rsyslog的一个关键特性, 它们允许指定任何格式一个用户可能需要。它们也被用于动态文件命名生成,每个输出在rsyslog 使用模板。这适用于文件,用户消息等。数据库writer 期望它的模板是一个合适的SQL语句,因此这是一个高度自定义的。当没有模板被指定时... 阅读全文
posted @ 2016-08-10 13:57 czcb 阅读(128) 评论(0) 推荐(0) 编辑
摘要:奇怪的Haproxy 跳转: acl admin_req path_beg -i /admin use_backend admin_80 i... 阅读全文
posted @ 2016-08-09 17:14 czcb 阅读(129) 评论(0) 推荐(0) 编辑
摘要:奇怪的Haproxy 跳转: acl admin_req path_beg -i /admin use_backend admin_80 i... 阅读全文
posted @ 2016-08-09 17:14 czcb 阅读(106) 评论(0) 推荐(0) 编辑
摘要:demo:/root# curl http://192.168.32.42:8082/api/用户管理Welcome Scanhttps://www.zjtest4.com/api/也是返回 Welcome Scan修改配置: 或者 http://192.168.32.42:8082/a... 阅读全文
posted @ 2016-08-09 16:37 czcb 阅读(417) 评论(0) 推荐(0) 编辑
摘要:demo:/root# curl http://192.168.32.42:8082/api/用户管理Welcome Scanhttps://www.zjtest4.com/api/也是返回 Welcome Scan修改配置: 或者 http://192.168.32.42:8082/a... 阅读全文
posted @ 2016-08-09 16:37 czcb 阅读(145) 评论(0) 推荐(0) 编辑
摘要:1、下载MongoDB(64位)http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.9.tgz或http://pan.baidu.com/s/1mgyRB8c2、安装MongoDB(安装到/usr/local)复制代码tar zxvf... 阅读全文
posted @ 2016-08-09 10:46 czcb 阅读(142) 评论(0) 推荐(0) 编辑
摘要:http://www.hyyche.com/#mainC:\Users\Administrator>ping hyyche.com正在 Ping hyyche.com [114.55.185.26] 具有 32 字节的数据:来自 114.55.185.26 的回复: 字节=32 时间=7ms T... 阅读全文
posted @ 2016-08-08 19:22 czcb 阅读(517) 评论(0) 推荐(0) 编辑
摘要:mysqldump -p -S /data/mysqldata1/sock/mysql.sock --single-transaction --master-data=2 --database db1 db2 db3 > db.sql1、single-transaction官方解释如下:--... 阅读全文
posted @ 2016-08-07 13:33 czcb 阅读(144) 评论(0) 推荐(0) 编辑
摘要:mysqldump -p -S /data/mysqldata1/sock/mysql.sock --single-transaction --master-data=2 --database db1 db2 db3 > db.sql1、single-transaction官方解释如下:--... 阅读全文
posted @ 2016-08-07 13:33 czcb 阅读(241) 评论(0) 推荐(0) 编辑
摘要:slave:/root# cat /etc/keepalived/keepalived.confglobal_defs { router_id MySQL-ha}vrrp_instance VI_1{# 在初始化状态下定义为主设备state BACKUP# 注意网卡接口interface e... 阅读全文
posted @ 2016-08-06 14:09 czcb 阅读(230) 评论(0) 推荐(0) 编辑
摘要:slave:/root# cat /etc/keepalived/keepalived.confglobal_defs { router_id MySQL-ha}vrrp_instance VI_1{# 在初始化状态下定义为主设备state BACKUP# 注意网卡接口interface e... 阅读全文
posted @ 2016-08-06 14:09 czcb 阅读(816) 评论(0) 推荐(0) 编辑
摘要:Aug 5 16:36:12 jrhwpt01 nginx-zjzc01: www.zjcap.cn 10.252.105.157 10.171.246.184 [05/Aug/2016:16:36:12 +0800] "GET /resources/js/toolbar.49fc367e.j... 阅读全文
posted @ 2016-08-05 16:40 czcb 阅读(157) 评论(0) 推荐(0) 编辑
摘要:Aug 5 16:36:12 jrhwpt01 nginx-zjzc01: www.zjcap.cn 10.252.105.157 10.171.246.184 [05/Aug/2016:16:36:12 +0800] "GET /resources/js/toolbar.49fc367e.j... 阅读全文
posted @ 2016-08-05 16:40 czcb 阅读(287) 评论(0) 推荐(0) 编辑
摘要:nginx 配置:user nginx;worker_processes 1;syslog local5 nginx;error_log /var/log/nginx/nginx_error.log crit;pid /var/run/nginx.pid;events {... 阅读全文
posted @ 2016-08-05 16:01 czcb 阅读(246) 评论(0) 推荐(0) 编辑
摘要:nginx 配置:user nginx;worker_processes 1;syslog local5 nginx;error_log /var/log/nginx/nginx_error.log crit;pid /var/run/nginx.pid;events {... 阅读全文
posted @ 2016-08-05 16:01 czcb 阅读(119) 评论(0) 推荐(0) 编辑
摘要:发送端:local5.* @@192.168.32.76front-end:/usr/local/nginx/logs# cat /etc/rsyslog.conf日志服务器端配置:# Provides TCP syslog reception$ModLoad imtcp$InputTCPSer... 阅读全文
posted @ 2016-08-05 13:24 czcb 阅读(329) 评论(0) 推荐(0) 编辑
摘要:*.info;mail.none;authpriv.none;cron.none;local3.none /var/log/messages表示 所有来源的info级别都记录到/var/log/messages local3.none 不写入到 /var/log... 阅读全文
posted @ 2016-08-05 11:31 czcb 阅读(589) 评论(0) 推荐(0) 编辑
摘要:*.info;mail.none;authpriv.none;cron.none;local3.none /var/log/messages表示 所有来源的info级别都记录到/var/log/messages local3.none 不写入到 /var/log... 阅读全文
posted @ 2016-08-05 11:31 czcb 阅读(1413) 评论(0) 推荐(0) 编辑
摘要:tar -xzf nginx-1.4.7.tar.gz# cd nginx-1.4.77# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx \--with-http_stub_status_module --wit... 阅读全文
posted @ 2016-08-05 10:59 czcb 阅读(149) 评论(0) 推荐(0) 编辑
摘要:tar -xzf nginx-1.4.7.tar.gz# cd nginx-1.4.77# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx \--with-http_stub_status_module --wit... 阅读全文
posted @ 2016-08-05 10:59 czcb 阅读(397) 评论(0) 推荐(0) 编辑
摘要:jrhnpt01:/root# nginx -Vnginx version: nginx/1.7.7built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) TLS SNI support enabledconfigure arguments: --... 阅读全文
posted @ 2016-08-05 10:16 czcb 阅读(113) 评论(0) 推荐(0) 编辑
摘要:jrhnpt01:/root# nginx -Vnginx version: nginx/1.7.7built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) TLS SNI support enabledconfigure arguments: --... 阅读全文
posted @ 2016-08-05 10:16 czcb 阅读(151) 评论(0) 推荐(0) 编辑
摘要:nginx 服务器:front-end:/usr/local/nginx/logs# cat /etc/rsyslog.conf | grep -v "^$" | grep -v "^#"$ModLoad imuxsock # provides support for local system ... 阅读全文
posted @ 2016-08-04 17:51 czcb 阅读(346) 评论(0) 推荐(0) 编辑
摘要:nginx 服务器:front-end:/usr/local/nginx/logs# cat /etc/rsyslog.conf | grep -v "^$" | grep -v "^#"$ModLoad imuxsock # provides support for local system ... 阅读全文
posted @ 2016-08-04 17:51 czcb 阅读(182) 评论(0) 推荐(0) 编辑
摘要:rsyslog web机器上日志被截断,那么就不会发送到rsyslog服务器因为imfile记录了offset,然后你直接>导致offset还没到 阅读全文
posted @ 2016-08-04 17:36 czcb 阅读(356) 评论(0) 推荐(0) 编辑
摘要:rsyslog web机器上日志被截断,那么就不会发送到rsyslog服务器因为imfile记录了offset,然后你直接>导致offset还没到 阅读全文
posted @ 2016-08-04 17:36 czcb 阅读(235) 评论(0) 推荐(0) 编辑
摘要:mysql> show grants for query_all@'115.236.1x0.x';+--------------------------------------------------------------------------------------------------... 阅读全文
posted @ 2016-08-04 17:26 czcb 阅读(6049) 评论(0) 推荐(0) 编辑
摘要:mysql> show grants for query_all@'115.236.1x0.x';+--------------------------------------------------------------------------------------------------... 阅读全文
posted @ 2016-08-04 17:26 czcb 阅读(213) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/root# rsyslogd -nrsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 55: warnings occured in file '/etc/rsysl... 阅读全文
posted @ 2016-08-04 16:37 czcb 阅读(968) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/root# rsyslogd -nrsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 55: warnings occured in file '/etc/rsysl... 阅读全文
posted @ 2016-08-04 16:37 czcb 阅读(327) 评论(0) 推荐(0) 编辑
摘要:zjtest7-redis:/root/soft/json-c-json-c-0.12-20140410# ./configure CC="gcc -m64" --prefix=/usr --libdir=/usr/lib64 && make && make install cd . && /b... 阅读全文
posted @ 2016-08-04 15:20 czcb 阅读(2726) 评论(0) 推荐(0) 编辑
摘要:下载下列软件 json-c-0.12-20140410.tar.gz---------------------https://github.com/json-c/json-c/archive/json-c-0.12-20140410.tar.gz libestr-0.1.10.tar.gz-... 阅读全文
posted @ 2016-08-04 14:17 czcb 阅读(874) 评论(0) 推荐(0) 编辑
摘要:Facility 定义日志消息的来源,以方便对日志进行分类,facility 有以下几种:--kern 内核消息--user 用户级消息--mail 邮件系统消息--daemon 系统服务消息--auth 认证系统消息--syslog 日志系统自身消息--lp... 阅读全文
posted @ 2016-08-04 10:30 czcb 阅读(231) 评论(0) 推荐(0) 编辑
摘要:Facility 定义日志消息的来源,以方便对日志进行分类,facility 有以下几种:--kern 内核消息--user 用户级消息--mail 邮件系统消息--daemon 系统服务消息--auth 认证系统消息--syslog 日志系统自身消息--lp... 阅读全文
posted @ 2016-08-04 10:30 czcb 阅读(110) 评论(0) 推荐(0) 编辑
摘要:jrhmpt01:/root# cat -n hcp.pl 1 use LWP::UserAgent; 2 use Encode; 3 $ua = LWP::UserAgent->new; 4 @header = ( 5 'acc... 阅读全文
posted @ 2016-08-03 21:32 czcb 阅读(127) 评论(0) 推荐(0) 编辑
摘要:jrhmpt01:/root# cat -n hcp.pl 1 use LWP::UserAgent; 2 use Encode; 3 $ua = LWP::UserAgent->new; 4 @header = ( 5 'acc... 阅读全文
posted @ 2016-08-03 21:32 czcb 阅读(166) 评论(0) 推荐(0) 编辑
摘要:jrhmpt01:/root# cat login_yylc.pl use LWP::UserAgent;use HTTP::Date qw(time2iso str2time time2iso time2isoz);use Net::Ping; use Socket;use Net::SM... 阅读全文
posted @ 2016-08-03 20:35 czcb 阅读(2456) 评论(0) 推荐(0) 编辑
摘要:jrhmpt01:/root# cat login_yylc.pl use LWP::UserAgent;use HTTP::Date qw(time2iso str2time time2iso time2isoz);use Net::Ping; use Socket;use Net::SM... 阅读全文
posted @ 2016-08-03 20:35 czcb 阅读(411) 评论(0) 推荐(0) 编辑
摘要:欢迎来到rsyslogRsyslog 是一个日志处理的快速系统,它提供高性能的,大的安全功能和模块化的设计。当它开始一个普通的syslogd,rsyslog 已经演变成了一个瑞士军刀的日志系统,可以用于:1.接收来自各种各样来源的输入2.改造它们3.并将结果输出到不同的目的地Rsyslog 有一... 阅读全文
posted @ 2016-08-03 15:44 czcb 阅读(186) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./logstash -f ../config/logstash_agent.conf zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./logst... 阅读全文
posted @ 2016-08-02 22:34 czcb 阅读(97) 评论(0) 推荐(0) 编辑
摘要:zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./logstash -f ../config/logstash_agent.conf zjtest7-frontend:/usr/local/logstash-2.3.4/bin# ./logst... 阅读全文
posted @ 2016-08-02 22:34 czcb 阅读(108) 评论(0) 推荐(0) 编辑
摘要:这个logstash 读取日志 是增量的 还是怎么读的?定时每秒读增量机器配置;elasticsearch-192.168.32.80elasticsearch-192.168.32.81elasticsearch-192.168.32.82redis-192.168.32.67logstash... 阅读全文
posted @ 2016-08-02 19:03 czcb 阅读(112) 评论(0) 推荐(0) 编辑
摘要:这个logstash 读取日志 是增量的 还是怎么读的?定时每秒读增量机器配置;elasticsearch-192.168.32.80elasticsearch-192.168.32.81elasticsearch-192.168.32.82redis-192.168.32.67logstash... 阅读全文
posted @ 2016-08-02 19:03 czcb 阅读(138) 评论(0) 推荐(0) 编辑
摘要:一个节点(node) 就是一个Elasticsearch 实例,而一个集群(cluaster) 由一个或多个节点组成,它们具有相同的cluster.name,它们协调工作,分享数据和负载。当加入新的节点或者删除一个节点时,集群就会感知并平衡数据。添加索引:为了将数据添加到Elasticsearc... 阅读全文
posted @ 2016-08-02 16:49 czcb 阅读(117) 评论(0) 推荐(0) 编辑
摘要:一个节点(node) 就是一个Elasticsearch 实例,而一个集群(cluaster) 由一个或多个节点组成,它们具有相同的cluster.name,它们协调工作,分享数据和负载。当加入新的节点或者删除一个节点时,集群就会感知并平衡数据。添加索引:为了将数据添加到Elasticsearc... 阅读全文
posted @ 2016-08-02 16:49 czcb 阅读(219) 评论(0) 推荐(0) 编辑
摘要:第一种.没一个节点的数据都相同.即master->多slave模式. 例如zookeeperZookeeper 是一种高性能、可扩展的服务。 Zookeeper 的读写速度非常快,并且读的速度要比写的速度更快。另外,在进行读操作的时候, ZooKeeper 依然能够为旧的数据提供服务。这些都是由... 阅读全文
posted @ 2016-08-02 16:00 czcb 阅读(263) 评论(0) 推荐(0) 编辑
摘要:让我们在集群中唯一一个空节点上创建一个叫做blogs的索引,默认情况下,一个索引被分配5个主分片, 但是为了演示的目的, 我们只分配3个主分片和一个复制分片(每个主分片都有一个复制分片): PUT /blogs { "settings" : { "number_of_shards" : 3,... 阅读全文
posted @ 2016-08-02 15:48 czcb 阅读(132) 评论(0) 推荐(0) 编辑
摘要:让我们在集群中唯一一个空节点上创建一个叫做blogs的索引,默认情况下,一个索引被分配5个主分片, 但是为了演示的目的, 我们只分配3个主分片和一个复制分片(每个主分片都有一个复制分片): PUT /blogs { "settings" : { "number_of_shards" : 3,... 阅读全文
posted @ 2016-08-02 15:48 czcb 阅读(297) 评论(0) 推荐(0) 编辑
摘要:zookeeper 和elasticseaarch 数据存储特点:1.zookeeper;【Zookeeper提供的一致性是弱一致性,首先数据的复制有如下规则:zookeeper确保对znode树的每一个修改都会被复制到集合体中超过半数的机器上。那么就有可能有节点的数据不是最新的而被客户端访问到... 阅读全文
posted @ 2016-08-02 14:21 czcb 阅读(147) 评论(0) 推荐(0) 编辑
摘要:zookeeper 和elasticseaarch 数据存储特点:1.zookeeper;【Zookeeper提供的一致性是弱一致性,首先数据的复制有如下规则:zookeeper确保对znode树的每一个修改都会被复制到集合体中超过半数的机器上。那么就有可能有节点的数据不是最新的而被客户端访问到... 阅读全文
posted @ 2016-08-02 14:21 czcb 阅读(162) 评论(0) 推荐(0) 编辑
摘要:elk 添加节点:cluster.name: es_clusternode.name: node03path.data: /elk/elasticsearch/datapath.logs: /elk/elasticsearch/logsnetwork.host: 192.168.32.82net... 阅读全文
posted @ 2016-08-02 13:23 czcb 阅读(236) 评论(0) 推荐(0) 编辑
摘要:elk 添加节点:cluster.name: es_clusternode.name: node03path.data: /elk/elasticsearch/datapath.logs: /elk/elasticsearch/logsnetwork.host: 192.168.32.82net... 阅读全文
posted @ 2016-08-02 13:23 czcb 阅读(358) 评论(0) 推荐(0) 编辑
摘要:集群和节点:节点(node) 是一个运行着的Elasticsearch 实例, 集群(cluster)是一组具有相同cluster.name 的节点集合可以组成一个集群。你最好找一个合适的名字带替换cluster.name的默认值,这样可以防止一个新启动的节点加入到相同的网络中cluster.n... 阅读全文
posted @ 2016-08-02 11:18 czcb 阅读(134) 评论(0) 推荐(0) 编辑
摘要:集群和节点:节点(node) 是一个运行着的Elasticsearch 实例, 集群(cluster)是一组具有相同cluster.name 的节点集合可以组成一个集群。你最好找一个合适的名字带替换cluster.name的默认值,这样可以防止一个新启动的节点加入到相同的网络中cluster.n... 阅读全文
posted @ 2016-08-02 11:18 czcb 阅读(134) 评论(0) 推荐(0) 编辑
摘要:http://192.168.32.81:9200/library/books/8/ GET{ "_index": "library", "_type": "books", "_id": "8", "_versio... 阅读全文
posted @ 2016-08-01 15:49 czcb 阅读(117) 评论(0) 推荐(0) 编辑
摘要:http://192.168.32.81:9200/library/books/8/ GET{ "_index": "library", "_type": "books", "_id": "8", "_versio... 阅读全文
posted @ 2016-08-01 15:49 czcb 阅读(130) 评论(0) 推荐(0) 编辑
摘要:Elasticsearch 是一个高度扩展的开源的全文搜索和分析引擎,它允许你存储,搜索和分析大量的数据和几乎实时。它通常用于底层的存储.技术,提供应用实现负载的搜索功能和需求。这里有一些使用的示例,Elasticsearch 可以使用:1.你可以运行一个在线的web 商店,你允许你的客户来搜... 阅读全文
posted @ 2016-08-01 14:17 czcb 阅读(122) 评论(0) 推荐(0) 编辑
摘要:Elasticsearch 是一个高度扩展的开源的全文搜索和分析引擎,它允许你存储,搜索和分析大量的数据和几乎实时。它通常用于底层的存储.技术,提供应用实现负载的搜索功能和需求。这里有一些使用的示例,Elasticsearch 可以使用:1.你可以运行一个在线的web 商店,你允许你的客户来搜... 阅读全文
posted @ 2016-08-01 14:17 czcb 阅读(129) 评论(0) 推荐(0) 编辑
摘要:http://192.168.32.81:9200/_cat/nodes 192.168.32.81 192.168.32.81 3 21 0.00 d * node02 192.168.32.80 192.168.32.80 4 41 0.00 d m node01 阅读全文
posted @ 2016-08-01 13:19 czcb 阅读(260) 评论(0) 推荐(0) 编辑
摘要:http://192.168.32.81:9200/_cat/nodes 192.168.32.81 192.168.32.81 3 21 0.00 d * node02 192.168.32.80 192.168.32.80 4 41 0.00 d m node01 阅读全文
posted @ 2016-08-01 13:19 czcb 阅读(171) 评论(0) 推荐(0) 编辑