Move primary DNS and SQL

Discussion in 'ISPConfig 3 Priority Support' started by muekno, Oct 6, 2016.

  1. muekno

    muekno Active Member HowtoForge Supporter

    I have a multiserver setup, separate admin server for ISP Config, separate pri DNS, sec DNS, WEB, MAIL, SQL server. A I would give up the pri DNS (as it ist still openSuSE 13.2 all others execept sql are Debian jessie) I would add the priDNS to the Admin Server. Have installed bind9 and bindutils.
    What to do next?
    Second, how to best move the sql to an new installed jessie?
    Servers are Version: 3.0.5.4p9, would have all server on Debian before going to 3.1.x
    Thanks for help, it is a production system, so I will not risk downtime with experiments and I am not shure if openSuSE is still supported in ISPConfig 3.1

    Rainer
     
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    You can change the server_id in the master-database in dns_soa and dns_rr for the dns-zones you want to transfer to your new server and resync the dns-zones. If you have different public IPs for both servers, don't forget to update the A-Record(s) for the NS-Servers.
    For databases it's quite similar: change the server_id in web_database (and maybe for teh db-users) and resync the databases. Afterwards import a dump from the old server into the new server (you should import dbispconfig and mysql).
     
  3. muekno

    muekno Active Member HowtoForge Supporter

    Thank you, but
    did change server id in dbispconfig on master server in dns_soa and dns_rr for all entries, add sql service in system on new DNS server. in tools I did a resync for DNS, Monitor Job queue schows 8 pages of DNS updates but will not empty or change since more then 20 Minutes
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Either the server id is wrong or the new slave can not connect to the master. use the debug mode to find out what's wrong.
     
  5. muekno

    muekno Active Member HowtoForge Supporter

    The new DNS is the master itself so it should be able to connect, iD is correct, pleas give me a hint to enter debug mode

    If I go to the DNS Tab, I see all zones under the admin server, all RR seems to exist, I think this comes from from changeing the database.
    Restarte Bind9 on master server, got
    root@admin:/etc# service bind9 status
    ● bind9.service - BIND Domain Name Server
    Loaded: loaded (/lib/systemd/system/bind9.service; enabled)
    Drop-In: /run/systemd/generator/bind9.service.d
    └─50-insserv.conf-$named.conf
    Active: active (running) since Fri 2016-10-07 09:40:04 CEST; 3s ago
    Docs: man:named(8)
    Process: 3963 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS)
    Main PID: 3972 (named)
    CGroup: /system.slice/bind9.service
    └─3972 /usr/sbin/named -f -u bind

    Oct 07 09:40:04 admin named[3972]: command channel listening on 127.0.0.1#953
    Oct 07 09:40:04 admin named[3972]: couldn't add command channel ::1#953: address not available
    Oct 07 09:40:04 admin named[3972]: managed-keys-zone: journal file is out of date: removing journal file
    Oct 07 09:40:04 admin named[3972]: managed-keys-zone: loaded serial 2
    Oct 07 09:40:04 admin named[3972]: zone 0.in-addr.arpa/IN: loaded serial 1
    Oct 07 09:40:04 admin named[3972]: zone 127.in-addr.arpa/IN: loaded serial 1
    Oct 07 09:40:04 admin named[3972]: zone localhost/IN: loaded serial 2
    Oct 07 09:40:04 admin named[3972]: zone 255.in-addr.arpa/IN: loaded serial 1
    Oct 07 09:40:04 admin named[3972]: all zones loaded
    Oct 07 09:40:04 admin named[3972]: running
    root@admin:/etc#

    I Think ist should not only listen on local host. While netstat -tulpn say it listen on ip address too.
    Job queue still no change
     
    Last edited: Oct 7, 2016
  6. till

    till Super Moderator Staff Member ISPConfig Developer

  7. muekno

    muekno Active Member HowtoForge Supporter

    got
    PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'ispconfig'@'localhost' (using password: YES) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 62
    DB::__construct Access denied for user 'ispconfig'@'localhost' (using password: YES)
    PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'ispconfig'@'localhost' (using password: YES) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    looking at mysql.user user ispconfig@localhost hast the same priviledges, that means N like the ispcsrvx@ipaddress and ispcsrv@hostname but prividedges for root@... at all servers has all set to Y.
    Do not know if thats OK so, but system is runing since some years and fine, all changes worked, no errors no problem.
    As of page 31 of the new manual (page 27 of the old manual) only root got priviledges
    Whats going wrong?

    Rainer
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    That's ok, the priveliges are set in the other tables. Check out the other tables in the mysql.mysql database or use the phpmyadmin user editor to see them.

    Back to the original problem. Open the file /usr/local/ispconfig/server/lib/config.inc.php, in this file you can see the cleartext passwords for the ispconfig mysql user and the ispcsrv* mysql user. use these cleartext passwords to set the password again with phpmyadmin for the ispconfig user on the local server and for this ispcsrv* user on the master server.
     
  9. muekno

    muekno Active Member HowtoForge Supporter

    How to encrypt the password mysql can do that, but what to selcet sha1, encrypt, md5 des ....
    As i'am move from slave to master I think to change password on ispcsrv* ist not necessary
    The old priDNS will be deleted afterwards
    Rainer
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Select "password" as encryption method.
     
    muekno likes this.
  11. muekno

    muekno Active Member HowtoForge Supporter

    Still the same error as above, on the master server, no errors on the slave.
    "DB::__construct Access denied for user 'ispconfig'@'localhost' (using password: YES)
    PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'ispconfig'@'localhost' (using password: YES) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    "

    To clarify. I have no new slave server, I want to have the master server (named admin.domain.tld) as DNS Server. So I changed server_id to 1 (took from the ispconfig.server table) in dns_rr and dns_soa. So in ISPConfig I cant see the the admin server in the server row for alll DNS entries, but nothing ist written to named.conf or other bind conf files
    In /usr/local/ispconfig/server/lib/config.inc.php the are two passwords I tried both, but think only the first is relevant.

    I also not understand why I had to set the password new, as before all worked fine, unfortunatly I dis not server the original hash.
    On the other site, I added a new website, that worked fine, so I think master server could write to master db and slave (other than the old name server) could read master db.

    I assume the problem is reading the new DNS settings from the master db to create the new DNS files on the master.

    Thanks for any further help

    Rainer

    I would be glad if I cound be rid of the last Suse servers, to be able do upgrade to ISPConfig 3.1 to use the new functions i.e. DNSsec and DKIM

    mk
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Your server will not work until the ispconfig user is able to access its database, so thats not an ispconfig issue at the moment, its a mysql problem and you have to check that in mysql. You can find the cleartext password of the ispconfig mysql user in the file /usr/local/ispconfig/server/lib/config.inc.php. Login tp phpmyadmin on this slave server, go to the phpmadmin user editor, enter the cleartext password of the ispconfig user and press save. then try again to run the ispconfig debug mode to see if ispconfig is now able to connect to its database.

    No, thats not the problem, your ispconfig is not able to connect to its local ispconfig database on localhost. There might be additional problems to connct to the master, but this can neither be checked nor solved before ispconfig can connect to its local db.
     
  13. muekno

    muekno Active Member HowtoForge Supporter

    Thank you for sunday help
    Aft some trials setting different passwords and login to mysql from command line as ispconfig I found out I had to restart mysql after setting the password with phpmyadmin, very strange. Command line login works fine now with password from /usr/local/ispconfig/server/lib/config.inc.php
    But now there is an other problem, I can not login to ISPConfig as admin (the one and only user with all rights) resend password does not work, http://www.faqforge.com/linux/contr...et-the-administrator-password-in-ispconfig-3/ dos not work, cant not find talbe sys_user in dbispconfig, even not in running ISPConfig 3.1 system.

    Rainer
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    There must be such a table. New PHPMyAdmin versions don't show all tables in the left menu, this can be sometimes confusing, check the menu in PHPMyAdmin in detail, you will see that you can switch to a second page and there the remaining tables incl. sys_user are listed.
     
    muekno likes this.
  15. muekno

    muekno Active Member HowtoForge Supporter

    Thank you, yes realy confusing, as the is still place show databases.
    Changes password in phpmyadmin slected md5, restarted mysql, can not login. other passords start with $1$, my newone set does not.
    What do i risk or win if I update only master server to ISPConfig 3.1. the update does a backup.
    remember most servers a jessie latest patches 2 are still suse 13.2 latest patches
     
    Last edited: Oct 9, 2016
  16. muekno

    muekno Active Member HowtoForge Supporter

    I risked the update, ISPConfig runs fine now, can login as usual. I did not update the certificate, as I have official certificates from StartCom SSL. But my browser Chrom tells me certificate not valid, the same as on my test server. My SSL websites (StartCom SSL certificates too) are recognized well.
    The IND files on the Master still not exists, a new resync filled the queue and it was empty after some seconds, but the BIND files did not change. Fortunatly the priDNS server still works.

    Rainer
     
    Last edited: Oct 9, 2016
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    All servers in a multiserver setup have to run the same ispconfig version, so if you updated the master, then the slaves need to be updated as well. Use the debug mode (Link in Post #6) to see why the slave does not work.

    If you need help by remote login, then contact Florian from schaal @it here: http://www.ispconfig.org/get-support/?type=ispconfig
     
  18. muekno

    muekno Active Member HowtoForge Supporter

    OK updated all other servers, went ok so long. But both SuSE 13.2 (latest patches) server hat the same error while updateting
    Checking ISPConfig database .. OK
    PHP Fatal error: Call to undefined function mb_detect_encoding() in /tmp/ispconfig3_install/install/lib/mysql.lib.php on line 445

    http://www.ispconfig.org/blog/ispconfig-3-1-released/ says SuSE 13.2 is supported

    What to do now
    Rainer
     
  19. florian030

    florian030 Well-Known Member HowtoForge Supporter

    yast -i php-mbstring
     
    muekno likes this.
  20. muekno

    muekno Active Member HowtoForge Supporter

    Thank you florian030, it works
    Rainer

    P.S. Restarted Update on both SuSE, selected Backup no.
    Updates went through without errors
    In Monitor one showed version 3.1 after some seconds, the other still shows still 3.0.4.p9 even after reboot. Moitor shows all green, no errors
    Thats the one I will delete as it is priDNS, but can not be deleted until the DNS on the Master server works, on the master server there are still Bind files, service bind9 is running, but without my domains.
     
    Last edited: Oct 10, 2016

Share This Page