Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Jun 29, 2008 11:49 pm 
Offline
Senior Newbie

Joined: Mon Jun 23, 2008 5:04 pm
Posts: 12
o/
Right well i've got two Linodes setup.
One is running apache + email (dovecot + postfix)
Other is running mysql

I have yet to point my domain at apache node yet as I am still fine tuning things.

One thing that has me stuck / stumped is the whole hostname / host business.

Lets say I am going to call them
node1.mydomain.com and node2.mydomain.com

Running ubuntu 8.04.

I don't seem to have a /etc/hostname file, should I create it and just enter
node1 ?

Edit /etc/hosts which currently has
127.0.0.1 localhost

and change to
127.0.0.1 localhost node1 node1.mydomain.com

anything else?

What is these names actually used for?
Possible to screw something up

Should I also enter
node2's ip address node2 node2.mydomain.com
into that same /etc/hosts on node1?

If someone could push me in the right direction.....


Top
   
PostPosted: Mon Jun 30, 2008 4:42 am 
Offline
Newbie

Joined: Fri Jun 27, 2008 10:43 am
Posts: 3
Wizzard wrote:
Should I also enter
node2's ip address node2 node2.mydomain.com
into that same /etc/hosts on node1?

If someone could push me in the right direction.....


Sounds like a good idea. Make sure that you use private IP addresses in /etc/hosts from the network page. Then the traffic between the nodes won't count against your quota.


Top
   
 Post subject:
PostPosted: Mon Jun 30, 2008 5:03 am 
Offline
Senior Newbie

Joined: Mon Jun 23, 2008 5:04 pm
Posts: 12
and the other stuff is all honkey dorey?


Top
   
 Post subject:
PostPosted: Mon Jun 30, 2008 9:59 am 
Offline
Senior Member

Joined: Mon Jul 30, 2007 9:55 pm
Posts: 80
The hostnames you assign to your machines can be whatever you want. I like to add an A record for the name I pick to DNS, but that's optional. For your internal (LAN) addresses, just use /etc/hosts.

For example, here's one of my nodes:

Code:
dfelicia@catch-22 ~ $ hostname
catch-22
dfelicia@catch-22 ~ $ hostname -f
catch-22.donsbox.com
dfelicia@catch-22 ~ $ cat /etc/hosts
# IPv4 localhost aliases
127.0.0.1       localhost
207.192.69.157  catch-22.donsbox.com      catch-22
192.168.133.15  jigani.local
192.168.133.149 donsbox.local
dfelicia@catch-22 ~ $ nslookup catch-22.donsbox.com
Server:         207.192.69.4
Address:        207.192.69.4#53

Non-authoritative answer:
Name:   catch-22.donsbox.com
Address: 207.192.69.157

dfelicia@catch-22 ~ $ nslookup 207.192.69.157
Server:         207.192.69.4
Address:        207.192.69.4#53

Non-authoritative answer:
157.69.192.207.in-addr.arpa     name = donsbox.com.

Authoritative answers can be found from:
69.192.207.in-addr.arpa nameserver = ns1.nac.net.
69.192.207.in-addr.arpa nameserver = ns2.nac.net.


So for LAN (which I use for distcc), I use the .local hostnames. I bind apache, dovecot, etc. to desired DNS name.


Top
   
 Post subject:
PostPosted: Mon Jun 30, 2008 10:18 am 
Offline
Senior Member

Joined: Mon Jul 30, 2007 9:55 pm
Posts: 80
To clarify what I was trying to say w/my reply...

You can put DNS names in /etc/hosts on both machines. Not a bad idea, in case DNS fails (unlikely, but known to happen from time to time). In addition, you must put your local (private) names and IPs in /etc/osts. Names are arbitrary. I like to use append .local for easy identification.

So, you might have foo.example.com, bar.example.com, foo.local, and bar.local in you hosts files. The example.com lines have your public (DNS) addresses. The .local lines have your private (LAN) addresses.

Bind mysql to your .local (private) address, and config Apache/whatever to talk to mysql using the .local (private) address.

Configured this way, the bandwidth doesn't count against your quota, not to mention throughput should be better.


Top
   
 Post subject:
PostPosted: Mon Jun 30, 2008 3:31 pm 
Offline
Senior Newbie

Joined: Mon Jun 23, 2008 5:04 pm
Posts: 12
Just wondering, how come on the foo machine you'd do

192.168.133.15 foo.local

instead of
127.0.0.1 foo.local

Wouldn't it be better to use it's loopback ip for the internals of the same machine.

I can see the point in doing
192.168.133.16 bar.local
on the foo machine.


Top
   
 Post subject:
PostPosted: Tue Jul 01, 2008 7:27 am 
Offline
Senior Member

Joined: Mon Jul 30, 2007 9:55 pm
Posts: 80
Quote:
Just wondering, how come on the foo machine you'd do 192.168.133.15 foo.local...


What would be the advantage of mapping foo.local to loopback, given that you have a static private IP for it?

I only map hostnames (other than localhost) to loopback as a last resort. e.g. for DHCP hosts on networks that don't support dynamic DNS, but that run software that needs to resolve hostname to an IP. (e.g. Gnome used to fail if hostname didn't resolve to an IP, prompting RedHat's installer, among others, to map hostname to the loopback address by default; a decision that annoys me, personally. Solaris and other "real" UNIX systems don't do that.)

Mapping your FQN to loopback is known to break Java RMI, among other things.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group