Search in sources :

Example 6 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class KnoxServiceConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    List<ApiClusterTemplateConfig> configList = new ArrayList<>();
    if (source.getProductDetailsView() != null && isKnoxDatabaseSupported(source.getProductDetailsView().getCm(), getCdhProduct(source), getCdhPatchVersion(source))) {
        RdsView knoxGatewayRdsView = getRdsView(source);
        configList.add(config(DATABASE_TYPE, knoxGatewayRdsView.getSubprotocol()));
        configList.add(config(DATABASE_NAME, knoxGatewayRdsView.getDatabaseName()));
        configList.add(config(DATABASE_HOST, knoxGatewayRdsView.getHost()));
        configList.add(config(DATABASE_PORT, knoxGatewayRdsView.getPort()));
        configList.add(config(DATABASE_USER, knoxGatewayRdsView.getConnectionUserName()));
        configList.add(config(DATABASE_PASSWORD, knoxGatewayRdsView.getConnectionPassword()));
    }
    configList.add(config(KNOX_AUTORESTART_ON_STOP, Boolean.TRUE.toString()));
    return configList;
}
Also used : RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 7 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    RdsView hiveRdsView = getRdsView(source);
    List<ApiClusterTemplateConfig> configs = Lists.newArrayList(config(HIVE_METASTORE_DATABASE_HOST, hiveRdsView.getHost()), config(HIVE_METASTORE_DATABASE_NAME, hiveRdsView.getDatabaseName()), config(HIVE_METASTORE_DATABASE_PASSWORD, hiveRdsView.getConnectionPassword()), config(HIVE_METASTORE_DATABASE_PORT, hiveRdsView.getPort()), config(HIVE_METASTORE_DATABASE_TYPE, hiveRdsView.getSubprotocol()), config(HIVE_METASTORE_DATABASE_USER, hiveRdsView.getConnectionUserName()));
    String cmVersion = getCmVersion(source);
    addDbSslConfigsIfNeeded(templateProcessor, hiveRdsView, configs, cmVersion);
    // The Initiator thread in the DataLake's HMS will take care of this.
    if (source.getStackType() == StackType.WORKLOAD && isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_1_1)) {
        configs.add(config(HIVE_COMPACTOR_INITIATOR_ON, Boolean.FALSE.toString()));
    }
    Optional<KerberosConfig> kerberosConfigOpt = source.getKerberosConfig();
    if (kerberosConfigOpt.isPresent()) {
        String safetyValveValue = getSafetyValveProperty("hive.hook.proto.file.per.event", Boolean.TRUE.toString());
        configs.add(config(HIVE_SERVICE_CONFIG_SAFETY_VALVE, safetyValveValue));
    }
    if (source.getStackType() == StackType.DATALAKE) {
        source.getLdapConfig().ifPresent(ldap -> {
            configs.add(config(HIVE_METASTORE_ENABLE_LDAP_AUTH, Boolean.TRUE.toString()));
            configs.add(config(HIVE_METASTORE_LDAP_URI, ldap.getConnectionURL()));
            configs.add(config(HIVE_METASTORE_LDAP_BASEDN, ldap.getUserSearchBase()));
        });
    }
    return configs;
}
Also used : RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) KerberosConfig(com.sequenceiq.cloudbreak.dto.KerberosConfig) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 8 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class ClusterHostServiceRunner method decoratePillarWithClouderaManagerDatabase.

private void decoratePillarWithClouderaManagerDatabase(Cluster cluster, Map<String, SaltPillarProperties> servicePillar) throws CloudbreakOrchestratorFailedException {
    RdsConfigWithoutCluster clouderaManagerRdsConfig = rdsConfigWithoutClusterService.findByClusterIdAndType(cluster.getId(), DatabaseType.CLOUDERA_MANAGER);
    if (clouderaManagerRdsConfig == null) {
        throw new CloudbreakOrchestratorFailedException("Cloudera Manager RDSConfig is missing for stack");
    }
    RdsView rdsView = new RdsView(clouderaManagerRdsConfig);
    servicePillar.put("cloudera-manager-database", new SaltPillarProperties("/cloudera-manager/database.sls", singletonMap("cloudera-manager", singletonMap("database", rdsView))));
}
Also used : CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) SaltPillarProperties(com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties) RdsConfigWithoutCluster(com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster)

Example 9 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class RangerRoleConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    String cmVersion = getCmVersion(source);
    List<ApiClusterTemplateConfig> configList = new ArrayList<>();
    if (isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_2_1)) {
        RdsView rangerRdsView = getRdsView(source);
        addDbConfigs(rangerRdsView, configList, cmVersion);
        configList.add(config(RANGER_DATABASE_PORT, rangerRdsView.getPort()));
    }
    return configList;
}
Also used : RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 10 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class HueConfigProvider method getServiceConfigVariables.

@Override
public List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) {
    List<ApiClusterTemplateVariable> result = new ArrayList<>();
    RdsView hueRdsView = getRdsView(source);
    result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost()));
    result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort()));
    result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName()));
    result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol()));
    result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName()));
    result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword()));
    configureKnoxProxyHostsConfigVariables(source, result);
    return result;
}
Also used : RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) ArrayList(java.util.ArrayList) ApiClusterTemplateVariable(com.cloudera.api.swagger.model.ApiClusterTemplateVariable)

Aggregations

RdsView (com.sequenceiq.cloudbreak.template.views.RdsView)12 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)6 ArrayList (java.util.ArrayList)5 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)2 HashMap (java.util.HashMap)2 ApiClusterTemplateVariable (com.cloudera.api.swagger.model.ApiClusterTemplateVariable)1 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)1 RdsConfigWithoutCluster (com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster)1 KerberosConfig (com.sequenceiq.cloudbreak.dto.KerberosConfig)1 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)1 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)1 Test (org.junit.jupiter.api.Test)1