@yassine sihi,
There is a json file (role_command_order.json) which specifies the dependencies of starting/stopping the services.
If there is no dependency then the start/stop of services between hosts will run in parallel. You can find the files by running the command in ambari server node
find /var/lib/ambari-server/resources -iname role_command_order.json
Files inside common-services(/var/lib/ambari-server/resources/common-services) specify the dependency at a service level whereas files inside (/var/lib/ambari-server/resources/stacks) specify overall dependencies at stack level.
Consider this sample line in one of the file
"LIVY_SERVER-START" : ["NAMENODE-START", "DATANODE-START", "APP_TIMELINE_SERVER-START"]
This specifies that livy server start is dependent on namenode, datanode and app timeline server start.
Hope this helps 🙂
Thanks,
Aditya