Postfix Multiple Instances Load Balance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Postfix Multiple Instances Load Balance

ahsan2011
Hi All

I have a CentOS server with 4 public IPs. I want to configure multiple
instances of postfix on those 4 IPs.

I have created multiple instances

multi_instance_directories = /etc/postfix-1 /etc/postfix-2 /etc/postfix-3

/etc/postfix/main.cf will have 1 ip while the above 3 will have rest of teh
ips.

I want to know, once i have configured all the IPs, and when i send email
using the main postfix IP, would the emails be rotated and sent across the 4
ips, sort of load balanced or not.

I am a sendmail guy and sort of trying my hands at postfix , so please help
me out.

I want to send emails via all 4, how do i achieve that. In my application, i
have specified the public IP which is listed in /etc/postfix/main.cf
configuration.

Thanks
Ahsan



--
Sent from: http://postfix.1071664.n5.nabble.com/Postfix-Users-f2.html
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Multiple Instances Load Balance

Viktor Dukhovni


> On May 5, 2018, at 4:43 PM, ahsan2011 <[hidden email]> wrote:
>
> I want to send emails via all 4, how do i achieve that. In my application, i
> have specified the public IP which is listed in /etc/postfix/main.cf
> configuration.

The local address of an outgoing TCP connection is typically chosen
by the operating system based on the routing tables to the destination
and other pertinent settings.  Postfix can preempt this selection by
explicitly setting smtp_bind_address, or by configuring exactly one
address in "inet_interfaces", provided that address is not a loopback
address, in which case that becomes the default source address for
outbound connections.

If your OS will round-robit the IPs then go with that, if not you'll
have to round-robin delivery via across multiple transports, each of
which has a different smtp_bind_address.

Something like:

   http://www.postfix.org/postconf.5.html#sender_dependent_default_transport_maps

   sender_dependent_default_transport_maps = randmap:{smtp1, smtp2, smtp3, smtp4}

Support for randmap tables is new in Postfix 3.0 (not yet mentioned in
http://www.postfix.org/DATABASE_README.html#types )

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Postfix Multiple Instances Load Balance

ahsan2011
Thanks ,

I have run into a different problem, the smtp service is not working for
other instances of postfix.

It is only running on the main instance. Using a nmap,i found that smtp is
stopped for other service.

I have added this in main.cf

inet_interfaces = smtp-2.xyz, xxx.xxx.xxx.xxx(ip address)

in master.cf, this is added

smtp      inet  n       -       n       -       -       smtpd





--
Sent from: http://postfix.1071664.n5.nabble.com/Postfix-Users-f2.html
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Multiple Instances Load Balance

Viktor Dukhovni


> On May 6, 2018, at 2:55 AM, ahsan2011 <[hidden email]> wrote:
>
> I have added this in main.cf
>
> inet_interfaces = smtp-2.xyz, xxx.xxx.xxx.xxx(ip address)
>
> in master.cf, this is added
>
> smtp      inet  n       -       n       -       -       smtpd

No two instances may attempt to use the same IP address.  When using
multiple instances, on many operating systems, no instance may attempt
to use the "wildcard" IP address (inet_interfaces not set).

Do not mix IP addresses and names in inet_interfaces, best use just
IP addresses.

--
        Viktor.