Riak and host names
cvoiselle at basho.com
Mon Jan 7 18:03:03 EST 2013
You would need to use (or implement your own) DNS service that you could programmatically access--Route 53 has an API that you could use to create DNS entries that point to the internal addresses of your nodes. In very carefully re-reading the thread Deepak mentions, one problem that will occur is that each node needs to be able to resolve the other nodes by name also. The only way for this to occur reasonably, would be to register the internal addresses with a single point that they share. Some examples of free services that you might use for this are DynDns, DNSDynamic, or DNS-O-Matic. I have also seen some projects floating around the web that might enable you to create a self-hosted dynamic DNS like opendyn and GnuDIP; however, I have had no occasion to use something like this in my own environment. Some additional discussion about creating your own Dynamic DNS server is also at http://unix.stackexchange.com/questions/29049/how-to-create-a-custom-dynamic-dns-solution
Hope this helps!
On Jan 7, 2013, at 5:00 PM, Matt Black <matt.black at jbadigital.com> wrote:
> 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).
> On 8 January 2013 01:31, Charlie Voiselle <cvoiselle at basho.com> wrote:
> When you name a node in app.config with -name it has to have a '.' in it, like riak at 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 at 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...
> On Jan 1, 2013, at 2:43 PM, Deepak Balasubramanyam <deepak.balu at 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 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 at 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.
>> riak-users mailing list
>> riak-users at lists.basho.com
> riak-users mailing list
> riak-users at lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users