|
62 | 62 | '1.3.0': '5.11.0', |
63 | 63 | '1.4.0': '5.12.0'} |
64 | 64 |
|
65 | | -SDC_PARCEL_REPO_URL = 'https://archives.streamsets.com/datacollector/{}/parcel/' |
| 65 | +DEFAULT_SDC_S3_BUCKET = 'archives.streamsets.com' |
66 | 66 | SDC_PORT = 18630 |
67 | 67 |
|
68 | 68 | logger = logging.getLogger('clusterdock.{}'.format(__name__)) |
@@ -115,6 +115,7 @@ def main(args): |
115 | 115 | node.volumes.append(spark2_parcel_image) |
116 | 116 |
|
117 | 117 | if args.sdc_version: |
| 118 | + logger.info('args.sdc_version = %s', args.sdc_version) |
118 | 119 | sdc_parcel_image = ('{}/{}/clusterdock:topology_cdh-' |
119 | 120 | 'streamsets_datacollector-{}').format(args.registry, |
120 | 121 | args.namespace |
@@ -256,33 +257,23 @@ def cm_server_not_dead(primary_node): |
256 | 257 | _install_service_from_local_repo(deployment, cluster, product='SPARK2', prefix='SPARK2') |
257 | 258 |
|
258 | 259 | if args.sdc_version: |
| 260 | + # We install StreamSets DataCollector using local repo /opt/cloudera/parcel-repo. |
| 261 | + # Set file and folder permissions correctly. |
| 262 | + commands = ['chown cloudera-scm:cloudera-scm /opt/cloudera/csd', |
| 263 | + 'chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo', |
| 264 | + 'chown cloudera-scm:cloudera-scm /opt/cloudera/csd/STREAMSETS*.jar', |
| 265 | + 'chmod 644 /opt/cloudera/csd/STREAMSETS*.jar', |
| 266 | + 'chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo/STREAMSETS_*'] |
| 267 | + primary_node.execute(' && '.join(commands)) |
| 268 | + |
| 269 | + # The parcel is already present. Hence just distribute and activate it after refresing parcel repos. |
259 | 270 | product = 'STREAMSETS_DATACOLLECTOR' |
| 271 | + deployment.refresh_parcel_repos() |
| 272 | + deployment.cluster(DEFAULT_CLUSTER_NAME).parcels |
260 | 273 | # Remove RC from version. |
261 | 274 | version = args.sdc_version.rsplit('-RC')[0] |
262 | | - sdc_parcel = cm_cluster.parcel(product=product, version=version) |
263 | | - |
264 | | - # After we set CM's "Manage Parcels" config to False, the SDC parcel becomes |
265 | | - # undistributed. After this, we may need to add the SDC parcel repo URL in order |
266 | | - # to be able to re-activate it. |
267 | | - try: |
268 | | - sdc_parcel.wait_for_stage('AVAILABLE_REMOTELY') |
269 | | - except cm.ParcelNotFoundError: |
270 | | - for config in deployment.get_cm_config(): |
271 | | - if config['name'] == 'REMOTE_PARCEL_REPO_URLS': |
272 | | - break |
273 | | - else: |
274 | | - raise Exception('Failed to find remote parcel repo URLs configuration.') |
275 | | - parcel_repo_urls = config['value'] |
276 | | - |
277 | | - sdc_parcel_repo_url = SDC_PARCEL_REPO_URL.format(args.sdc_version) |
278 | | - logger.debug('Adding SDC parcel repo URL (%s) ...', sdc_parcel_repo_url) |
279 | | - remote_parcel_repo_urls = '{},{}'.format(parcel_repo_urls, sdc_parcel_repo_url) |
280 | | - deployment.update_cm_config({'REMOTE_PARCEL_REPO_URLS': remote_parcel_repo_urls}) |
281 | | - |
282 | | - logger.debug('Refreshing parcel repos ...') |
283 | | - deployment.refresh_parcel_repos() |
284 | | - |
285 | | - sdc_parcel.download().distribute().activate() |
| 275 | + sdc_parcel = cm_cluster.parcel(product=product, version=version, stage='DOWNLOADED') |
| 276 | + sdc_parcel.distribute().activate() |
286 | 277 |
|
287 | 278 | if args.include_services: |
288 | 279 | if args.exclude_services: |
@@ -347,7 +338,7 @@ def cm_server_not_dead(primary_node): |
347 | 338 |
|
348 | 339 | if args.sdc_version: |
349 | 340 | logger.info('Configuring StreamSets Data Collector ...') |
350 | | - _configure_sdc(deployment, cluster, sdc_version=args.sdc_version, is_kerberos_enabled=args.kerberos) |
| 341 | + _configure_sdc(deployment, cluster, is_kerberos_enabled=args.kerberos) |
351 | 342 |
|
352 | 343 | if args.kerberos: |
353 | 344 | logger.info('Configure Cloudera Manager for Kerberos ...') |
@@ -778,7 +769,7 @@ def _configure_kudu(deployment, cluster, kudu_version): |
778 | 769 | configs) |
779 | 770 |
|
780 | 771 |
|
781 | | -def _configure_sdc(deployment, cluster, sdc_version, is_kerberos_enabled): |
| 772 | +def _configure_sdc(deployment, cluster, is_kerberos_enabled): |
782 | 773 | logger.info('Adding StreamSets service to cluster (%s) ...', DEFAULT_CLUSTER_NAME) |
783 | 774 | datacollector_role = {'type': 'DATACOLLECTOR', |
784 | 775 | 'hostRef': {'hostId': cluster.primary_node.host_id}} |
|
0 commit comments