title: Riak node no longer working after changing IP address
body: <p>I'm using an instanced Amazon EC2 virtual Ubuntu 12.04 server as my single Riak node. I've gone through all the proper stages of setting up Riak on the instance using the guide on the basho website <strong><a href="http://docs.basho.com/riak/latest/tutorials/installation/Installing-on-Debian-and-Ubuntu/" rel="noreferrer">here</a></strong>. Where <strong><code>x.x.x.x</code></strong>  is the private IP address of the instance, this included:</p>
  
  <h2>Installation</h2>
  
  <blockquote>
    <ul>
    <li><p>Using <strong><code>sudo su -</code></strong> to gain root privileges (EC2 logs me in as 'Ubuntu').</p></li>
    <li><p>Installing the SSL Lib with:</p>
    
    <h3><strong><code>sudo apt-get install libssl0.9.8</code></strong></h3></li>
    <li><p>Downloading the 64-bit package for 12.04:</p>
    
    <h3><strong><code>wget http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/CURRENT/ubuntu/precise/riak_1.2.1-1_amd64.deb</code></strong></h3></li>
    <li><p>Then unpacking via:</p>
    
    <h3><strong><code>sudo dpkg -i riak_1.2.1-1_amd64.deb</code></strong></h3></li>
    </ul>
  </blockquote>
  
  <p>As instructed in the <strong><a href="http://docs.basho.com/riak/latest/cookbooks/Adding-and-Removing-Nodes/" rel="noreferrer">basho guide</a></strong>, I updated these two files (using vi):</p>
  
  <h2>vm.args</h2>
  
  <blockquote>
    <ul>
    <li>Changing <strong><code>-name riak@x.x.x.x</code></strong> to the private IP of my instance. </li>
    </ul>
  </blockquote>
  
  <h2>app.config</h2>
  
  <blockquote>
    <ul>
    <li><p>Changing <strong><code>{http, [ {"x.x.x.x", 8098 } ]}</code></strong> to the private IP of my instance.</p></li>
    <li><p>Changing <strong><code>{pb_ip, "x.x.x.x"}</code></strong> to the private IP of my instance.</p></li>
    </ul>
  </blockquote>
  
  <p>The Riak node was working fine when I first setup the server and performed the above, I could connect to the node, and using <strong><code>riak start</code></strong> then <strong><code>riak-admin test</code></strong> returned successfully with:</p>
  
  <pre><code>&gt;Attempting to restart script through sudo -H -u riak
  &gt;Successfully completed 1 read/write cycle to 'riak@x.x.x.x'
  </code></pre>
  
  <p>The next day I fired up the instance, repeated the above process (ignoring installation) with the instance's new IP address <strong><code>y.y.y.y</code></strong> (the private IP of the instance changes every time it stops/starts) and typed <strong><code>riak start</code></strong> into the terminal, only to be greeted with:</p>
  
  <pre><code>&gt;Attempting to restart script through sudo -H -u riak
  &gt;Riak failed to start within 15 seconds,
  &gt;see the output of 'riak console' for more information.
  &gt;If you want to wait longer, set the environment variable
  &gt;WAIT_FOR_ERLANG to the number of seconds to wait
  </code></pre>
  
  <p>In the riak console the error given is:</p>
  
  <pre><code>&gt;gen_server riak_core_capability terminated with reason: no function clause matching orddict:fetch('riak@y.y.y.y', [{'riak@x.x.x.x',[{{riak_core,staged_joins},[true,false]},{{riak_core,vnode_routing},[proxy,...]},...]}])
  </code></pre>
  
  <p>Where <strong><code>y.y.y.y</code></strong> is the new instance IP address and <strong><code>x.x.x.x</code></strong> was the old one.</p>
  
  <p>I've been scratching my head over this for a while now and can't find anything on the topic, the only solution I can think of is to re-install Riak on the off chance my PATH directories have gone wrong. If that fails my last resort would be to terminate the instance and reconfigure Riak on a new instance. So before I jump the gun, what I would like to ask is:</p>
  
  <ul>
  <li><p>After updating the fields in <code>app.config</code> and <code>vm.args</code> with the new instance IP address, why is the <strong><code>riak start</code></strong> command no longer successful?</p></li>
  <li><p>Is there any way for an Ubuntu EC2 instance to be assigned with a static private IP? Not only would this help solve the problem, but saves me time having to update <code>app.config</code> and <code>vm.args</code> every time I start/stop the instance.</p></li>
  </ul>