Sharing DB files over multiple postfix servers (RPC/NFS)

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

Sharing DB files over multiple postfix servers (RPC/NFS)

Srikrishnan Chitoor
Hi:

  We want to share the DB files for various static maps like domain maps, recipient maps over multiple postfix servers.

  This is so that the DB files can be updated easily, and at fewer places than at each of the postfix mail servers. We are not comfortable using MySQL or any other database due to performance issues.

  We are planning to use Berkeley DB 4.2 for the same.

  On further research, I see the following options:

  1. Put DB files in a server and share them READ ONLY using NFS.

     The questions I have are:

     A. Is this safe?
     B. Will there be any locking issues.
     C. Will postfix have any problems if the files or the directories
        in which the files are there are read only (as the NFS
        share will be mounted read only)
     D. If the source file changes, will Postfix automatically re-read
       the new file?

  2. Use Berkeley DB over RPC:

     Berkeley DB has a way to expose its DB over RPC.
     We have taken a look at the Berkeley DB code in postfix
     and it seems reasonably simple to modify the db_open
     calls to make it call DB files over RPC.

     However, one problem we foresee is locking. Since the
     RPC Server takes care of locking and simultaneous access,
     postfix should not do any locking when performing
     these operations.

     We have taken a look at the locking code and it
     seems complex. Is there any easy
     way to make postfix NOT do any locking when
     looking at db files (since anyway they will be RPC calls)?

  We have searched in all mailing list and could not find any specific solutions and hence this question.

  Thanks in advance for your help,
Reply | Threaded
Open this post in threaded view
|

Re: Sharing DB files over multiple postfix servers (RPC/NFS)

mouss-2
Srikrishnan Chitoor wrote:
> Hi:
>
>   We want to share the DB files for various static maps like domain maps, recipient maps over multiple postfix servers.
>
>   This is so that the DB files can be updated easily,

you can use rsync. this way, the files are available on place, instead
of via the network. just add rsync to a Makefile or script that manages
your maps.


> and at fewer places than at each of the postfix mail servers. We are not comfortable using MySQL or any other database due to performance issues.
>  

premature optimisation?

>   We are planning to use Berkeley DB 4.2 for the same.
>
>   On further research, I see the following options:
>
>   1. Put DB files in a server and share them READ ONLY using NFS.
>
>      The questions I have are:
>
>      A. Is this safe?
>      B. Will there be any locking issues.
>      C. Will postfix have any problems if the files or the directories
>         in which the files are there are read only (as the NFS
>         share will be mounted read only)
>      D. If the source file changes, will Postfix automatically re-read
>        the new file?
>
>   2. Use Berkeley DB over RPC:
>
>      Berkeley DB has a way to expose its DB over RPC.
>      We have taken a look at the Berkeley DB code in postfix
>      and it seems reasonably simple to modify the db_open
>      calls to make it call DB files over RPC.
>
>      However, one problem we foresee is locking. Since the
>      RPC Server takes care of locking and simultaneous access,
>      postfix should not do any locking when performing
>      these operations.
>
>      We have taken a look at the locking code and it
>      seems complex. Is there any easy
>      way to make postfix NOT do any locking when
>      looking at db files (since anyway they will be RPC calls)?
>
>   We have searched in all mailing list and could not find any specific solutions and hence this question.
>
>   Thanks in advance for your help,
>  

Reply | Threaded
Open this post in threaded view
|

Re: Sharing DB files over multiple postfix servers (RPC/NFS)

Victor Duchovni
On Sat, May 17, 2008 at 10:27:55AM +0200, mouss wrote:

> Srikrishnan Chitoor wrote:
> >Hi:
> >
> >  We want to share the DB files for various static maps like domain maps,
> >  recipient maps over multiple postfix servers.
> >
> >  This is so that the DB files can be updated easily,
>
> you can use rsync. this way, the files are available on place, instead
> of via the network. just add rsync to a Makefile or script that manages
> your maps.

What's wrong with pushing the source files and running "make"?

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: Sharing DB files over multiple postfix servers (RPC/NFS)

mouss-2
Victor Duchovni wrote:

> On Sat, May 17, 2008 at 10:27:55AM +0200, mouss wrote:
>
>  
>> Srikrishnan Chitoor wrote:
>>    
>>> Hi:
>>>
>>>  We want to share the DB files for various static maps like domain maps,
>>>  recipient maps over multiple postfix servers.
>>>
>>>  This is so that the DB files can be updated easily,
>>>      
>> you can use rsync. this way, the files are available on place, instead
>> of via the network. just add rsync to a Makefile or script that manages
>> your maps.
>>    
>
> What's wrong with pushing the source files and running "make"?
>
>  

that's what I meant by using rsync. but you're right, postmap should be
called on its machine to avoid problems due to incompatible db versions
or hardware.