@(服务监控)[logstash|Elasticsearch|kibana]
Logstash:用于收集、处理、传输日志数据。
Redis:用于实时标识和传输日志数据。
Elasticsearch:用于实时查询和解析数据。
Kibana:用于数据可视化。
| StatsService API获得数据统计功能,配置里面必须满足以下条件 | |
| 1. `"stats":{}`对象的存在 | |
| 2. `"api"`配置对象里面有`StatsService` | |
| 3. `"policy"`中的统计开关为true,除了各个用户的统计,还有全局统计 | |
| 4. clients里面要有email | |
| 5. 有个专用的`dokodemo-door`协议的入口,tag为api | |
| 6. routing里面有inboundTag:api -> outboundTag:api的规则 | |
| 另外: |
| <?php | |
| use Protocol\FCGI; | |
| use Protocol\FCGI\FrameParser; | |
| use Protocol\FCGI\Record\BeginRequest; | |
| use Protocol\FCGI\Record\EndRequest; | |
| use Protocol\FCGI\Record\Params; | |
| use Protocol\FCGI\Record\Stdin; | |
| use Protocol\FCGI\Record\Stdout; |
| /* | |
| * Convert from OpenCV image and write movie with FFmpeg | |
| * | |
| * Copyright (c) 2016 yohhoy | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| // FFmpeg | |
| extern "C" { | |
| #include <libavformat/avformat.h> |
| /** | |
| * OpenCV video streaming over TCP/IP | |
| * Client: Receives video from server and display it | |
| * by Steve Tuenkam | |
| */ | |
| #include "opencv2/opencv.hpp" | |
| #include <sys/socket.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> |
| import org.apache.hadoop.hbase.util.Bytes | |
| import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration} | |
| import org.apache.hadoop.hbase.client._ | |
| import org.apache.spark.SparkContext | |
| import scala.collection.JavaConversions._ | |
| /** | |
| * HBase 1.0.0 新版API, CRUD 的基本操作代码示例 | |
| **/ | |
| object HBaseNewAPI { |
| /* | |
| This example uses Scala. Please see the MLlib documentation for a Java example. | |
| Try running this code in the Spark shell. It may produce different topics each time (since LDA includes some randomization), but it should give topics similar to those listed above. | |
| This example is paired with a blog post on LDA in Spark: http://databricks.com/blog | |
| Spark: http://spark.apache.org/ | |
| */ | |
| import scala.collection.mutable |
| // javac test3.java | |
| // java test3 | |
| import java.security.Key; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.SecretKeyFactory; | |
| import javax.crypto.spec.DESedeKeySpec; | |
| import javax.crypto.spec.IvParameterSpec; |
| #!/bin/sh -ex | |
| V=2.0.3 | |
| curl -OL http://www.libsdl.org/release/SDL2-${V}.tar.gz | |
| tar -zxvf SDL2-${V}.tar.gz | |
| cd SDL2-${V} | |
| sudo apt-get install build-essential mercurial make cmake autoconf automake \ | |
| libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \ | |
| libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \ | |
| libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \ |