[ 
https://issues.apache.org/jira/browse/HDFS-7858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14341375#comment-14341375
 ] 

Arun Suresh commented on HDFS-7858:
-----------------------------------

[~kihwal], [~bikassaha], I understand your concerns over the use of ZK. But 
consider the following:

# Most DFSClients are cached (since the Filesystem objects are generally 
cached). Thus long lived clients will probably not have more than 1-2 
persistent connections to ZK.
# Short lived clients will first check if there is cached entry (possibly in 
the home directory, something like ~/.lastNN) that contains the last accessed 
active NN. The client will proceed to connect to that NN first (thereby 
removing non-determinism from the current scheme).. and will most probably 
succeed. It will contact ZK only if the connection was unsuccessful.. and we 
can limit this to just a ping (not a watch registration) so the connection is 
not persistent.
# A Client that has connected to a NN without the need for a ZK connection can 
continue to NOT talk to ZK till
## the client dies and no ZK connection is ever made
## after waiting for a configurable time (maybe an hour).. after which it is 
established that it is a ling lived client,  

Do you think this might reduce the total number of connection to ZK at any 
point of time ? 


> Improve HA Namenode Failover detection on the client using Zookeeper
> --------------------------------------------------------------------
>
>                 Key: HDFS-7858
>                 URL: https://issues.apache.org/jira/browse/HDFS-7858
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Arun Suresh
>            Assignee: Arun Suresh
>
> In an HA deployment, Clients are configured with the hostnames of both the 
> Active and Standby Namenodes.Clients will first try one of the NNs 
> (non-deterministically) and if its a standby NN, then it will respond to the 
> client to retry the request on the other Namenode.
> If the client happens to talks to the Standby first, and the standby is 
> undergoing some GC / is busy, then those clients might not get a response 
> soon enough to try the other NN.
> Proposed Approach to solve this :
> 1) Since Zookeeper is already used as the failover controller, the clients 
> could talk to ZK and find out which is the active namenode before contacting 
> it.
> 2) Long-lived DFSClients would have a ZK watch configured which fires when 
> there is a failover so they do not have to query ZK everytime to find out the 
> active NN
> 2) Clients can also cache the last active NN in the user's home directory 
> (~/.lastNN) so that short-lived clients can try that Namenode first before 
> querying ZK



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to