zoukankan      html  css  js  c++  java
  • drill http 存储插件试用

    以下是对于http 存储插件的试用

    环境准备

    • docker 启动drill (1.18.0 )
    docker run -i --name drill-1.18.0 -p 8047:8047 -p 31010:31010 -p 31011:31011 -p 31012:31012 -t apache/drill:1.18.0 /bin/bash

    配置http 存储插件

    • 参考格式
    {
      "type": "http",
      "cacheResults": true,
      "connections": {},
      "timeout": 0,
      "proxyHost": null,
      "proxyPort": 0,
      "proxyType": null,
      "proxyUsername": null,
      "proxyPassword": null,
      "enabled": true
    }
    • 说明
      上边的connections 是核心,配置如下:
      URL : 指定需要访问的url信息, 可以指定的配置requireTail,params
      requireTai,进行url的拼接处理 ,默认false
      比如:
     
    url: "https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2019-10-02",
    requireTail: false

    sql 查询:

    SELECT * FROM api.sunrise;

    为true的模式

    url: "https://api.sunrise-sunset.org/json",
    requireTail: true

    sql 查询:

    SELECT * FROM api.sunrise.`?lat=36.7201600&lng=-4.4203400&date=2019-10-02`

    params 指定:
    参考:

     
    url: "https://api.sunrise-sunset.org/json",
    requireTail: false,
    params: ["lat", "lng", "date"]

    sql 查询:

    SELECT * FROM api.sunrise
    WHERE `lat` = 36.7201600 AND `lng` = -4.4203400 AND `date` = '2019-10-02'

    Method: 指定http请求的verb
    包含了method:post,get postBody: 指定请求提内容
    Headers: 指定http 请求头信息
    Authorization: 指定http 请求的授权模式,目前暂时只支持basic 认证默认,后期会有其他模式的支持
    其他相关配置:http proxy 配置,具体可以参考以下的连接

    简单使用

    • 配置存储插件

    • 数据查询


    效果

    说明

    drill 的http 存储扩展还是很不错的功能,基于次我们也可以用来分析prometheus 的metrics (基于http api),以及其他基于http的请求

    参考资料

    https://github.com/apache/drill/tree/master/contrib/storage-http

  • 相关阅读:
    DbUtils类基本使用
    【struts2】ActionContext与ServletActionContext
    Eclipse 菜单---Eclipse教程第04课
    Eclipse 窗口说明---Eclipse教程第03课
    Eclipse 修改字符集---Eclipse教程第02课
    Java 开发环境配置
    Eclipse 安装(Neon 版本2016年)---Eclipse教程第01课
    eclipse中link方式安装插件
    linux 源码安装mysql 5.5
    shell执行mysql命令
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/13775559.html
Copyright © 2011-2022 走看看