1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Remove Central DNS?

Discussion in 'Plesk Expand 2.3 Troubleshooting Issues' started by ronan675, Feb 15, 2009.

  1. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Hi,

    I am trying to remove a Central DNS server from our expand system as PBAS now handles all our DNS queries. However I am unable to remove it via the interface. I have de-assigned all plesk servers from the DNS server but when I attempt to remove the Central DNS server I get the following error.

    <errcode>4000</errcode>
    <errtext>Cannot delete or update a parent row: a foreign key constraint fails (`expand/cdns_recursion_instance`, CONSTRAINT `cdns_recursion_instance_ibfk_3` FOREIGN KEY (`dns_server_id`) REFERENCES `dns_serve. Error query: DELETE FROM dns_server WHERE id = 1</errtext>

    Also our expand server is under very heavy load from Mysql since de-assigning plesk servers from CDNS. Many queries running relating to cdns.

    Appreciate any advice you may have on resolving this issue.
     
  2. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Still have had no luck resolving this issue. Any ideas?
     
  3. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    You can delete obstructive row by command
    Code:
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_recursion_instance where dns_server_id=1'
    
    then try to remove Central DNS server #1.
     
  4. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Thanks for the idea but it does not seem to have worked. After running the command on the expand server I still get the same error when trying to remove CDNS. Any other ideas? I have had to disable expand as it was taking down our management server with the excessive load. Still same error.
     
  5. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    Please post the last error.
     
  6. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Hi Gold,

    I still recieve the same error as far as I can tell. It is as follows.

     
  7. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    Ok. This is another error `expand/cdns_recursion_instance` -> `expand/cdns_zone_instance` :)

    Please run command
    Code:
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_zone_instance where dns_server_id=1'
    
    then try to remove Central DNS server #1.
     
  8. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Still having a problem with this. I am not able to sucessfully run the command above.

    I get the following error

     
  9. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    Ok.

    Code:
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_activity_log_repository where cdns_activity_log_repository.cdns_attempt_id in (select cdns_attempt.id from cdns_zone_instance inner join cdns_attempt on cdns_attempt.cdns_zone_instance_id=cdns_zone_instance.id where dns_server_id=1)'
    
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_attempt where cdns_attempt.cdns_zone_instance_id in (select cdns_zone_instance.id from cdns_zone_instance where dns_server_id=1)'
    
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_zone_instance where dns_server_id=1'
    
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_recursion_instance where dns_server_id=1'
    
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_ace_instance where dns_server_id=1'
    
     
  10. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    I am not able to successfully run the second command.

    Code:
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_attempt where cdns_attempt.cdns_zone_instance_id in (select cdns_zone_instance.id from cdns_zone_instance where dns_server_id=1)'
    It just seems to stay running forever. If I check to see what Mysql is doing it seems to be just stuck in a "preparing" state.

    Code:
    mysql> SHOW processlist;
    +----+--------+-----------+--------+---------+-------+-----------+------------------------------------------------------------------------------------------------------+
    | Id | User   | Host      | db     | Command | Time  | State     | Info                                                                                                 |
    +----+--------+-----------+--------+---------+-------+-----------+------------------------------------------------------------------------------------------------------+
    |  2 | expand | localhost | expand | Sleep   |    13 |           | NULL                                                                                                 | 
    |  3 | expand | localhost | expand | Query   | 11748 | preparing | delete from cdns_attempt where cdns_attempt.cdns_zone_instance_id in (select cdns_zone_instance.id f | 
    | 24 | expand | localhost | NULL   | Query   |     0 | NULL      | SHOW processlist                                                                                     | 
    +----+--------+-----------+--------+---------+-------+-----------+------------------------------------------------------------------------------------------------------+
    3 rows in set (0.00 sec)
    Appreciate any other ideas you might have as this issue is getting a bit annoying. :)
     
  11. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    There are no another ways. You can try to stop Expand then run queries then start Expand.
     
  12. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Hmmm I think the problem here is the cdns_attempt table is too large. It has 100 million rows(13GB) and I don't seem to be able to get it to delete.
     
  13. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    To clean cdns_attempt table you need
    1. Stop Expand
    Code:
    /etc/init.d/expand stop
    
    2. Delete all records from cdns_attempt and cdns_activity_log_repository tables
    Code:
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_activity_log_repository'
    /usr/local/expand/sbin/expandmysql -e 'delete from cdns_attempt'
    
    3. Back up Expand by '/usr/local/expand/sbin/exp-backup' command
    4. Restore Expand by '/usr/local/expand/sbin/exp-restore' command
     
  14. ronan675

    ronan675 New Pleskian

    22
    57%
    Joined:
    Mar 12, 2002
    Messages:
    11
    Likes Received:
    0
    Thanks for all your help gold but still having no luck. Seems it's not possible to fix. I have had the delete cdns_attempt command running for the past day and it's still running but I don't know if it's doing anything.
     
Loading...