Giter Site home page Giter Site logo

pdmthorsrud / terraform-nomad-presto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhenik/terraform-nomad-presto

0.0 0.0 0.0 217 KB

Terraform module to set up presto on nomad

License: Apache License 2.0

Python 1.99% Makefile 14.25% HCL 83.67% Shell 0.09%

terraform-nomad-presto's Introduction

Terraform-nomad-presto


Module contains a nomad job ./conf/nomad/presto.hcl with presto sql server.

Additional information:

Contents

  1. Prerequisites
  2. Compatibility
  3. Usage
    1. Requirements
      1. Required software
    2. Providers
  4. Inputs
  5. Outputs
  6. Examples
  7. Authors
  8. License
  9. References

Prerequisites

Please follow this section in original template

Compatibility

Software OSS Version Enterprise Version
Terraform 0.13.1 or newer
Consul 1.8.3 or newer 1.8.3 or newer
Vault 1.5.2.1 or newer 1.5.2.1 or newer
Nomad 0.12.3 or newer 0.12.3 or newer

Usage

make up

Check the example of terraform-nomad-presto documentation here.

Example contains csv, json, avro, protobuf file types.

Requirements

Required software

See template README's prerequisites.

All software is provided and run with docker. See the Makefile for inspiration.

Providers

This module uses the Nomad provider.

Inputs

Name Description Type Default Required
nomad_provider_address Nomad provider address string "http://127.0.0.1:4646" yes
nomad_data_center Nomad data centers list(string) ["dc1"] yes
nomad_namespace [Enterprise] Nomad namespace string "default" yes
nomad_job_name Nomad job name string "presto" yes
shared_secret_provider Provider for the shared secret: user or vault string "user" no
shared_secret_user Shared secret provided by user(length must be >= 12) string "asdasdsadafdsa" no
shared_secret_vault Set of properties to be able fetch shared cluster secret from vault object default = { vault_kv_policy_name = "kv-secret", vault_kv_path = "secret/data/presto", vault_kv_secret_key_name = "cluster_shared_secret"}` no
service_name Presto service name string "presto" yes
port Presto http port number 8080 yes
docker_image Presto docker image string "prestosql/presto:333" yes
container_environment_variables Presto environment variables list(string) [""] no
use_canary Uses canary deployment for Presto bool false no
consul_connect_plugin Deploy consul connect plugin for presto bool true no
consul_connect_plugin_artifact_source Artifact URI source string "https://oss.sonatype.org/service/local/repositories/releases/content/io/github/gugalnikov/presto-consul-connect" no
hivemetastore.service_name Hive metastore service name string "hive-metastore" yes
hivemetastore.port Hive metastore port number 9083 yes
minio.service_name minio service name string yes
minio.port minio port number yes
minio.access_key minio access key string yes
minio.secret_key minio secret key string yes

Outputs

Name Description Type
presto_service_name Presto service name string
presto_port Presto port number

Examples

module "presto" {
  depends_on = [
    module.minio,
    module.hive
  ]

  source = "github.com/fredrikhgrelland/terraform-nomad-presto.git?ref=0.0.1"

  nomad_job_name    = "presto"
  nomad_datacenters = ["dc1"]
  nomad_namespace   = "default"

  service_name = "presto"
  port         = 8080
  docker_image = "prestosql/presto:341"

  #hivemetastore
  hivemetastore = {
    service_name = module.hive.service_name
    port         = 9083
  }

  # minio
  minio = {
    service_name = module.minio.minio_service_name
    port         = 9000
    access_key   = module.minio.minio_access_key
    secret_key   = module.minio.minio_secret_key
  }
}

For detailed information check example/ directory.

Verifying setup

You can verify successful run with next steps:

Option 1 [hive-metastore and nomad]

# from metastore (loopback)
beeline -u jdbc:hive2://
  • Query existing tables (beeline-cli)
SHOW DATABASES;
SHOW TABLES IN <database-name>;
DROP DATABASE <database-name>;
SELECT * FROM <table_name>;

# examples
SHOW TABLES;
SELECT * FROM iris;
SELECT * FROM tweets;

Option 2 [presto and nomad]

presto
  • Query existing tables (presto-cli)
SHOW CATALOGS [ LIKE pattern ]
SHOW SCHEMAS [ FROM catalog ] [ LIKE pattern ]
SHOW TABLES [ FROM schema ] [ LIKE pattern ]

# examples
SHOW CATALOGS;
SHOW SCHEMAS IN hive;
SHOW TABLES IN hive.default;
SELECT * FROM hive.default.iris;

Option 3 [local presto-cli]

NB! Check required software section first.

  • in a terminal run a proxy and presto-cli session
make presto-cli
  • Query tables (3 tables should be available)
show tables;
select * from <table>;

To debug or continue developing you can use presto cli locally. Some useful commands.

# manual table creation for different file types
presto --server localhost:8080 --catalog hive --schema default --user presto --file ./example/resources/query/csv_create_table.sql
presto --server localhost:8080 --catalog hive --schema default --user presto --file ./example/resources/query/json_create_table.sql
presto --server localhost:8080 --catalog hive --schema default --user presto --file ./example/resources/query/avro_tweets_create_table.sql

Authors

License

This work is licensed under Apache 2 License. See LICENSE for full details.


References

terraform-nomad-presto's People

Contributors

zhenik avatar claesgill avatar fredrikhgrelland avatar neha-sinha2305 avatar dangernil avatar pdmthorsrud avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.