该图转自知乎 海棠依旧
1.安装nginx,注意不要安装nginx-full
1 | sudo apt-get install nginx |
确认版本
1 | apt list --installed | grep nginx |
2.修改配置 /etc/nginx/nginx.conf
1 | http { |
3.输出的日志
1 | {"ts":"2019-10-13 22:59:48","schema":"com.xxx.xxx","host":"127.0.0.1","clientip":"127.0.0.1","size":0,"responsetime":0.000,"upstreamtime":"-","upstreamhost":"-","http_host":"localhost","url":"/index.html","domain":"localhost","xff":"-","referer":"-","status":"304"} |
1.修改配置,在http{}中添加
1 | log_format access_json '{"@timestamp":"$time_iso8601",' |
1.编辑配置文件
1 | sudo vim /etc/nginx/nginx.conf |
在http {}中添加如下
1 | server { |
1.安装
1 | sudo apt-get install nginx |
2.启动
1 | systemctl start nginx.service |
如果和apache2的80端口冲突了,修改一下apache2的port
1 | sudo vim /etc/apache2/ports.conf |
冲突的话,日志/var/log/nginx/error.log中将会报
1 | 2019/10/12 14:25:31 [emerg] 23836#23836: listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) |
修改成8080
Hive是如何解析SQL的呢,首先拿hive的建表语句来举例,比如下面的建表语句
1 | create table test(id int,name string)row format delimited fields terminated by '\t'; |
然后使用hive的show create table语句来查看创建的表结构,这是一张text表
1 | CREATE TABLE `test`( |
当然还有其他各种建表语句,比如
csv表
1 | CREATE EXTERNAL TABLE `default.test_1`( |
安装
1 | sudo apt-get install supervisor |
启动,否则会报 unix:///tmp/supervisor.sock no such file
1 | service supervisor start |
或者
1 | supervisord -c /etc/supervisor/supervisord.conf |
Hive结构体系
1 | https://blog.csdn.net/zhoudaxia/article/details/8855937 |
依赖
1 | <dependency> |
有2种方法可以取得hive的元数据
**1.使用hive的jdbc接口**的getMetaData方法来获取hive表的相关元信息
1 | import java.sql.*; |
参考
1 | https://blog.csdn.net/u010368839/article/details/76358831 |
hive metadata源码解析可以参考
1 | https://cloud.tencent.com/developer/article/1330250 |
hive thrift接口可以参考
Filebeat官方文档地址
1 | https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-installation.html |
下载和安装
1 | curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.3.1-linux-x86_64.tar.gz |
编写filebeat.yml