5. YARN API stability
•
•
•
•
•
•
•
•
YARN-386
Broke APIs for one last time
Hopefully
Exceptions/method-names
Security: Tokens used irrespective of kerberos
Read-only IDs, factories for creating records
Protocols renamed!
Client libraries
6. Compatibility for existing applications
•
•
•
•
MAPREDUCE-5108
Old mapred APIs binary compatible
New mapreduce APIs source compatible
Pig, Hive, Oozie etc work with latest versions.
No need to rewrite your scripts.
10. Why we need AHS ?
•
Job History Server is MR specific
•
Jobs which are not MR
•
RM Restart
•
Hard coded Limits for number of jobs
•
Longer running jobs
11. AHS
•
Different process or Embedded in RM
•
Contains generic application Data
•
•
•
•
Application
Application Attempts
Container
Client Interfaces
•
•
•
WEB UI
Client Interface
Web Services
12. AHS History Store
•
Pluggable History Store
•
Storage Format is PB
•
•
•
Backward Compatible
Much easier to evolve the storage
HDFS implementation
22. Design and Work Plan
• YARN-128 – RM Restart
– Creates framework to store and load state information.
Forms the basis of failover and HA. Work close to
completion and being actively tested.
• YARN-149 – RM HA
– Adds HA service to RM in order to failover between
instances. Work in active progress.
• YARN-556 – Work preserving RM Restart
– Support loss-less recovery of cluster state when RM
restarts or fails over
– Design proposal up
• All the work is being done in a carefully planned
manner directly on trunk. Code is always stable and
ready.
24. RM Restart
• Supports ZooKeeper, HDFS, and local
FileSystem as the underlying store.
• ClientRMProxy
– all Clients (NM, AM, clients) of RM have the same
retry behavior while RM is down.
• RM restart is working in secure environment
now!
26. RMStateStore
• Two types of State Info:
– Application related state info: asynchronously
• ApplicationState
– ApplicationSubmissionContext ( AM ContainerLaunchContext,
Queue, etc.)
• ApplicationAttemptState
– AM container, AMRMToken, ClientTokenMasterKey, etc.
– RMDelegationTokenSecretManager State(not
application specific) : synchronously
• RMDelegationToken
• RMDelegationToken MasterKey
• RMDelegationToken Sequence Number
27. RM Recovery Workflow
• Save the app on app submission
– User Provided credentials (HDFSDelegationToken)
• Save the attempt on AM attempt launch
– AMRMToken, ClientToken
• RMDelegationTokenSecretManager
– Save the token and sequence number on token
generation
– Save master key when it rolls
• RM crashes….
28. What happens after RM restarts?
• Instruct the old AM to shutdown
• Load the ApplicationSubmissionContext
– Submit the application
• Load the earlier attempts
– Loads the attempt credentials (AMRMToken,
ClientToken)
• Launch a new attempt
30. Consistency between Downstream
consumers of AM and YARN
• AM should notify its consumers that the job is
done only after YARN reports it’s done
– FinishApplicationMasterResponse.getIsUnregister
ed()
– User is expected to retry this API until it becomes
true.
– Similarly, kill-application (fix in progress)
31. For MR AM
• Races:
– JobClient: AM crashes after JobClient sees
FINISHED but before RM removes the app when
app finishes
• Bugs: relaunch FINISHED application(succeeded, failed,
killed)
– HistoryServer: History files flushed before RM
removes the app when app finishes
33. How to use: 3 steps
• 1. Enable RM restart
– yarn.resourcemanager.recovery.enabled
• 2. Choose the underlying store you want (HDFS, ZooKeeper,
local FileSystem)
– yarn.resourcemanager.store.class
– FileSystemRMStateStore / ZKRMStateStore
• 3. Configure the address of the store
– yarn.resourcemanager.fs.state-store.uri
– hdfs://localhost:9000/rmstore
37. Architecture
● Active / Standby
○
Standby is powered up, but doesn’t have any
state
● Restructure RM services (YARN-1098)
○
Always On services
○
Active Services (e.g. Client <-> RM, AM <-> RM)
● RMHAService (YARN-1027)
38. Failover / Admin
● CLI: yarn rmhaadmin
● Manual failover
● Automatic failover (YARN-1177)
○
Use ZKFC
○
Start it as an RM service instead of a separate
daemon.
○
Re-visit and strip out unnecessary parts.
39. Fencing (YARN-1222)
● Implicit fencing through ZK RM StateStore
● ACL-based fencing on store.load() during
transition to active
○
Shared read-write-admin access to the store
○
Claim exclusive create-delete access
○
All store operations create-delete a fencing node
○
The other RM can’t write to the store anymore