Skip to content

Instantly share code, notes, and snippets.

View andrewstevenson's full-sized avatar

Andrew Stevenson andrewstevenson

View GitHub Profile
override def connect(url: String, info: Properties): Connection = {
val connectionProps = Krb5SqlServer.connectionProperties(url)
val keytabFile = connectionProps(Krb5SqlServer.keytabFile)
val principal = connectionProps(Krb5SqlServer.principalKey)
val config = new Configuration()
config.addResource("/etc/hadoop/conf/hdfs-site.xml")
config.addResource("/etc/hadoop/conf/core-site.xml")
config.addResource("/etc/hadoop/conf/mapred-site.xml")
val jdbcDF = sqlContext.read.format("jdbc").options(
Map("jdbc:sqlserver://host:port;instanceName=MyInstance;databaseName=myDB;" +
"integratedSecurity=true;authenticationSchema=JavaKeberos;principal=my_principal;keytab=my_keytab;")
).load()
kinit my_principal@my.domain -k -t mykeytab.file
val schema = JsonUtil.inferSchemaWithMaps(JsonUtil.parse(jsonString),"payload")
pip install cm_api
from cm_api.api_client import ApiResource, ApiException
cm_host = "my_cm_host"
cluster_name = "Cloudera QuickStart"
service_name = "flume"
role_group_name = "Logging"
role_type = "AGENT"
config_file = "/Users/andrew/agent.conf"
host_name = "quickstart.cloudera"
agent_name = "appLogger"
{
“kb_realm”: “MY_REALM”,
“kdc_master”: “kdc”,
“kdc_admin_user” : “admin”,
“kdc_pass” : “passwod”,
“dr_kdc_master” : “my_backup_kdc”
}
import json
from optparse import OptionParser
import ConfigParse
from cm_api.api_client import ApiResource
config = ConfigParser.ConfigParser()
def load_host_config_files(host_conf_dir):
with open("%s/host_configuration.json" % host_conf_dir) as cluster_config_file:
cluster_configs = json.load(cluster_config_file)
return cluster_configs
<!--suppress ALL -->
<configuration>
<property>
<name>sqoop.metastore.client.enable.autoconnect</name>
<value>true</value>
<description>If true, Sqoop will connect to a local metastore
for job management when no other metastore arguments are
provided.
</description>
</property>
export HADOOP_CLASSPATH=sqoop-site.xml