Uffff Major Crash, Re-create slave server

Discussion in 'Installation/Configuration' started by zapyahoo, Aug 8, 2014.

  1. zapyahoo

    zapyahoo New Member

    My webserver/database (multiserver setup) just died :eek: We never think it happens until it does...

    I have the backups of the sites and databases.
    Replaced all faulty hardware, installed ubuntu server 14.04.1 and ispconfig
    Managed to then join the web server into the multi-server setup, and it appears to be an happy slave server of the panel server.

    Now I'm facing a daunting task? All configuration is stored in the panel main server, sites, clients, ftp, databases, etc.

    The resync seems to have worked passing the ispconfig settings... but
    the webserver/database server contains no client databases or sites.

    What do do? Is there a way to force the webserver in a way to recreate all vhost files, sites folders and databases...even if they are empty?

    Till, if you are there... would appreciate your wise words
    Last edited: Aug 8, 2014
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The resync function exists to refresh the config, it cant recreate a whole slave server. But you can copy over the content of the client table from master to slave. If the system is not a morror system, then you can even copy over the whole master database and then run the resync. Thst a bit more data then the slave normally has but it should work as he will ignore all data that does not has its server_id.
  3. zapyahoo

    zapyahoo New Member

    Thanks Till,

    Just to make sure I understand.
    If i copy over the content of the client table from master(panel) to slave(webserver)... the webserver will recreate all user mysql databases, vhost files, sites folders?
  4. zapyahoo

    zapyahoo New Member

    I checked both databases, server and slave. Client table are identical... good thing, they are re syncing.

    The issue is that the slave is missing all vhosts files, client folders and client databases.

    Is there a way to force the master to recreate these in the slave... if they get created successfully with correct permissions... then I have the per client database backups and web files to upload into each one.
  5. zapyahoo

    zapyahoo New Member

    Ok, I finally sorted this out.
    The new slave server had a new db server_id.
    The resyncing was working but not syncing anything the master had no data to sync with this new server_id.
    Corrected the master db and moved all entries from the old server_id to new server_id.
    Voilá... websites and host files created, still sad because the sync did not create the sites databases.

    After the sync the process is:
    In master control panel
    1. delete site databases (re-create them with exact same data... this will force the slave to create the sites databases in mysql)
    2. In each site, restore website files and database.
    3. if sites have certificates, save the certificates. They will get re-generated in the slave server / site and produce no errors.

    Also had a problem that took around 2 hours to fix. The famous 500 error related to FastCGI and Wordpress. Googled a lot, tweaked memory, busytimes etc. to no avail.

    The issue was Xcache. In the ISPCONFIG setup tutorial it was an optional step for webservers... so I installed. Seems to be have an issue with fastcgi.
    After removing xcache, no more wordpress 500 error.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Hmm, thats strange. Maybe a problem with a specific php version or extension? I use xcache on all my servers and there I run also some wordpress blogs and never had a issue yet. I use fastcgi mode as well.
  7. zapyahoo

    zapyahoo New Member

    Can you post your fcgid.conf?
    and xcache settings?
  8. till

    till Super Moderator Staff Member ISPConfig Developer

  9. zapyahoo

    zapyahoo New Member

    ok... but the fcgid.cong is sightly different in new apache version of ubuntu 14.04.1... uses new names
    <IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
    FcgidConnectTimeout 20
    FcgidMaxRequestLen 15728640
    <IfModule mod_mime.c>
    AddHandler fcgid-script .fcgi

    Will take a look later at that tutorial.

    Also related to wordpress websites. The sites connect perfectly to the auto created mysql database with ISPCONFIG database user, and most mysql functions work out of the box.
    But... the websites had a bunch or mysql errors when using some mysql functions in the wordpress plugins php... and the databases were not being successfully updated with those mysql functions.
    mysql_real_escape_string(): Access denied for user 'web28'@'localhost' (using password: NO) in...
    mysql_query(): Access denied for user 'web28'@'localhost' (using password: NO) in...

    Quick fix was to create a mysql user web28 for it's respective db... did you ever come across this?
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The resync function can not create new mysql users, it only updates them. so if no mysql users exist then you can not create them by running resync.
  11. zapyahoo

    zapyahoo New Member

    No, that's not the issue.
    Like I said, correct db and user was created in the slave.
    The website connects fine to the database.

    There are several plugins that when connecting to the database using mysql strings use the web_id, example (web28) instead of the ispconfig created db user.

    These mysql functions just tap into wordpress api... not like they are weird mysql statements. Some statements are passed as the ispconfig database user and others as web_id ... the ones as web_id create errors and are not inserted, updated, etc.

    What is weird is why these try to reach the database as web_id, example:

Share This Page