title: get ip of emr master node from yarn cli
body: <p>In order to get a list of the ip addresses of emr slave nodes, one must run the following code:</p>
  
  <pre><code>yarn node -list 2&gt;/dev/null \
  | sed -n "s/^\(ip[^:]*\):.*/\1/p"
  </code></pre>
  
  <p><code>yarn node -list</code> happens to print off the ip of the master node to <code>stderr</code>:</p>
  
  <blockquote>
    <p>19/04/02 18:59:26 INFO client.RMProxy: Connecting to ResourceManager at ip-10-1-0-238.ec2.internal/10.1.0.238:8032</p>
  </blockquote>
  
  <p><strong>How would I modify the above code to get the private ip of the emr master node instead?</strong></p>