Repository: incubator-ranger Updated Branches: refs/heads/master 413fcb68f -> ef7b11da4
RANGER-194: fixed some of the ranger related changes on winpkg Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/ef7b11da Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/ef7b11da Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/ef7b11da Branch: refs/heads/master Commit: ef7b11da4ba565f9171f97eeaca8fb91b0b9c019 Parents: 413fcb6 Author: sneethiraj <[email protected]> Authored: Thu Dec 11 20:53:33 2014 -0500 Committer: sneethiraj <[email protected]> Committed: Thu Dec 11 20:53:33 2014 -0500 ---------------------------------------------------------------------- winpkg/src/scripts/InstallApi.psm1 | 10 +-- winpkg/src/scripts/install.ps1 | 139 +++++++++++++++++--------------- 2 files changed, 77 insertions(+), 72 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ef7b11da/winpkg/src/scripts/InstallApi.psm1 ---------------------------------------------------------------------- diff --git a/winpkg/src/scripts/InstallApi.psm1 b/winpkg/src/scripts/InstallApi.psm1 index f0cb833..d5bb1b0 100644 --- a/winpkg/src/scripts/InstallApi.psm1 +++ b/winpkg/src/scripts/InstallApi.psm1 @@ -130,7 +130,7 @@ function InstallRangerCore( ### Verify that roles are in the supported set ### TODO - CheckRole $roles @("ranger") + CheckRole $roles @("ranger-admin") @@ -138,7 +138,7 @@ function InstallRangerCore( foreach( $service in empty-null ($roles -Split('\s+'))) { CreateAndConfigureHadoopService $service $HDP_RESOURCES_DIR $rangerInstallToBin $serviceCredential - if ( $service -eq "ranger" ) + if ( $service -eq "ranger-admin" ) { $credStorePath = Join-Path $ENV:RANGER_HOME "jceks" $credStorePath = $credStorePath -replace "\\", "/" @@ -955,7 +955,7 @@ function Uninstall( ### Stop and delete services ### - foreach( $service in @("ranger", "ranger-usersync")) + foreach( $service in @("ranger-admin", "ranger-usersync")) { StopAndDeleteHadoopService $service } @@ -1045,7 +1045,7 @@ function StartService( if ( $component -eq "ranger" ) { Write-Log "StartService: ranger services" - CheckRole $roles @("ranger") + CheckRole $roles @("ranger-admin","ranger-usersync") foreach ( $role in $roles -Split("\s+") ) { @@ -1082,7 +1082,7 @@ function StopService( if ( $component -eq "ranger" ) { ### Verify that roles are in the supported set - CheckRole $roles @("ranger") + CheckRole $roles @("ranger-admin", "ranger-usersync") foreach ( $role in $roles -Split("\s+") ) { try http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ef7b11da/winpkg/src/scripts/install.ps1 ---------------------------------------------------------------------- diff --git a/winpkg/src/scripts/install.ps1 b/winpkg/src/scripts/install.ps1 index acd4e2e..b6a80db 100644 --- a/winpkg/src/scripts/install.ps1 +++ b/winpkg/src/scripts/install.ps1 @@ -81,8 +81,8 @@ function Main( $scriptDir ) ### ### Install and Configure ranger (Looks like this config will come from earlier HDP installation steps ) ### - if ( $ENV:RANGER -eq "yes" ) { - $roles = "ranger" # TODO!! + if ( $ENV:IS_RANGER -eq "yes" ) { + $roles = "ranger-admin" } Write-Log "Roles are $roles" @@ -94,7 +94,7 @@ function Main( $scriptDir ) ### Install and Configure ranger-hdfs plugin ### #################################################################### - $roles = ' ' + $roles = '' Install "ranger-hdfs" $nodeInstallRoot $serviceCredential $roles ### @@ -156,7 +156,7 @@ function Main( $scriptDir ) ### Install and Configure ranger-hive plugin ### #################################################################### - $roles = ' ' + $roles = '' Install "ranger-hive" $nodeInstallRoot $serviceCredential $roles #### @@ -238,7 +238,7 @@ function Main( $scriptDir ) if ("$ENV:HBASE" -eq "yes") { - $roles = ' ' + $roles = '' Install "ranger-hbase" $nodeInstallRoot $serviceCredential $roles #### @@ -319,7 +319,7 @@ function Main( $scriptDir ) if ("$ENV:KNOX" -eq "yes") { - $roles = ' ' + $roles = '' Install "ranger-knox" $nodeInstallRoot $serviceCredential $roles #### @@ -385,73 +385,78 @@ function Main( $scriptDir ) ##################################################################### # - if ("$ENV:STORM" -eq "yes") { - $roles = ' ' - Install "ranger-storm" $nodeInstallRoot $serviceCredential $roles - - #### - #### Apply configuration changes to xasecure-audit.xml - #### - #$xmlFile = Join-Path $ENV:STORM_CONF_DIR "xasecure-audit.xml" - $stormAuditChanges = @{ - "xasecure.audit.db.is.enabled" = "true" - "xasecure.audit.jpa.javax.persistence.jdbc.url" = "jdbc:mysql://${ENV:RANGER_AUDIT_DB_HOST}:${ENV:RANGER_AUDIT_DB_PORT}/${ENV:RANGER_AUDIT_DB_DBNAME}" - "xasecure.audit.jpa.javax.persistence.jdbc.user" = "${ENV:RANGER_AUDIT_DB_USERNAME}" - "xasecure.audit.jpa.javax.persistence.jdbc.password" = "crypted" - "xasecure.audit.repository.name" = "${ENV:RANGER_STORM_REPO}" - "xasecure.audit.credential.provider.file" = "jceks://file/${ENV:RANGER_STORM_CRED_KEYSTORE_FILE}" - "xasecure.audit.jpa.javax.persistence.jdbc.driver" = "com.mysql.jdbc.Driver" - "xasecure.audit.hdfs.is.enabled" = "false" - "xasecure.audit.hdfs.config.destination.directroy" = "${ENV:RANGER_HDFS_DESTINATION_DIRECTORY}" - "xasecure.audit.hdfs.config.destination.file" = "${ENV:RANGER_HDFS_DESTINTATION_FILE}" - "xasecure.audit.hdfs.config.destination.flush.interval.seconds"= "{ENV:RANGER_HDFS_DESTINTATION_FLUSH_INTERVAL_SECONDS}" - "xasecure.audit.hdfs.config.destination.rollover.interval.seconds"= "{ENV:RANGER_HDFS_DESTINTATION_ROLLOVER_INTERVAL_SECONDS}" - "xasecure.audit.hdfs.config.destination.open.retry.interval.seconds"= "{ENV:RANGER_HDFS_DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS}" - "xasecure.audit.hdfs.config.local.buffer.directroy" = "{ENV:RANGER.HDFS_LOCAL_BUFFER_DIRECTORY}" - "xasecure.audit.hdfs.config.local.buffer.file" = "{ENV:RANGER.HDFS_LOCAL_BUFFER_FILE}" - "xasecure.audit.hdfs.config.local.buffer.flush.interval.seconds"= "{ENV:RANGER_HDFS_LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS}" - "xasecure.audit.hdfs.config.local.buffer.rollover.interval.seconds"= "{ENV:RANGER_HDFS_LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS}" - "xasecure.audit.hdfs.config.local.archive.directroy" = "{ENV:RANGER_HDFS_LOCAL_ARCHIVE_DIRECTORY}" - "xasecure.audit.hdfs.config.local.archive.max.file.count" = "{ENV:RANGER_HDFS_LOCAL_ARCHIVE_MAX_FILE_COUNT}" - - - } - - #### - #### Apply configuration changes to xasecure-storm-security.xml - #### - # - #$xmlFile = Join-Path $ENV:STORM_CONF_DIR "xasecure-storm-security.xml" - # - $stormSecurityChanges = @{ - "storm.authorization.verifier.classname" = "org.apache.ranger.pdp.storm.RangerAuthorizer" - "xasecure.storm.policymgr.url" = "${ENV:RANGER_EXTERNAL_URL}/service/assets/policyList/${ENV:RANGER_STORM_REPO}" - "xasecure.storm.policymgr.url.saveAsFile" = "${ENV:RANGER_HOME}\tmp\storm_${ENV:RANGER_STORM_REPO}" - "xasecure.storm.policymgr.url.laststoredfile" = "${ENV:RANGER_HOME}\tmp\storm_${ENV:RANGER_STORM_REPO}_json" - "xasecure.storm.policymgr.url.reloadIntervalInMillis" = "30000" - "xasecure.storm.update.xapolicies.on.grant.revoke" = "true" - "xasecure.policymgr.url" = "${ENV:RANGER_EXTERNAL_URL}" - } - - $configs = @{} - $configs.Add("stormAuditChanges",$stormAuditChanges) - $configs.Add("stormSecurityChanges",$stormSecurityChanges) - Configure "ranger-storm" $nodeInstallRoot $serviceCredential $configs - Write-Log "Installation of ranger-storm completed successfully" - - Configure "ranger-storm" $nodeInstallRoot $serviceCredential $configs - Write-Log "Installation of ranger-storm completed successfully" - } else { - Write-Log "Not installing ranger-storm, since Storm is not installed" - } + # Storm not yet supported on Windows + # + #if ("$ENV:STORM" -eq "yes") { + # $roles = '' + # Install "ranger-storm" $nodeInstallRoot $serviceCredential $roles + + # #### + # #### Apply configuration changes to xasecure-audit.xml + # #### + # #$xmlFile = Join-Path $ENV:STORM_CONF_DIR "xasecure-audit.xml" + # $stormAuditChanges = @{ + # "xasecure.audit.db.is.enabled" = "true" + # "xasecure.audit.jpa.javax.persistence.jdbc.url" = "jdbc:mysql://${ENV:RANGER_AUDIT_DB_HOST}:${ENV:RANGER_AUDIT_DB_PORT}/${ENV:RANGER_AUDIT_DB_DBNAME}" + # "xasecure.audit.jpa.javax.persistence.jdbc.user" = "${ENV:RANGER_AUDIT_DB_USERNAME}" + # "xasecure.audit.jpa.javax.persistence.jdbc.password" = "crypted" + # "xasecure.audit.repository.name" = "${ENV:RANGER_STORM_REPO}" + # "xasecure.audit.credential.provider.file" = "jceks://file/${ENV:RANGER_STORM_CRED_KEYSTORE_FILE}" + # "xasecure.audit.jpa.javax.persistence.jdbc.driver" = "com.mysql.jdbc.Driver" + # "xasecure.audit.hdfs.is.enabled" = "false" + # "xasecure.audit.hdfs.config.destination.directroy" = "${ENV:RANGER_HDFS_DESTINATION_DIRECTORY}" + # "xasecure.audit.hdfs.config.destination.file" = "${ENV:RANGER_HDFS_DESTINTATION_FILE}" + # "xasecure.audit.hdfs.config.destination.flush.interval.seconds"= "{ENV:RANGER_HDFS_DESTINTATION_FLUSH_INTERVAL_SECONDS}" + # "xasecure.audit.hdfs.config.destination.rollover.interval.seconds"= "{ENV:RANGER_HDFS_DESTINTATION_ROLLOVER_INTERVAL_SECONDS}" + # "xasecure.audit.hdfs.config.destination.open.retry.interval.seconds"= "{ENV:RANGER_HDFS_DESTINTATION_OPEN_RETRY_INTERVAL_SECONDS}" + # "xasecure.audit.hdfs.config.local.buffer.directroy" = "{ENV:RANGER.HDFS_LOCAL_BUFFER_DIRECTORY}" + # "xasecure.audit.hdfs.config.local.buffer.file" = "{ENV:RANGER.HDFS_LOCAL_BUFFER_FILE}" + # "xasecure.audit.hdfs.config.local.buffer.flush.interval.seconds"= "{ENV:RANGER_HDFS_LOCAL_BUFFER_FLUSH_INTERVAL_SECONDS}" + # "xasecure.audit.hdfs.config.local.buffer.rollover.interval.seconds"= "{ENV:RANGER_HDFS_LOCAL_BUFFER_ROLLOVER_INTERVAL_SECONDS}" + # "xasecure.audit.hdfs.config.local.archive.directroy" = "{ENV:RANGER_HDFS_LOCAL_ARCHIVE_DIRECTORY}" + # "xasecure.audit.hdfs.config.local.archive.max.file.count" = "{ENV:RANGER_HDFS_LOCAL_ARCHIVE_MAX_FILE_COUNT}" + + + # } + + # #### + # #### Apply configuration changes to xasecure-storm-security.xml + # #### + # # + # #$xmlFile = Join-Path $ENV:STORM_CONF_DIR "xasecure-storm-security.xml" + # # + # $stormSecurityChanges = @{ + # "storm.authorization.verifier.classname" = "org.apache.ranger.pdp.storm.RangerAuthorizer" + # "xasecure.storm.policymgr.url" = "${ENV:RANGER_EXTERNAL_URL}/service/assets/policyList/${ENV:RANGER_STORM_REPO}" + # "xasecure.storm.policymgr.url.saveAsFile" = "${ENV:RANGER_HOME}\tmp\storm_${ENV:RANGER_STORM_REPO}" + # "xasecure.storm.policymgr.url.laststoredfile" = "${ENV:RANGER_HOME}\tmp\storm_${ENV:RANGER_STORM_REPO}_json" + # "xasecure.storm.policymgr.url.reloadIntervalInMillis" = "30000" + # "xasecure.storm.update.xapolicies.on.grant.revoke" = "true" + # "xasecure.policymgr.url" = "${ENV:RANGER_EXTERNAL_URL}" + # } + + # $configs = @{} + # $configs.Add("stormAuditChanges",$stormAuditChanges) + # $configs.Add("stormSecurityChanges",$stormSecurityChanges) + # Configure "ranger-storm" $nodeInstallRoot $serviceCredential $configs + # Write-Log "Installation of ranger-storm completed successfully" + + # Configure "ranger-storm" $nodeInstallRoot $serviceCredential $configs + # Write-Log "Installation of ranger-storm completed successfully" + #} else { + # Write-Log "Not installing ranger-storm, since Storm is not installed" + #} ##################################################################### #### Install and Configure ranger-usersync service ### ##################################################################### # - - $roles = "ranger-usersync" + if ( $ENV:IS_RANGER -eq "yes" ) { + $roles = "ranger-usersync" + } else { + $roles = "" + } Install "ranger-usersync" $nodeInstallRoot $serviceCredential $roles Configure "ranger-usersync" $nodeInstallRoot $serviceCredential Write-Log "Installation of ranger-usersync completed successfully"
