Sync issues between 4 servers.

Discussion in 'ISPConfig 3 Priority Support' started by Tekati, Jan 14, 2015.

  1. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    I am having major synchronization issues between

    WWW - Main server and www server
    MAIL - Mail server
    DNS1 DNS Primary
    DNS2 DNS Secondary

    Basically I have managed to fubar some stuff up. I am looking for a remote tech specialist for ISPConfig3 that can straighten my setup out. I would really prefer Till to do this but if there is someone else that is highly active on the forums that I can research and insure they are experts then I would consider them as well.

    I do not have time to learn the ins and outs of ISPConfig3. I have monkeyed around with it for long enough and still do not understand how synchronization works.

    If I do a /usr/local/ispconfig/server/ on the mail server I get a "finished
    . prompt but synchronization is not working. Somehow I have two servers one with ID 2 and the other with ID 5 for mail and it seems to be mixed up.
  2. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    Either that or a detailed explanation on replication works?
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    There cant be more then one server with the same ID in a ispconfig multiserver setup. When you add a new server, the server always gets a new and unique ID. Did you alter anything in the databases manually?

    When the ID's are not unique, then the synchronisation must stop as the servers dont knw anymore which server has already synced which information.

    Can you tell me how you got the duplicate server ID's and where they are dupliacte (in the server tabe on the amster or do you have multiple servers where you assigned the same ID's in the files)?
  4. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    To be perfectly honest I do not know. We had major email server issues at one point bad hard drive stuff. I am pretty sure I created a new server to replicate to at that time and that is most likely how that got in there. I have not modified anything in the database directly.

    Can you tell me what tables effect replication and what I should look for? Are there pointers that need to be reset etc? I am pretty sure I got all the server id stuff straightened out.
  5. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    Or a way to just reset it all?
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The config changes are in the sys_datalog table of the master server. The slave connects to the master by sql, it then requests all records from sys_datalog where the server_id = his own server id (see file) or where server_id = 0 which means the change is of interest for all slaves and the sys_datalog ID > the value of the updated colum in the server table. When the slave has processed a change record, then it sets the updated column in server table to the datalog_id that it just finished processing, so even if it gets interrupted, it will not process the same datalog record again.
  7. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    The mail server should be server_id 2
    When I go through and make sure everything is setup that way then do a ispconfig_update it sets all the postfix files back to server_id 5. Can you tell me where it gets that from so I can set that too?
  8. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    Ok so I found that and fix it and now that works fine. Had to change the server_id in both ispconfig/interfaces and ispconfig/server and that solved that. But still not syncing.

    SELECT server_id, updated FROM server;
    | server_id | updated |
    | 1 | 4586 |
    | 2 | 4576 |
    | 3 | 4380 |
    | 4 | 4576 |
    4 rows in set (0.00 sec)

    SELECT server_id, datalog_id FROM sys_datalog;
    | 0 | 4576 |
    | 2 | 4584 |
    | 2 | 4585 |
    | 1 | 4586 |
    | 2 | 4588 |

    As you can see there are a couple of updates ready for SERVER 2 but they are not working.
  9. Tekati

    Tekati ISPConfig Developer ISPConfig Developer

    Maybe I am approaching this wrong.

    Can you tell me does the database replicate to the other servers then the remote servers process the tables? Or does the master database contain the record and the remote servers pull it and update their tables when they process the commands?

    Is there a flow chart on how things are processed with ISPCOnfig?

    Can I simply export the database from the master server and replicate that on the remote server manually? Basically do a mysqldump with dropping tables and data on the master and mysql import that to the remote server?
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The database does and shall not replicateitself (ny mysql replication). ISPConfig is replicating and inserting the record in the slave database on its own. The steps that ispconfig takes are:

    e.g. for server_id 2:

    1) Get the value from "updated" column of server table from master database

    in master: select updated from server where server_id = 2

    2) get all new record that are for server_id 2:

    master: select * from sys_datalog where server_id = 2 or server_id = 0

    3) Insert the records that the slave got from 2) in the slave database and process the changes:
    slave: REPLACE INTO .........

    Thats possible, but: the database contains more data then it should be in that case as it contians records for all slaves and not just this slave and ispconfig will not ptocess (write config) for any of the records that you inserted manually as the system assumes that the config for all records that are in the slave database is already processed.

Share This Page