This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
forked from hortonworks/cloudbreak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLOUD-10637 Install PostgreSQL and use with Hive Metastore by default…
… with Ambari 2.6.1
- Loading branch information
1 parent
cb10f86
commit 91b4450
Showing
23 changed files
with
558 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
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
74 changes: 74 additions & 0 deletions
74
...ain/java/com/sequenceiq/cloudbreak/service/cluster/flow/blueprint/HiveConfigProvider.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.sequenceiq.cloudbreak.service.cluster.flow.blueprint; | ||
|
||
import static java.util.Collections.singletonMap; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.sequenceiq.cloudbreak.domain.Blueprint; | ||
import com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties; | ||
|
||
@Component | ||
public class HiveConfigProvider { | ||
@Value("${cb.hive.database.user:hive}") | ||
private String hiveDbUser; | ||
|
||
@Value("${cb.hive.database.password:hive}") | ||
private String hiveDbPassword; | ||
|
||
@Value("${cb.hive.database.db:hive}") | ||
private String hiveDb; | ||
|
||
@Value("${cb.hive.database.port:5432}") | ||
private String hiveDbPort; | ||
|
||
@Value("${cb.hive.database.host:localhost}") | ||
private String hiveDbHost; | ||
|
||
@Inject | ||
private BlueprintProcessor blueprintProcessor; | ||
|
||
@Inject | ||
private HiveConfigProvider hiveConfigProvider; | ||
|
||
public String getHiveDbUser() { | ||
return hiveDbUser; | ||
} | ||
|
||
public String getHiveDbPassword() { | ||
return hiveDbPassword; | ||
} | ||
|
||
public String getHiveDb() { | ||
return hiveDb; | ||
} | ||
|
||
public String getHiveDbPort() { | ||
return hiveDbPort; | ||
} | ||
|
||
public String getHiveDbHost() { | ||
return hiveDbHost; | ||
} | ||
|
||
public boolean isRdsConfigNeedForHiveMetastore(Blueprint blueprint) { | ||
return blueprintProcessor.componentExistsInBlueprint("HIVE_METASTORE", blueprint.getBlueprintText()) | ||
&& !blueprintProcessor.componentExistsInBlueprint("MYSQL_SERVER", blueprint.getBlueprintText()) | ||
&& !blueprintProcessor.hivaDatabaseConfigurationExistsInBlueprint(blueprint.getBlueprintText()); | ||
} | ||
|
||
public void decorateServicePillarWithPostgresIfNeeded(Map<String, SaltPillarProperties> servicePillar, Blueprint blueprint) { | ||
if (hiveConfigProvider.isRdsConfigNeedForHiveMetastore(blueprint)) { | ||
Map<String, Object> postgres = new HashMap<>(); | ||
postgres.put("database", hiveConfigProvider.getHiveDb()); | ||
postgres.put("user", hiveConfigProvider.getHiveDbUser()); | ||
postgres.put("password", hiveConfigProvider.getHiveDbPassword()); | ||
servicePillar.put("postgresql-server", new SaltPillarProperties("/postgresql/postgre.sls", singletonMap("postgres", postgres))); | ||
} | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,9 +93,6 @@ | |
{ | ||
"name": "METRICS_MONITOR" | ||
}, | ||
{ | ||
"name": "MYSQL_SERVER" | ||
}, | ||
{ | ||
"name": "NAMENODE" | ||
}, | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,9 +96,6 @@ | |
{ | ||
"name": "METRICS_MONITOR" | ||
}, | ||
{ | ||
"name": "MYSQL_SERVER" | ||
}, | ||
{ | ||
"name": "NAMENODE" | ||
}, | ||
|
Oops, something went wrong.