Apache Pulsar를 사용하여 Clickhouse로 빠른 스트리밍

출처: Clickhouse

FLiPC-빠른 스트리밍IntoClickhouseWithApachePulsar



Apache Pulsar를 사용하여 Clickhouse로 빠른 스트리밍 - Meetup 2022

StreamNative - Apache Pulsar - Altinity Cloud로 스트리밍 - Clickhouse

만나다



https://www.meetup.com/San-Francisco-Bay-Area-ClickHouse-Meetup/events/285271332/

Meetup

고도 클라우드 설정



Clickhouse
  • 로그인
  • 클러스터 시작
  • 탐험하다
  • 빌드 테이블

  • 
    drop table iotjetsonjson ON CLUSTER '{cluster}';
    drop table iotjetsonjson_local ON CLUSTER '{cluster}';
    
    CREATE TABLE iotjetsonjson_local
    (
        uuid String, 
        camera String,
        ipaddress String,  
        networktime String, 
            top1pct String, 
        top1 String, 
        cputemp String, 
        gputemp String,
            gputempf String,
        cputempf String, 
        runtime String,
        host String,
        filename String,  
        host_name String, 
            macaddress String, 
        te String, 
        systemtime String,
        cpu String,
            diskusage String,
        memory String, 
        imageinput String
    )
    ENGINE = MergeTree()
      PARTITION BY uuid
      ORDER BY (uuid);
    
    
    CREATE TABLE iotjetsonjson ON CLUSTER '{cluster}' AS iotjetsonjson_local
    ENGINE = Distributed('{cluster}', default, iotjetsonjson_local, rand());
    
    


    쿼리




    select uuid, top1pct, top1, gputempf, cputempf
    from iotjetsonjson
    where toFloat32OrZero(top1pct) > 40
    order by toFloat32OrZero(top1pct) desc, systemtime desc
    
    
    select uuid, systemtime, networktime, te, top1pct, top1, cputempf, gputempf, cpu, diskusage, memory,filename
    from iotjetsonjson 
    order by systemtime desc
    
    


    Altinity Cloud / Clickhouse / JDBC 싱크 구성




    
    tenant: "public"
    namespace: "default"
    name: "jdbc-clickhouse-sink-iot"
    topicName: "persistent://public/default/iotjetsonjson"
    sinkType: "jdbc-clickhouse"
    configs:
        userName: "youradminname"
        password: "somepasswordthatiscool"
        jdbcUrl: "jdbc:clickhouse://mydomainiscool.cloud:8443/default?ssl=true"
        tableName: "iotjetsonjson_local"
    
    


    Pulsar 환경 구축(또는 StreamNative Cloud에서 주제 만들기 클릭)




    
    bin/pulsar-admin sinks stop --tenant public --namespace default --name jdbc-clickhouse-sink-iot
    bin/pulsar-admin sinks delete --tenant public --namespace default --name jdbc-clickhouse-sink-iot
    bin/pulsar-admin sinks restart --tenant public --namespace default --name jdbc-clickhouse-sink-iot
    
    bin/pulsar-admin sinks create --archive ./connectors/pulsar-io-jdbc-clickhouse-2.10.0.nar --inputs iotjetsonjson --name jdbc-clickhouse-sink-iot --sink-config-file conf/clickhouseiot.yml --parallelism 1
    bin/pulsar-admin sinks list --tenant public --namespace default
    bin/pulsar-admin sinks get --tenant public --namespace default --name jdbc-clickhouse-sink-iot
    bin/pulsar-admin sinks status --tenant public --namespace default --name jdbc-clickhouse-sink-iot
    
    bin/pulsar-client consume "persistent://public/default/iotjetsonjson" -s iotjetsonjson-reader
    
    


    참조


  • https://github.com/tspannhw/FLiP-SQL/
  • https://docs.altinity.com/altinitycloud/quickstartguide/yourfirstqueries/
  • https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions/
  • https://clickhouse.com/docs/en/sql-reference/functions/type-conversion-functions/
  • https://github.com/tspannhw/FLiP-CloudIngest
  • https://github.com/tspannhw/StreamingAnalyticsUsingFlinkSQL
  • https://github.com/tspannhw/FLiP-Stream2Clickhouse
  • 좋은 웹페이지 즐겨찾기