configuring node hostnames in a cluster

Michael riak at autosys.us
Tue Dec 15 12:24:57 EST 2009


On Tue, Dec 15, 2009 at 11:11:52AM -0500, matthew hawthorne wrote:
> I'm setting up a test cluster, and am a bit confused about these 3
> configuration variables:
> riak_nodename
> riak_hostname
> riak_web_ip
> 
> questions:
> 1) riak_nodename appears to be a logical name for the node, unused for
> any networking purposes.  correct?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 riak_nodename is important for the distributed nodes to talk with
 one another.


 used as    

   riak_nodename at riak_hostname 

 for the -name argument to identify the distributed erlang node name
 (of course, substituting the variable values).  Pass this name
 (from the first node started) to the storage only nodes so they
 can join the cluster.

~M

> 
> 2) what is the difference between riak_hostname and riak_web_ip?  are
> they usually the same value?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  riak_web_ip provides the raw interface to riak (with riak_web_port)

  see raw-http-howto.txt and erlang documentation

  e.g. 

 $ curl -X PUT http://127.0.0.1:8098/raw/web/ip/ -d "a.b.c.d"
 $ curl -i http://127.0.0.1:8098/raw/web/ip/
 HTTP/1.1 200 OK
 X-Riak-Vclock: a85hYGBgzGDKBVIsTPOYJmYwJTLmsTIw2M85wpcFAA==
 Vary: Accept-Encoding
 Server: MochiWeb/1.1 WebMachine/1.5.1 (hack the charles gibson)
 Link: </raw/web>; rel="up"
 Last-Modified: Tue, 15 Dec 2009 17:10:24 GMT
 ETag: 5C4gQnNiCr4N4hUhZFc20c
 Date: Tue, 15 Dec 2009 17:10:36 GMT
 Content-Type: application/x-www-form-urlencoded
 Content-Length: 7

 a.b.c.d


 I suppose they could be the same or different depending on
 what you want exposed.  I have not played around a lot with
 these because I provide a separate web frontend for the
 riak services.  My web frontend communicates with riak
 backend using riak_client.

~M

> 
> 3) is there a way to configure riak so that nodes communicate using
> internal hostnames, but clients can connect using the external or
> public hostnames?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 The nodes talk with each other via riak_nodename at riak_hostname
 'address'.

 You could either expose the raw interface as described above
 with a public riak_web_ip, or add a simple web frontend for
 clients/users.  

 Probably more ways to do it as well.


~M

> 
> thanks!
> 
> -matt
> 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 ... and re-read all the documentation again - some of
 it may make more sense after reading the above.

 Reading some erlang distribution documentation may help as well.

~M

-- 
Michael McDaniel
Portland, Oregon, USA
http://putitgetit.com





More information about the riak-users mailing list