In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the example analysis of MDSDaemon, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
MDSDaemon and MDSRank work together to form the core architecture of the MDS process. This article only describes the MDSDaemon section, which will be described later in the MDSRank section.
MDSDaemon::asok_command ()
| | _ _ for command = = "status"
| | _ _ MDSDaemon::dump_status () prints mds status information |
| | _ for command! = "status" and mds_rank! = NULL |
| | _ _ MDSRank::handle_asok_command () command requests are processed by the MDSRank class |
MDSDaemon::set_up_admin_socket ()
| | _ _ create AdminSocket class instance |
| | _ _ create MDSSocketHook class instance |
| | _ _ call AdminSocket- > register_command () to register commands supported by MDSDaemon |
MDSDaemon::init ()
| | _ Objecter::init () |
| | _ _ set objecter/beacon/mdsdaemon for message distribution and processing |
| | _ _ sets the messenger of monclient |
| | _ _ MonClient::init () initializes monclient |
| | _ _ set the log information of monclient |
| | _ _ MonClient::authenticate () authenticates to monitor |
| | _ _ Objecter::start () starts Objecter |
| | _ _ MonClient::sub_want ("mdsmap") requests mdsmap information from monitor |
| | _ _ set_up_admin_socket () sets the commands that admin can handle through socket |
| | _ _ SaftTimer::init () initializes timer |
| | _ _ Beacon::init () initializes Beacon |
| | _ _ Messenger::set_myname () sets the Messenger name |
| | _ reset_tick () |
MDSDaemon::reset_tick ()
| | _ _ create C_MDS_Tick class object |
| | _ _ SafeTimer::add_event_after () dispatches timer, and executes the MDSDaemon::tick () function when the timer arrives |
MDSDaemon::tick ()
| | _ _ reset_tick () reset timer |
| | _ _ MDSRank::tick () performs the tick operation of MDSRank |
MDSDaemon::handle_command (MCommand * m) this function is mainly used to process the command provided by the parameter, and then feedback the result of the command execution to the caller
| | _ _ check the validity and permissions of the parameters. For those that do not meet the conditions, set the information returned to the caller |
| | _ _ MDSDaemon::_handle_command () executes specific command processing |
| | _ _ create MCommandReply class object |
| | _ _ sets the tid and data of this class object |
| | _ m-> get_connection- > send_message () sends the MCommandReply class object to the caller |
MDSDaemon::_handle_command ()
| | _ _ cmd_getval () parses command |
| | _ _ for prefix= "get_command_descriptions/injectargs/exit/respawn/heap/cpu_profiler", it is handled by MDSDaemon, otherwise it is handled by MDSRank::handle_command () |
MDSDaemon::handle_mds_map (MMDSMap * m)
| | _ _ get the epoch value of the latest MDSMap |
| | _ _ compare the epoch value of the latest MDSMap with the epoch of the current mdsmap. If the latest epoch is less than the epoch of the current MDSMap, it will be returned directly |
| | _ _ create a MDSMap class object and initialize it with parameters |
| | _ _ traverse the current MDSMap |
| | _ _ if the MDS process in the current MDSMap does not exist in the latest MDSMap, set the MDS process down |
| | _ _ if the MDS appears as STANDBY_REPLAY in the latest MDSMap, you will get the standby_for_ rank value and write it in whoami |
| | _ _ is not in standby_replay mode |
| | _ MDSDaemon::_handle_mds_map () |
| | _ _ for standby_replay mode |
| | _ _ for those whose standby_for_rank is changed, the respawn () function is called to restart the MDS process |
| | _ _ if MDS _ rank is empty, the MDSRankDispatcher class object is created and initialized |
| | _ _ mds_rank- > handle_mds_map () mdsmap is processed by MDSRank |
MDSDaemon::_handle_mds_map ()
| | _ _ the status of this mds process under the latest MDSMap is STATE_STANDBY |
| | _ _ Beacon::set_want_state (STATE_STANDBY) Update want state status in Beacon is STATE_STANDBY |
| | _ _ for want state=STATE_STANDBY in Beacon |
| | _ _ Beacon::set_want_state (STATE_BOOT) Update want state status in Beacon is STATE_BOOT |
MDSDaemon::suicide ()
| | _ _ delete timer timer |
| | _ _ clean_up_admin_socket () clears admin socket |
| | _ _ Beacon::set_want_state (STATE_DNE) sets the Beacon status to STATE_DNE |
| | _ Beacon::shutdown () |
| | _ _ if MDS _ rank is not empty |
| | _ mds_rank- > shutdown () |
| | _ _ if MDS _ rank is empty |
| | _ objecter- > shutdown () |
| | _ timer- > shudown () |
| | _ monc- > shutdown () |
| | _ messenger- > shutdown () |
MDSDaemon::respawn ()
| | _ _ call execv () system call function to restart the mds process |
MDSDaemon::ms_dispatch ()
| | _ _ Rubeacon.get _ want_state () = = STATE_DNE, indicating that the mds process is already in shutdown state, so messages cannot be processed |
| | _ _ MDSDaemon::handle_core_message () gives priority to processing MDSDaemon messages |
| | _ _ if MDS _ rank is not empty |
| | _ _ mds_rank- > ms_dispatch () messages are processed by mds_rank |
MDSDaemon::ms_get_authorizer ()
| | _ _ monc- > auth- > build_authorizer () auth is generated by the auth module of monitor |
MDSDaemon::handle_core_message ()
| | _ CEPH_MSG_MON_MAP |
| | _ _ does not handle |
| | _ CEPH_MSG_MDS_MAP |
| | _ _ handle_mds_map () calls handle_mds_map () to process new mds map messages |
| | _ CEPH_MON_COMMAND |
| | _ handle_command () |
| | _ CEPH_COMMAND |
| | _ handle_command () |
| | _ CEPH_MSG_OSD_MAP |
| | _ _ mds_rank- > handle_osd_map () mds_rank handles osd map |
MDSDaemon::ms_handle_reset ()
| | _ _ determine whether the sender of the message is client, and if not, exit directly |
| | _ _ determine whether beacon.get_want_state () is STATE_DNE, and if so, exit directly |
| | _ _ get the Connection class object according to the parameter Session class object |
| | _ _ Session object is empty |
| | _ Connection::mark_down () |
| | _ _ Session object is not empty |
| _ _ if session:: is_closed () is true
| | _ Connection::mark_down () |
| | _ _ Session::is_closed () is not true |
| | _ Session::put () |
MDSDaemon::ms_handle_remote_reset ()
| | _ _ determine whether the sender of the message is client, and if not, exit directly |
| | _ _ determine whether beacon.get_want_state () is STATE_DNE, and if so, exit directly |
| | _ _ get the Connection class object according to the parameter Session class object |
| | _ _ Session object is not empty |
| _ _ if session:: is_closed () is true
| | _ Connection::mark_down () |
| | _ _ Session::is_closed () is not true |
| | _ Session::put () |
MDSDaemon::ms_verify_authorizer ()
| | _ _ determine whether you are currently in stopping, and if so, exit directly |
| | _ _ determine whether beacon.get_want_state () is STATE_DNE, and if so, exit directly |
| _ _ get the corresponding authorize_handler according to the content of peer_type (there are mainly two kinds of handler here, namely: authorize_handler_cluster_registry/authorize_handler_service_registry. If peer_type==CEPH_ENTITY_TYPE_MDS, choose the former)
| | _ authorize_handler- > verify_authorizer () |
| | _ _ if authentication is successful |
| | _ _ if MDS _ rank is not empty |
| | _ _ mds_rank- > sessionmap.get_session () get session through mds_rank |
| | _ _ if session is empty |
| | _ _ create Session class instance |
| | _ _ initialize Session class instance |
| | _ _ caps after successful authentication |
| | _ _ Session::auth_caps.parse () parses the caps after successful authentication and saves it to Session |
MDSDaemon::ms_handle_accept ()
| | _ _ get the Session class instance corresponding to the connection |
| | _ _ set to connect to an instance of session class, that is, s-> connection = con |
MDSDaemon::is_clean_shutdown ()
| | _ _ if MDS _ rank is not empty |
| | _ _ returns whether mds_rank is stopped, that is, mds_rank- > is_stopped () |
| | _ _ if MDS _ rank is empty |
| | _ _ returns true |
Thank you for reading this article carefully. I hope the article "sample Analysis of MDSDaemon" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.