@@ -458,8 +458,12 @@ def recommendHBASEConfigurationsFromODP12(self, configurations, clusterData, ser
458
458
459
459
# https://github.com/apache/hbase/blob/13af64dc1cbd0e90c3a98071deeb815520b624ee/hbase-common/src/main/resources/hbase-default.xml#L1389
460
460
hbaseThriftServerHosts = self .getHostsWithComponent ("HBASE" , "HBASE_THRIFTSERVER" , services , hosts )
461
+ hueServerHosts = self .getHostsWithComponent ("HUE" , "HUE_SERVER" , services , hosts )
461
462
if hbaseThriftServerHosts is not None and len (hbaseThriftServerHosts ):
462
- putHbaseSiteProperty ('hbase.regionserver.thrift.framed' , 'true' )
463
+ putHbaseSiteProperty ('hbase.regionserver.thrift.framed' , 'false' )
464
+ putHbaseSiteProperty ('hbase.regionserver.thrift.http' , 'true' )
465
+ if hueServerHosts is not None and len (hueServerHosts ) > 0 :
466
+ putHbaseSiteProperty ('hbase.thrift.support.proxyuser' , 'true' )
463
467
464
468
def setHandlerCounts (self , configurations , clusterData , services , hosts , cores ):
465
469
putHbaseSiteProperty = self .putProperty (configurations , "hbase-site" , services )
@@ -534,16 +538,18 @@ def recommendHBASEConfigurationsForKerberos(self, configurations, clusterData, s
534
538
else :
535
539
self .logger .debug ("No phoenix query server hosts to update" )
536
540
537
- hbase_thriftserver_server_hosts = self .getHBaseThriftServerHosts (services , hosts )
538
- hbaseEnvProperties = self .getSiteProperties (services ['configurations' ], 'hbase-env' )
539
- if hbaseEnvProperties and self .checkSiteProperties (hbaseEnvProperties , 'hbase_user' ):
540
- hbaseUser = hbaseEnvProperties ['hbase_user' ]
541
- hbaseUserOld = self .getOldValue (services , 'hbase-env' , 'hbase_user' )
542
- self .put_proxyuser_value (hbaseUser , '*' , is_groups = True , services = services , configurations = configurations , put_function = putCoreSiteProperty )
543
- if hbaseUserOld is not None and hbaseUser != hbaseUserOld :
544
- putCoreSitePropertyAttribute ("hadoop.proxyuser.{0}.groups" .format (hbaseUserOld ), 'delete' , 'true' )
545
- services ["forced-configurations" ].append ({"type" : "core-site" , "name" : "hadoop.proxyuser.{0}.groups" .format (hbaseUserOld )})
546
- services ["forced-configurations" ].append ({"type" : "core-site" , "name" : "hadoop.proxyuser.{0}.groups" .format (hbaseUser )})
541
+ if 'hbase.thrift.support.proxyuser' in configurations ['hbase-site' ]['properties' ]:
542
+ if configurations ['hbase-site' ]['properties' ]['hbase.thrift.support.proxyuser' ].lower () == 'true' :
543
+ hbase_thriftserver_server_hosts = self .getHBaseThriftServerHosts (services , hosts )
544
+ hbaseEnvProperties = self .getSiteProperties (services ['configurations' ], 'hbase-env' )
545
+ if hbaseEnvProperties and self .checkSiteProperties (hbaseEnvProperties , 'hbase_user' ):
546
+ hbaseUser = hbaseEnvProperties ['hbase_user' ]
547
+ hbaseUserOld = self .getOldValue (services , 'hbase-env' , 'hbase_user' )
548
+ self .put_proxyuser_value (hbaseUser , '*' , is_groups = True , services = services , configurations = configurations , put_function = putCoreSiteProperty )
549
+ if hbaseUserOld is not None and hbaseUser != hbaseUserOld :
550
+ putCoreSitePropertyAttribute ("hadoop.proxyuser.{0}.groups" .format (hbaseUserOld ), 'delete' , 'true' )
551
+ services ["forced-configurations" ].append ({"type" : "core-site" , "name" : "hadoop.proxyuser.{0}.groups" .format (hbaseUserOld )})
552
+ services ["forced-configurations" ].append ({"type" : "core-site" , "name" : "hadoop.proxyuser.{0}.groups" .format (hbaseUser )})
547
553
548
554
else :
549
555
putHbaseSiteProperty ('hbase.master.ui.readonly' , 'false' )
@@ -883,7 +889,9 @@ def validateHBASEConfigurationsFromHDP23(self, properties, recommendedDefaults,
883
889
def validateHBASEConfigurationsFromODP12 (self , properties , recommendedDefaults , configurations , services , hosts ):
884
890
hbase_site = properties
885
891
validationItems = []
886
-
892
+ hbase_security_kerberos = False
893
+ if "hbase.security.authentication" in properties :
894
+ hbase_security_kerberos = properties ["hbase.security.authentication" ].lower () == "kerberos"
887
895
#Adding HBase Thrift Logic Here
888
896
ranger_plugin_properties = self .getSiteProperties (configurations , "ranger-hbase-plugin-properties" )
889
897
ranger_plugin_enabled = ranger_plugin_properties ['ranger-hbase-plugin-enabled' ] if ranger_plugin_properties else 'No'
@@ -909,9 +917,20 @@ def validateHBASEConfigurationsFromODP12(self, properties, recommendedDefaults,
909
917
validationItems .append ({"config-name" : framed_prop_name ,
910
918
"item" : self .getErrorItem ("{0} needs to be defined when HBase Thrift Server is installed" .format (framed_prop_name ))})
911
919
else :
912
- if 'false ' == hbase_site [framed_prop_name ].lower ():
920
+ if 'true ' == hbase_site [framed_prop_name ].lower () and hbase_security_kerberos :
913
921
validationItems .append ({"config-name" : framed_prop_name ,
914
- "item" : self .getWarnItem ("{0} should be set to true to improve performance and security" .format (framed_prop_name ))})
922
+ "item" : self .getWarnItem ("{0} need to be set to false when kerberos is enabled" .format (framed_prop_name ))})
923
+ #https://hbase.apache.org/book.html#security.gateway.thrift
924
+
925
+ # verification of hbase proxy user when hbase thrift server is installed and proxy is enable
926
+ hbase_user = services ['configurations' ]['hbase-env' ]['properties' ]['hbase_user' ]
927
+ if 'hbase.thrift.support.proxyuser' in hbase_site :
928
+ if hbase_site ['hbase.thrift.support.proxyuser' ].lower () == 'true' :
929
+ for prop in ["hadoop.proxyuser.{0}.groups" .format (hbase_user ),"hadoop.proxyuser.{0}.groups" .format (hbase_user )]:
930
+ if prop not in services ['configurations' ]['core-site' ]['properties' ]:
931
+ validationItems .append ({"config-name" : prop_name ,
932
+ "item" : self .getErrorItem (
933
+ "HBase user need to be added to proxyuser when impersonation is enabled." .format (prop_name ))})
915
934
916
935
validationProblems = self .toConfigurationValidationProblems (validationItems , "hbase-site" )
917
936
return validationProblems
0 commit comments