I need to set up Locust for a distributed load test across multiple machines. How do I start the master and worker nodes, and how do I ensure the test script is available to the workers? Also, if I need to debug a single user's HTTP requests to see all communication, what's the recommended way to do that?
Navigate to the 'Distributed load generation' section. Identify the command to start the Locust master node. Identify the command to start Locust worker nodes, specifying the master's host. Determine how the test script (locustfile) is made available to the worker nodes in a multi-machine setup. Navigate to the 'Running tests in a debugger' section. Identify the Locust method used for debugging a single user. Explain the purpose of this method in relation to printing HTTP communication. Synthesize the collected information to answer the questions.
State that the master is started with `locust -f my_test.py --master`. State that workers are started with `locust -f my_test.py --worker --master-host=<master_ip>`. Explain that the test script (locustfile) needs to be present on both the master and worker machines, as indicated by the `-f` flag in the commands. 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.