Ambari-server architecture

state

Three states:

  • Live Cluster State: The current status of the cluster, the status information reported by each node will change the status
  • Desired State: The state that the user wants the node to be in. The user has performed a series of operations on the page and needs to change the state of some services. These states have not yet worked on the node
  • Action State: The operation state is the request state when the state changes, and it can be regarded as an intermediate state, which can assist the transition from LiveCluster State to Desired State

image.png

heartbeat

The Heartbeat Handler module of Ambari-Server is used to receive heartbeat requests from each agent (heartbeat requests contain two types of information: node status information, returned operation results), and pass the node status information to the FSM state machine to maintain the status of the node. And return the returned operation result information to Action Manager for further processing

The Coordinator module (API handler) mainly checks whether it meets the requirements after receiving the operation request on the WEB side. The StagePlanner decomposes it into a set of operations, and finally provides it to the ActionManager to complete the execution operation

The maintenance and changes of all state information of Ambari-Server will be recorded in the database, and the user will make some corresponding records on the database when the user makes some changes to the service. At the same time, the Agent obtains the change history of the database through the heartbeat

jetty

Ambari-Server uses jetty as a Servlet container as an embedded Java server, and the related code is in AmbariServer.java under server/controller. Among them, the management of Session seems that AmbariSessionManager rewrites the SessionManager class

  • Jetty is an open source Servlet container, which is a java-based web container, and its API is released in the form of a set of JAR packages. Developers can instantiate the Jetty container into an object, which can quickly provide network and web connections for some independently running Java applications
  • Google Guice a google IOC container
  • Spring
  • JAX-RS

Ambari-Server depends on Ambari-Views

Package names describe
org.apache.ambari.server.api.services The entry method of the web interface, processing the request of /api/v1/*
org.apache.ambari.server.controller Manage the cluster in Ambari, such as: add new host, update service, delete component
org.apache.ambari.service.orm.* Operations on the database
org.apache.ambari.server.agent.rest Handles the interface with the Agent
org.apache.ambari.security Is to use Spring Security for permission management

Ambari Server will read the configuration files of Stack and Service. When using Ambari to create a service, Ambari Server transmits the configuration files of Stack and Service and the control script of Service life cycle to Ambari Agent. After the Agent gets the configuration file, it will download and install the software package in the public source (Redhat, which uses yum service). After the installation is complete, Ambari Server will notify the Agent to start the Service. Afterwards, Ambari Server will periodically send commands to the Agent to check the status of the Service, and the Agent will report to the Server and present it on the GUI of Ambari

image.png

Guess you like

Origin blog.csdn.net/qq_44226094/article/details/130119045