java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.io.retry.FailoverProxyProvider<T>@Private @Evolving public class ObserverReadProxyProviderWithIPFailover<T extends ClientProtocol> extends ObserverReadProxyProvider<T>
ObserverReadProxyProvider to support NameNode IP failover.
For Observer reads a client needs to know physical addresses of all
NameNodes, so that it could switch between active and observer nodes
for write and read requests.
Traditional IPFailoverProxyProvider works with a virtual
address of the NameNode. If active NameNode fails the virtual address
is assigned to the standby NameNode, and IPFailoverProxyProvider, which
keeps talking to the same virtual address is in fact now connects to
the new physical server.
To combine these behaviors ObserverReadProxyProviderWithIPFailover
should both
fs.defaultFS = hdfs://mycluster
dfs.nameservices = mycluster
dfs.ha.namenodes.mycluster = ha1,ha2
dfs.namenode.rpc-address.mycluster.ha1 = nn01-ha1.com:8020
dfs.namenode.rpc-address.mycluster.ha2 = nn01-ha2.com:8020
dfs.client.failover.ipfailover.virtual-address.mycluster =
hdfs://nn01.com:8020
dfs.client.failover.proxy.provider.mycluster =
org.apache...ObserverReadProxyProviderWithIPFailover
Here nn01.com:8020 is the virtual address of the active NameNode,
while nn01-ha1.com:8020 and nn01-ha2.com:8020
are the physically addresses the two NameNodes.
With this configuration, client will use
ObserverReadProxyProviderWithIPFailover, which creates proxies for both
nn01-ha1 and nn01-ha2, used for read/write RPC calls, but for the failover,
it relies on the virtual address nn01.comAbstractNNFailoverProxyProvider.NNProxyInfo<T>conf, factory, fallbackToSimpleAuth, ugi, xface| Constructor | Description |
|---|---|
ObserverReadProxyProviderWithIPFailover(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory) |
By default ObserverReadProxyProviderWithIPFailover
uses
IPFailoverProxyProvider for failover. |
ObserverReadProxyProviderWithIPFailover(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory,
AbstractNNFailoverProxyProvider<T> failoverProxy) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
useLogicalURI() |
Inquire whether logical HA URI is used for the implementation.
|
close, getAlignmentContext, getProxy, performFailovercreateProxyIfNeeded, getFallbackToSimpleAuth, getInterface, getProxyAddresses, getRandomOrder, setFallbackToSimpleAuthpublic ObserverReadProxyProviderWithIPFailover(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory)
IPFailoverProxyProvider for failover.public ObserverReadProxyProviderWithIPFailover(org.apache.hadoop.conf.Configuration conf,
java.net.URI uri,
java.lang.Class<T> xface,
HAProxyFactory<T> factory,
AbstractNNFailoverProxyProvider<T> failoverProxy)
public boolean useLogicalURI()
AbstractNNFailoverProxyProvideruseLogicalURI in class ObserverReadProxyProvider<T extends ClientProtocol>Copyright © 2008–2025 Apache Software Foundation. All rights reserved.