Skip to content

Commit

Permalink
Add directory /tmp/out with giving ownership to sdctest user (#38)
Browse files Browse the repository at this point in the history
* Add directory /tmp/out with giving ownership to sdctest user

* Pass args.kerberos_principals instead of args to the method
  • Loading branch information
kirtiv1 authored Jun 22, 2018
1 parent a657000 commit b9dfbd6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ def cm_server_not_dead(primary_node):
_configure_for_streamsets_after_start(deployment=deployment,
cluster_name=DEFAULT_CLUSTER_NAME,
cluster=cluster, quiet=not args.verbose,
kerberos_enabled=args.kerberos)
kerberos_enabled=args.kerberos,
kerberos_principals=args.kerberos_principals)


def _configure_kdc(cluster, kerberos_principals, kerberos_ticket_lifetime, quiet):
Expand Down Expand Up @@ -1219,7 +1220,8 @@ def _configure_yarn(deployment, cluster, cluster_name):
configs)


def _configure_for_streamsets_after_start(deployment, cluster_name, cluster, quiet, kerberos_enabled):
def _configure_for_streamsets_after_start(deployment, cluster_name, cluster, quiet,
kerberos_enabled, kerberos_principals):
# Following is needed for Kerberos and Kafka to work correctly.
logger.info('Copying streamsets keytab to a fixed location which is shared on all clustered nodes ...')
commands = [('cp "$(find /var/run/cloudera-scm-agent/process/*streamsets-DATACOLLECTOR -maxdepth 0 -mindepth 0 | '
Expand All @@ -1232,6 +1234,14 @@ def _configure_for_streamsets_after_start(deployment, cluster_name, cluster, qui
for service
in deployment.get_cluster_services(cluster_name=DEFAULT_CLUSTER_NAME)}

if 'HDFS' in cluster_service_types and kerberos_principals:
if 'sdctest' in kerberos_principals.split(','):
# Following is needed as tests use HDFS directory /tmp/out.
commands = ['hadoop fs -mkdir /tmp/out',
'hadoop fs -chown sdctest /tmp/out',
'hadoop fs -chmod 1777 /tmp/out']
_execute_commands_against_kerberized_hdfs(cluster, commands, quiet)

if 'SOLR' in cluster_service_types:
SOLR_CONFIG_FILE_PATH = '/root/sample_collection_solr_configs/conf/solrconfig.xml'

Expand Down

0 comments on commit b9dfbd6

Please sign in to comment.