This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kinit my_principal@my.domain -k -t mykeytab.file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val schema = JsonUtil.inferSchemaWithMaps(JsonUtil.parse(jsonString),"payload") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install cm_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
“kb_realm”: “MY_REALM”, | |
“kdc_master”: “kdc”, | |
“kdc_admin_user” : “admin”, | |
“kdc_pass” : “passwod”, | |
“dr_kdc_master” : “my_backup_kdc” | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export HADOOP_CLASSPATH=sqoop-site.xml |