Thanks for this Charlie. I'm running a production Riak cluster on AWS which runs constantly, and I've been wondering how I might be able to easliy stop and start AWS nodes for a testing and benchmarking cluster (to save on cost).
By using the 'riaknode1.priv' hostname method you describe, would I be able to stop and then restart a whole cluster of nodes at once? (As described by Deepak, AWS assigns new IPs when a VM starts). Thanks Matt On 8 January 2013 01:31, Charlie Voiselle <cvoise...@basho.com> wrote: > Deepak: > > When you name a node in app.config with -name it has to have a '.' in it, > like r...@hostname.net As you have surmised, you can get around that if > you use the -sname argument instead. > > They have to be done consistently. In your example, had you used the > -sname argument, `riak@riaknode1` would work. Making a host entry > `riaknode1.priv` that points to the local address would work with the -name > argument. > > The inportant thing about -name and -sname is that they can't mix within a > cluster. > > Cluster replace is designed to replace a node with a new one and transfer > all the partitions. You can cheat and use it to rename a node though. > > The process to do this would look like the following: > > - Stop the node to rename with `riak stop` > - Mark it 'down' *from another node in the cluster *using `riak-admin > down «old nodename». > - Rename the node in vm.args. > - Delete the ring directory. > - Start the node with `riak start`. > - It will come up as a single instance which you can verify with > `riak-admin member-status`. > - Join the node to the cluster with `riak-admin cluster join «cluster > nodename» ` > - Set it to replace the old instance of itself with `riak-admin > cluster replace «old nodename» «new nodename» > - Plan the changes with `riak-admin cluster plan` > - Commit the changes with `riak-admin cluster commit` > > > As you can see, this is a very large effort, so best to use hostnames that > aren't moving around. Apologies for you getting this twice, Deepak. I > failed to reply to the list as well. > > Hope this makes sense... > Charlie > On Jan 1, 2013, at 2:43 PM, Deepak Balasubramanyam <deepak.b...@gmail.com> > wrote: > > I took the AWS EC2 riak image for a spin today. I have a query regarding > riak nodes and how they behave when the machine reboots. > > When an EC2 instance reboots, the internal ip / internal DNS / external > DNS change. This renders the app.config and -name argument on vm.args > incorrect. I was exploring solutions to deal with this problem. > > *1. Preventive measures* > > Someone on this thread dated May > 2011<http://riak-users.197444.n3.nabble.com/EC2-and-node-names-td2892047.html> > suggested > using host file entries that point to the local internal IP address. That > does not seem to work. Riak fails with the following error when I add a new > entry to /etc/hosts and configure vm.args with -name riak@riaknode1 > > Hostname riaknode1 is illegal > > I confirmed that riaknode1 pings correctly before starting riak. I guess > erlang tries to match the hostname of the system resulting in this failure > ? Can anyone throw some light on this ? > > *2. Use -sname* > > Is starting the erlang VM with the sname flag an option if it will help > prevent the 'illegal hostname' error ? > Disclaimer: My knowledge of erlang is close to zilch, so sorry if that > option sounded like something you could dismiss easily :) > > *3. Use cluster replace > * > > a. I understand that the IPs in app.config and vm.args can be replaced > with the correct IP on a restart and using a subsequent 'cluster replace' > command will do. Will executing the 'cluster plan' and 'cluster commit' > commands now produce network chatter ? > > b . What happens if 2 nodes go down and one was joined with the other. > They both have 2 different IP addresses on restart. How will 'cluster > replace' work now ? > > Do let me know your thoughts. > > Thanks > -Deepak > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com