Member since 
    
	
		
		
		12-20-2017
	
	
	
	
	
	
	
	
	
	
	
	
	
	
			
      
                1
            
            
                Post
            
        
                0
            
            
                Kudos Received
            
        
                0
            
            
                Solutions
            
        
			
    
	
		
		
		12-20-2017
	
		
		04:33 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
	
				
		
			
					
				
		
	
		
					
							 
	I am trying to connect to a Kerberos secured Hiveserver2 that has HA enabled. I am following the approach outlined in this Hive documentation for multi-user scenario (Pre-authenticated subject method) Multi-UserScenarios and Programmatic Login to KerberosKDC 
 static final String JDBC_DB_URL = "jdbc:hive2://node1:2181,node2:2181,node3:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;principal=hive/_HOST@<realm>;auth=kerberos;kerberosAuthType=fromSubject;"; 
  
	In the service principal, I have used _HOST since the client program does not know which of the two hiveserver2 nodes is being connected to (HA configuration). According to the documentation   
	"The _HOST@YOUR-REALM.COM value in the example above is the Kerberos principal for the host where HiveServer2 is running. The special string _HOST in the properties is replaced at run-time by the fully-qualified domain name of the host machine where the daemon is running. This requires that reverse DNS is properly working on all the hosts configured this way. Replace YOUR-REALM.COM with the name of the Kerberos realm your Hadoop cluster is in"   
	Reverse DNS is configured on all nodes and is verified working. I am able to get hostname from IP as well as IP from hostname. Despite the efforts I could not get this connection to work. It fails with the error  
 >>>KRBError:
cTime is Sat Oct 22 09:57:54 IST 1988 593497674000
sTime is Thu Dec 14 10:01:16 IST 2017 1513225876000
suSec is 641259 
error code is 7
error Message is Server not found in Kerberos database
cname is username@realm.com 
sname is hive/_host@realm.com 
msgType is 30 
KrbException: Server not found in Kerberos database (7) - UNKNOWN_SERVER 
  
	Can someone please help me resolve this? Thanks! 
						
					
					... View more
				
			
			
			
			
			
			
			
			
			
		
		
			
				
						
							Labels:
						
						
		
			
	
					
			
		
	
	
	
	
				
		
	
	
- Labels:
- 
						
							
		
			Apache Hive
 
        

