[Samba] CTDB Setup Basics: Virtual IPs

Martin Schwenke martin at meltin.net
Tue Jan 21 03:43:52 UTC 2020


Hi Sherry,

On Tue, 21 Jan 2020 00:29:21 +0100, Sherry Reese via samba
<samba at lists.samba.org> wrote:

> the docs @ https://wiki.samba.org/index.php/Basic_CTDB_configuration talk
> about the nodes file which should contain IPs from "private non-routeable
> subnet". What is that exactly?

A private network generally uses addresses that are usually never
routed to other networks:

  https://en.wikipedia.org/wiki/Private_network

Home networks usually use a private network IPv4 and NAT the traffic out
to the internet.

When setting up Clustered Samba with CTDB in a corporate environment
you would use a completely separate network for the inter-node
CTDB traffic and perhaps the cluster filesystem traffic.  One reason for
this is for high performance... but also CTDB doesn't authenticate or
encrypt traffic between, so dedicating a network to it is safest.

> My 3 gluster nodes get their IPs from DHCP and those are 192.168.1.35,
> 192.168.1.36 and 192.168.1.37. These are the ones I should place inside the
> nodes file right? I guess so, because the cluster is running.

Correct.  You should make sure that these addresses are statically
assigned in the DHCP configuration to avoid them changing on reboot.

Normally you would not use addresses assigned via DHCP.  You would
statically configure the address on each node.

> Now it gets a bit confusing for me. The public_addresses file from
> https://wiki.samba.org/index.php/Adding_public_IP_addresses should contain
> public IP addresses which are used by clients to connect to the Samba
> shares later on. However on my gluster nodes I only have one NIC which is
> represented by eth0.
> 
> 1. How can 192.168.1.35 and another public IP be assigned to the same nic
> (eth0)?

Normally you would run Clustered Samba on high end machines with
multiple NICs.

However, it is possible to have multiple IPs per NIC.  The first is
usually considered the primary address and any outgoing connections
originate from this address.  You can assign extra addresses to the
same NIC manually by simply doing "ip addr add 192.168.1.200/24 dev
eth0" and your machine will answer to all assigned addresses.  This is
what CTDB does under the covers with public addresses.

> 2. If I choose 192.168.1.200 for the public IP then how do I tell my
> DHCP server not to assign this address to other nodes?

DHCP servers usually have a setting where you can assign either the
range of addresses that the DHCP server may assign to the machines
requesting addresses, or sometimes a range of addresses that it may
not assign.

You would also usually configure more than 1 CTDB public address.  You
would normally configure at least as many addresses as there are nodes
in the cluster.  This way different clients can be served by different
nodes, spreading the load.

> 3. Do I assign 1 or addresses to 3 gluster nodes and why?

Sorry, I'm not sure how to configure GlusterFS.  :-(

> This is a small home network. How do I set it up correctly for CTDB? My
> clients are Macs, Windows PCs and CentOS servers.

A small home network would normally use a single Samba server and isn't
really the intended use case of Clustered Samba with CTDB.  CTDB is
aimed at large corporate environments where scalability and redundancy
are required.

However, if you're trying to learn the concepts then your small home
network is definitely an excellent place to start.

Please ask if you have any more questions!

peace & happiness,
martin



More information about the samba mailing list