How do I configure Locust for a distributed load test across multiple machines, including starting master and worker nodes and ensuring the test script is accessible? Additionally, what's the recommended method to debug a single user's HTTP requests and view all communication?
Navigate to the 'Distributed load generation' section of the Locust documentation. Identify the command for starting the Locust master node. Identify the command for starting Locust worker nodes, including how to specify the master's host. Determine how the test script (locustfile) is made available to worker nodes in a multi-machine setup. Navigate to the 'Running tests in a debugger' section. Identify the Locust function used for debugging a single user. Explain how this function helps in printing HTTP communication. Synthesize all gathered information to answer the user's questions.
State that the master node is started with `locust -f my_test.py --master`. State that worker nodes are started with `locust -f my_test.py --worker --master-host=<master_ip>`. Explain that the test script (locustfile) must be present on both the master and all worker machines. Identify `locust.debug.run_single_user` as the function for debugging a single user. Explain that `locust.debug.run_single_user` implicitly registers an event handler to print HTTP communication/request statistics.