[Fresh new installation] Your database connection appears to be invalid
-
This post is deleted! -
@george1421 Exactly - if I reinstall FOG, then the web GUI starts working fine, until another system reboot.
Question (since I am already at home and I do not have working VPN setted up to try this) - if I do understand well enough, these commands are needed to enter after every reboot? Under assumption that this WILL work; can I just write these as part of startup script, which was mentioned in wiki ( https://wiki.fogproject.org/wiki/index.php?title=CentOS_7 - bottom of the page)?Thank you.
-
@HaRD Well these commands tell centos/rhel to start the web server on every reboot. That is the enable command.
This command tells centos to set the http server to auto start.
systemctl enable httpd
and this command tells centos to restart the service now.
systemctl restart httpd
this command tells centos to stop the http start now.
systemctl start httpd
This command tells centos to stop the http service
systemctl stop httpd
-
@george1421 Ohh, that is nice. Sorry for the lame-ish question I will give it a try and then report back - hopefully with my problem solved.
Thank you and good night!
-
@HaRD Just be aware that it may not be the http (web server) that’s at fault, it may be instead the database server. In that case you would want to do a
systemctl enable mysql
andsystemctl start mysql
-
@george1421 We’ll see. If it won’t work, then we can try something else. In any case, I will give a feedback; and either my problem will be succesfully solved, or not - and in that case I will humbly ask for another solution.
-
@HaRD said in [Fresh new installation] Your database connection appears to be invalid:
when OS boots up, web management does not work anymore and I get the “Your database connection appears to be invalid”
That means apache is running fine because this message is delivered through the web interface.
First thing to try is to restart mysql with
systemctl restart mysql
see if that fixes it. If so, you have a timing issue. All you need to do is delay mysql’s startup by maybe 30 seconds. There’s a writeup on how to do that in CentOS 7 for other services here, just put mysql into the list. https://wiki.fogproject.org/wiki/index.php?title=CentOS_7#Post_Config_.28Optional.29 -
@Wayne-Workman Thank you for your reply; I just got to work and tried your advice as first step - an seems like you were right. After typing command for MySQL restart, web GUI works.
Which means that I’ve done something wrong with that startup delay script you mentioned (I’ve said in the first post, that I’ve followed wiki instructions - including Post Config).
I tried to follow those instructions again, doing this:
I log in, open terminal, and then type this:
sudo su <type in root pwd>
Then I copy/paste from wiki these commands:
systemctl disable FOG{MulticastManager,Scheduler,SnapinReplicator,ImageReplicator} systemctl disable nfs-server systemctl disable rpcbind
I already have created script, which is mentioned in wiki, so I don’t bother with re-creating it anew and then I just put in:
chmod +x /etc/rc.d/rc.local
Then I close the terminal and reboot the system. And now system is stuck at booting with this (seems like script wasn’t running at all previously):
So, what went wrong this time?
-
@HaRD The steps to delay those services don’t include mysql, you would just add it into those steps.
Read what the lines say. First one disables FOGMulticastManager, FOGSheduler, FOGSnapinReplicator, and FOGImageReplicator. The next line disables nfs-server, next one disables rpcbind. You just need to add mysql to the list.
Same goes for /etc/rc.d/rc.local Just modify it to start mysql after 30 seconds too.
Also, this would be the first time I’ve ever heard of a timing issue with MySQL on CentOS 7.
-
@Wayne-Workman I would say I never heard of a timing issue for mysql (mariadb) with centos. My fog server is running on centos 7.3 as a VM and I didn’t have to do any of this delay start stuff (unless the installer is doing it behind the scenes).
-
@george1421 Right. Generally CentOS 7 has been rock solid. The installer does no such delay-magic. The delay stuff is only needed when services fail to start on boot.
-
Thank you guys, it seems like you kicked me in to the right direction. I remade whole server to be sure, reinstalled FOG using wiki guide and as far as the startup script go, I just needed to write this:
#!/bin/bash sleep 30 touch /var/lock/subsys/local systemctl start mysql exit 0
I was just dumb enough to not realize, that you need to write this script only in case, when something does not work. Well, sorry about that
Now everything seems to run fine - I don’t need to do a damn thing even after a reboot. Nice!
As to why I needed to do these timing stuff in the first place - since you all claim that CentOS is otherwise rockstable - I seriously don’t know myself. If you want to look into it, I don’t mind to cooperate with you guys.
Thank you guys!