Class BackupNode
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.conf.ReconfigurableBase
org.apache.hadoop.hdfs.server.namenode.NameNode
org.apache.hadoop.hdfs.server.namenode.BackupNode
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.conf.Reconfigurable,TokenVerifier<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>,NameNodeStatusMXBean
BackupNode.
Backup node can play two roles.
HdfsServerConstants.NamenodeRole.CHECKPOINTnode periodically creates checkpoints, that is downloads image and edits from the active node, merges them, and uploads the new image back to the active.HdfsServerConstants.NamenodeRole.BACKUPnode keeps its namespace in sync with the active node, and periodically creates checkpoints by simply saving the namespace image to local disk(s).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.namenode.NameNode
NameNode.NameNodeHAContext, NameNode.OperationCategory -
Field Summary
Fields inherited from class org.apache.hadoop.hdfs.server.namenode.NameNode
ACTIVE_STATE, allowStaleStandbyReads, blockStateChangeLog, DEFAULT_PORT, httpServer, LOG, METRICS_LOG_NAME, NAMENODE_SPECIFIC_KEYS, NAMESERVICE_SPECIFIC_KEYS, namesystem, nodeRegistration, OBSERVER_STATE, role, STANDBY_STATE, stateChangeLog, stopRequested, tracer -
Method Summary
Modifier and TypeMethodDescriptionprotected NameNode.NameNodeHAContextprotected HAStatecreateHAState(org.apache.hadoop.conf.Configuration conf) protected NameNodeRpcServercreateRpcServer(org.apache.hadoop.conf.Configuration conf) Create the RPC server implementation.protected InetSocketAddressgetHttpServerAddress(org.apache.hadoop.conf.Configuration conf) protected StringgetNameServiceId(org.apache.hadoop.conf.Configuration conf) Get the name service Id for the nodeprotected InetSocketAddressgetRpcServerAddress(org.apache.hadoop.conf.Configuration conf) protected InetSocketAddressgetServiceRpcServerAddress(org.apache.hadoop.conf.Configuration conf) Given a configuration get the address of the service rpc server If the service rpc is not configured returns nullprotected voidinitialize(org.apache.hadoop.conf.Configuration conf) Initialize name-node.protected voidloadNamesystem(org.apache.hadoop.conf.Configuration conf) protected voidsetRpcServerAddress(org.apache.hadoop.conf.Configuration conf, InetSocketAddress addr) protected voidsetRpcServiceServerAddress(org.apache.hadoop.conf.Configuration conf, InetSocketAddress addr) Modifies the configuration passed to contain the service rpc address settingbooleansetSafeMode(org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction action) voidstop()Stop all NameNode threads and wait for all to finish.Methods inherited from class org.apache.hadoop.hdfs.server.namenode.NameNode
checkAllowFormat, composeNotStartedMessage, createNameNode, doImmediateShutdown, doRollback, format, getAliasMapServer, getAuxiliaryNameNodeAddresses, getBytesWithFutureGenerationStamps, getClientIdAndCallId, getClientMachine, getClientNamenodeAddress, getFSImage, getHostAndPort, getHttpAddress, getHttpAddress, getHttpsAddress, getHttpServer, getHttpServerBindAddress, getLastHATransitionTime, getNameNodeAddress, getNameNodeAddressHostPortString, getNameNodeMetrics, getNameNodeState, getNamesystem, getNewConf, getNNAuxiliaryRpcAddress, getNNRole, getProtocolVersion, getReconfigurableProperties, getRemoteUser, getRole, getRpcServer, getRpcServerBindHost, getServiceAddress, getServiceRpcAddress, getServiceRpcServerBindHost, getSlowDisksReport, getSlowPeersReport, getStartupOption, getStartupProgress, getState, getTokenServiceName, initializeGenericKeys, initializeSharedEdits, initializeSharedEdits, initMetrics, isActiveState, isInSafeMode, isObserverState, isSecurityEnabled, isStandbyState, join, joinHttpServer, main, parseSpecialValue, queueExternalCall, reconfigurePropertyImpl, setServiceAddress, startMetricsLogger, stopMetricsLogger, verifyTokenMethods inherited from class org.apache.hadoop.conf.ReconfigurableBase
getChangedProperties, getReconfigurationTaskStatus, isPropertyReconfigurable, reconfigureProperty, setReconfigurationUtil, shutdownReconfigurationTask, startReconfigurationTaskMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Method Details
-
getRpcServerAddress
- Overrides:
getRpcServerAddressin classNameNode
-
getServiceRpcServerAddress
Description copied from class:NameNodeGiven a configuration get the address of the service rpc server If the service rpc is not configured returns null- Overrides:
getServiceRpcServerAddressin classNameNode
-
setRpcServerAddress
protected void setRpcServerAddress(org.apache.hadoop.conf.Configuration conf, InetSocketAddress addr) - Overrides:
setRpcServerAddressin classNameNode
-
setRpcServiceServerAddress
protected void setRpcServiceServerAddress(org.apache.hadoop.conf.Configuration conf, InetSocketAddress addr) Description copied from class:NameNodeModifies the configuration passed to contain the service rpc address setting- Overrides:
setRpcServiceServerAddressin classNameNode
-
getHttpServerAddress
- Overrides:
getHttpServerAddressin classNameNode
-
loadNamesystem
- Overrides:
loadNamesystemin classNameNode- Throws:
IOException
-
initialize
Description copied from class:NameNodeInitialize name-node.- Overrides:
initializein classNameNode- Parameters:
conf- the configuration- Throws:
IOException
-
createRpcServer
protected NameNodeRpcServer createRpcServer(org.apache.hadoop.conf.Configuration conf) throws IOException Description copied from class:NameNodeCreate the RPC server implementation. Used as an extension point for the BackupNode.- Overrides:
createRpcServerin classNameNode- Throws:
IOException
-
stop
public void stop()Description copied from class:NameNodeStop all NameNode threads and wait for all to finish. -
setSafeMode
public boolean setSafeMode(org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction action) throws IOException - Throws:
IOException
-
getNameServiceId
Description copied from class:NameNodeGet the name service Id for the node- Overrides:
getNameServiceIdin classNameNode- Returns:
- name service Id or null if federation is not configured
-
createHAState
- Overrides:
createHAStatein classNameNode
-
createHAContext
- Overrides:
createHAContextin classNameNode
-