title: Understanding Selenium Grid2 implementation running on EC2
body: <p>I have implemented Selenium Grid by reading and understanding from the sparse/fragmented online documentation about Grid2. 
  <a href="http://groups.google.com/group/selenium-users/browse_thread/thread/a6eb2893083410fa?pli=1" rel="nofollow">My current implementation</a> is-</p>
  
  <p><strong>Webdriver node registered and running on EC2 instance</strong></p>
  
  <pre><code>java -jar selenium-server-standalone-2.8.0.jar -role webdriver -hub http://EC2_PUBLIC_IP:5555/grid/register -port 5556
  </code></pre>
  
  <p><strong>Hub registered and running on same EC2 instance</strong> </p>
  
  <pre><code>java -jar selenium-server-standalone-2.8.0.jar -role hub -hubhost EC2_PUBLIC_IP -port 5555
  </code></pre>
  
  <p>I am running my Webdriver based TestNG tests from Eclipse on my local machine. The driver configuration is 
  driver = new RemoteWebDriver(new URL("http://EC2_PUBLIC_IP:5556/wd/hub"), capability);</p>
  
  <p>Running the tests launches the browser on my EC2 instance. </p>
  
  <p>I am still looking for a few unanswered questions that may be very basic and would appreciate people's views or understanding on them. I want to have my browsers launched on a machine that has respective Node running on it. e.g- A machine running webdriver+firefox node should launch respective test. </p>
  
  <ol>
  <li>How does the Grid2 implementation works if I need to setup Hub and Node each on separate machines? I believe the implementation would be different if its a <strong>EC2Hub-LocalMachineNode</strong> combination AND when its an <strong>EC2Hub-EC2Node</strong> combination. 
  In either cases, what command/URL do we provide for hub, webdriver/RC node and in the Selenium tests? I ask this because majority of online documentation speaks about "localhost" and port 4444, but I want to make this generic.</li>
  <li>Are there any specific settings for the ports/firewall while setting this up?  </li>
  </ol>
  
  <p>I was able to achieve this by opening ports 5554-5559 on my EC2 instance from the AWS portal and also the firewall for these ports on my local as well as EC2 machine. </p>
  
  <p>Please let me know if I am unclear, or ambiguous at any point. Would appreciate your explanations. </p>