Google Cloud Storage

Google Cloud Storage

GCP(Google Cloud Platform)에서 데이터를 가져오는 방법을 보여 주는 가이드예요.

출처: Google Cloud Storage

본문

pinot-gcs 플러그인을 사용해 Google Cloud Storage를 활성화하세요. 컨트롤러나 서버에 다음 구성을 추가해요:

-Dplugins.dir=/opt/pinot/plugins -Dplugins.include=pinot-gcs

참고 기본적으로 Pinot은 모든 플러그인을 로드하므로 플러그인을 그냥 놓기만 하면 돼요. 또한 -Dplugins.include를 지정하면 사용할 모든 플러그인을 넣어야 해요. 예: pinot-json, pinot-avro, pinot-kafka-3.0...

GCP 파일시스템은 다음 옵션을 제공해요:

  • projectId - 스토리지 버킷을 만든 Google Cloud Platform 프로젝트 이름.
  • gcpKey - GCP 키가 담긴 json 파일의 위치. 키 다운로드는 서비스 계정 키 생성 및 관리를 참고하세요.

이 속성들은 각각 pinot.[node].storage.factory.class.gs. 접두사가 붙어야 하는데, node는 controller 또는 server예요:

pinot.controller.storage.factory.class.gs.projectId=test-project

예제

잡 스펙

executionFrameworkSpec:
    name: 'standalone'
    segmentGenerationJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentGenerationJobRunner'
    segmentTarPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentTarPushJobRunner'
    segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner'
jobType: SegmentCreationAndTarPush
inputDirURI: 'gs://my-bucket/path/to/input/directory/'
outputDirURI: 'gs://my-bucket/path/to/output/directory/'
overwriteOutput: true
pinotFSSpecs:
    - scheme: gs
      className: org.apache.pinot.plugin.filesystem.GcsPinotFS
      configs:
        projectId: 'my-project'
        gcpKey: 'path-to-gcp json key file'
recordReaderSpec:
    dataFormat: 'csv'
    className: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReader'
    configClassName: 'org.apache.pinot.plugin.inputformat.csv.CSVRecordReaderConfig'
tableSpec:
    tableName: 'students'
pinotClusterSpecs:
    - controllerURI: 'http://localhost:9000'

컨트롤러 구성

controller.data.dir=gs://path/to/data/directory/
controller.local.temp.dir=/path/to/local/temp/directory
controller.enable.split.commit=true
pinot.controller.storage.factory.class.gs=org.apache.pinot.plugin.filesystem.GcsPinotFS
pinot.controller.storage.factory.gs.projectId=my-project
pinot.controller.storage.factory.gs.gcpKey=path/to/gcp/key.json
pinot.controller.segment.fetcher.protocols=file,http,gs
pinot.controller.segment.fetcher.gs.class=org.apache.pinot.common.utils.fetcher.PinotFSSegmentFetcher

서버 구성

pinot.server.instance.enable.split.commit=true
pinot.server.storage.factory.class.gs=org.apache.pinot.plugin.filesystem.GcsPinotFS
pinot.server.storage.factory.gs.projectId=my-project
pinot.server.storage.factory.gs.gcpKey=path/to/gcp/key.json
pinot.server.segment.fetcher.protocols=file,http,gs
pinot.server.segment.fetcher.gs.class=org.apache.pinot.common.utils.fetcher.PinotFSSegmentFetcher

Minion 구성

pinot.minion.storage.factory.class.gs=org.apache.pinot.plugin.filesystem.GcsPinotFS
pinot.minion.storage.factory.gs.projectId=my-project
pinot.minion.storage.factory.gs.gcpKey=path/to/gcp/key.json
pinot.minion.segment.fetcher.protocols=file,http,gs
pinot.minion.segment.fetcher.gs.class=org.apache.pinot.common.utils.fetcher.PinotFSSegmentFetcher

더 알아보기 (Learn more)