Skip to content

Instantly share code, notes, and snippets.

@seanorama
Last active March 30, 2017 12:34
Show Gist options
  • Save seanorama/c6c4cb10d57b304230861df52b62e453 to your computer and use it in GitHub Desktop.
Save seanorama/c6c4cb10d57b304230861df52b62e453 to your computer and use it in GitHub Desktop.
hortonworks-data-cloud-artifacts
#!/usr/bin/env bash
## Description:
## Various commands for working with Hortonworks Data Cloud (HDCloud) and it's clusters.
## Author: Sean Roberts <[email protected]>
########################################################################
## Set host & credentials of your controller
host=
user=
pass=
cluster= ## if using any of the snippets which work with clusters
########################################################################
## Description: HDC CLI: install & configure on a mac
curl -ksSLO https://${host}/hdc-cli_Darwin_x86_64.tgz
mkdir -p ~/bin; tar -xzvf hdc-cli_Darwin_x86_64.tgz -C ~/bin
hdc configure --server ${host} --username ${user} --password ${pass}
########################################################################
## Description: trust certificate of llap cluster as described in:
## - http://hortonworks.github.io/hdp-aws/hive-jdbc/index.html#download-ssl-certificate
## Requires:
## hdc cli configured
## jq
export gateway_address=$(hdc describe-cluster instances --cluster-name ${cluster} | jq -r '.[] | select(.Type == "master - ambari server")| .PublicIP')
export gateway_jks_password=${pass}
openssl s_client -connect ${gateway_address}:8443 -showcerts </dev/null | openssl x509 -outform PEM > gateway.pem
keytool -import -alias gateway-identity -file gateway.pem -keystore gateway.jks -storepass ${gateway_jks_password}
#/usr/bin/env bash
## Description:
## Create Hive schema for airline flight data
## - For use with: https://github.com/hortonworks/data-tutorials/blob/master/tutorials/hdp/hdp-2.5/fast-analytics-in-the-cloud-with-hive-llap/tutorial.md
## Note:
## - Can be used as a "post-recipe" in HDCloud or CloudBreak
## Author: Sean Roberts <[email protected]>
curl -ssLO https://raw.githubusercontent.com/hortonworks/data-tutorials/b14974075064942c2f8beb823b4076135427221c/tutorials/hdp/hdp-2.5/fast-analytics-in-the-cloud-with-hive-llap/assets/hiveview-ddl.sql
alias beeline="beeline -n admin -u 'jdbc:hive2://localhost:2181/hwxdemo;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2'"
beeline -f ./hiveview-ddl.sql
beeline -e 'msck repair table flights;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment