Understanding ispconfig inside-out

Discussion in 'Developers' Forum' started by ispcomm, Nov 2, 2013.

  1. ispcomm

    ispcomm Member


    I'm looking for more information on how ispconfig works internally, specially regarding multiserver setup.

    I'm looking for things to check when things go wrong, like:
    What data is replicated to which servers?
    How are servers kept in sync?
    What process is responsible for checking integrity of the databases ?
    How do I make sure that a mirror server is up to date with it's master?

    So far I see that manual changes to the database on the master server can be propagated using the web interface (tools->sync).

    What I'm looking for really, is not how to add a feature to the web interface, but how to make sure a cluster managed by ispconfig is performing properly and that there are no issues affecting the customers.

    thank you
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not manipulate the database conetnt with "normal" mysql functions, use the datalogInsert(....), datalogUpdate(...) and datalogSelete(...) functions from the ispconfig database class instead. These fnctions will change the data in the database and create correct configuration transactions in the sys_datalog table for them. Chnges that were made without these function sill be ignored by the slave server and even the local srver part.
  3. ispcomm

    ispcomm Member


    I did some direct-mysql updates on the master server, as it's 'easy', and then used resync to propagate changes to the cluster.

    I found a little issue with mailboxes sync: The mail_relay_recipient table is not propagated to a mirror of a mail server.

    That is:
    I have S1 set as mailserver (different to the one hosting the panel).
    I have S2 set as a mirror of S1
    I inserted some relay rules in the database directly. Also inserted some rules with the web interface.
    I also issued a resync.
    Result was:
    S1 had a full set of rules.
    S2 only had the rules I inserted trough the web interface.
    I guess ther resync does not update the mirror at all.

    Hope that helps.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Its easy but wrong. The correct way is to use the datlog functions.

    The rsync tool if for mailboxes only (see checkboxes in the tool, each chackbox stands for a corresponding function / table). The mail_relay_recipient is not part of the resync tool. If you would have used the correct datalogInsert / update functions, your changes would have been propageted to the slave correctly.
  5. ispcomm

    ispcomm Member


    i am not sure that all the replication working. I am encountering replication issues on the mail servers, using the remote api.

    The setup is the same, I use two mailservers. S1 and S2, where S2 is a mirror of S1, configured in ispconfig.

    I am using the soap api to add mail forwards to S1, using the following call:

    soap api: mail_forward_add

    params is as follows:
    server_id => id of server S1,
    source => source_address,
    destination => one or more destination, separated by "\n",
    type = "forward"
    active = "y"

    What happens is that not all forwards are created on the S2 server.

    Do you think that this is an issue of my install ?

    What happens when I add a slave after some data has been inserted in the mail_relay or other mail tables, which are not mailboxes? Will the data from the master be propagated or not?

    I'm asking because I plan to add a third slave to the mailserver (2 server is not enough)....
    Last edited: Nov 5, 2013
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    If server 1 and 2 are mirrored, then all changes are replicated to both servers when you use server_id = 1 in the api. If the replication does not work correctly on one server, turn on debugging in ispconfig, disable the server.sh cronjob and run it manually.

Share This Page