Reinstalling Backing up Database Failed
-
Hello all and George
I put my fog server on private switch. I want to reinstall fog enabling it’s own dhcp server. But when I do this I get the error that
Backing up database… failed!
Now I am thinking to uninstall fog
https://wiki.fogproject.org/wiki/index.php?title=Uninstall_FOG
Then reinstall. But, would I need to connect to internet? To redownload packages etc? I know once I hit that dhcp switch I will bother the entire lab here.
Ran these commands (database maintenance):
https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL#Database_Maintenance_Commands
But still same error.
AND AND AND
setenforce 0
getenforce is permissivebut an SELinux denial alert keeps coming up
SELinux is preventing /usr/bin/passwd from ioctl access on the file /home/cos/Downloads/fog_1.4.4/bin/error_logs/fog_error_1.4.4.log.
Thanks for the help!
EDIT: SELinux alert updated
-
I think I was doing something wrong.
So I change .fogsettings in /opt/fog to .old_fogsettings
I also assigned my centos server a static ip and subnet.
./installfog.sh
Adding needed repository…ok
Preparing package manager… but it just hangs hereWhat to do?
EDIT: In other words, how do I reinstall FOG server with DHCP on my private LAN w/o internet.
-
@jackiejack said in Reinstalling Backing up Database Failed:
how do I reinstall FOG server with DHCP on my private LAN w/o internet.
FOG more or less requires access to the internet for the installation process. You can hook it up to a network with internet access, run the installer, then take it back to your intranet. if an IP change is necessary when moving it back to the intranet, we can help you with that process.
-
@wayne-workman said in Reinstalling Backing up Database Failed:
FOG more or less requires access to the internet for the installation process. You can hook it up to a network with internet access, run the installer, then take it back to your intranet. if an IP change is necessary when moving it back to the intranet, we can help you with that process.
HOLY CRAP.
Ok, so I will need to take this pc from the lab and bring it home to do the fog install. Come on brothers, in your new versions this must be fixed. I wanted to flick a switch, put on DHCP and image my VMs. Then flip back the switch and put it on my lab.
-
@jackiejack said in Reinstalling Backing up Database Failed:
I wanted to flick a switch, put on DHCP and image my VM
If you have VM infrastructure, just make another fog server in a VM for the purpose of imaging VMs.
If you have the knowledge and infrastructure to mirror linux repositories, you can mirror the ones your fog server needs onto an internal mirror, and configure the fog server to use the internal mirror. This is how offline installations works in the Linux world. There’s nothing wrong with the fog installer. It is the way it is by design.
-
@wayne-workman
I understand what you are saying. BUT! when I doing it stupidly (not renaming old .fogsettings) it went through the entire process with PACKAGED INSTALLED or ALREADY INSTALLED. Now when I change the file name, it hangs. Guess, I will bring it home, install it and carry it back, and take you up on that IP addr change tomorrow. -
@jackiejack said in Reinstalling Backing up Database Failed:
and take you up on that IP addr change tomorrow.
This is how it’s done:
https://wiki.fogproject.org/wiki/index.php?title=Change_FOG_Server_IP_Address
There’s also a FOG utility here that does it too:
https://github.com/FOGProject/fog-community-scripts/tree/master/updateIP -
@wayne-workman said in Reinstalling Backing up Database Failed:
If you have the knowledge and infrastructure to mirror linux repositories, you can mirror the ones your fog server needs onto an internal mirror, and configure the fog server to use the internal mirror. This is how offline installations works in the Linux world. There’s nothing wrong with the fog installer. It is the way it is by design.
You know any good links/yt vids on this topic. Thx.
-
@jackiejack said in Reinstalling Backing up Database Failed:
You know any good links/yt vids on this topic. Thx.
There are so many tutorials on this… Here’s a few:
- https://www.howtoforge.com/tutorial/how-to-create-a-local-red-hat-repository/
- https://linux.die.net/man/1/reposync
- https://access.redhat.com/solutions/9892
- https://linux.die.net/man/8/createrepo
- This one was particularly useful to me: https://deviantengineer.com/2016/03/repo-centos7/
The basic premises of running an RPM/Deb mirror is 1. Copy the files from the internet regularly using the right tool(s). 2. Finagle the files however you need. 3. serve via HTTP 4. Configure your clients to use the mirror.
For Fedora,CentOS, and RHEL, you’ll use the commands
reposync
andcreaterepo
for most of this stuff. For Ubuntu/Debian land, there’s the less than idealapt-mirror
which gets the job done but is really terribly lacking of features.Once mirrored, serve via HTTP, then configure your clients to use that web address.
I’ve done this before several times. What I’m leading you on is home-brewing your own solution. Of course, you could pay 11,000 dollars a year for Red Hat Satellite Server but I really feel like an ounce of scripting skills plus another ounce of CRON with a sprinkle of Apache know-how totally replaces Satellite Server honestly. For Ubuntu, there’s the paid solution called “Landscape” if memory serves. I wrote a replacement for that one too. Though I can’t share any of that work because it was for my last employer and they own the intellectual property. All I can do is show you the way.
-
@wayne-workman Show and I will follow - one step at a time. I really do appreciate the guidance.
Now I have reinstalled my fog server at home. It has an ip of 192.168.1.39
- Setting up and starting DHCP Server…!!! No router address found !!!
!!! No dns address found !!!
So I am thinking that tomorrow when I go into the lab, I set my fog server to static 192.168.1.39
On my private lan there is no router (apparently you cannot pxe boot through a home cisco router)
And my virtual machine with bridged adapter would get ip from fog. VM pxe boot. And fog would take care of the rest? -
@jackiejack I have been only loosely following this thread so if this response is crazy then please ignore.
If you setup fog in your home lab, you can use your home router and not use/need isc-dhcp running on your fog server. If you have a dhcp server in your imaging network then you don’t need to use isc-dhcp in your work network either.
In the case of your home network, most home internet routers/firewalls have a dhcp server built in. But most home routers don’t support pxe booting. BUT, you can install a service on your fog server to supply the missing pxe booting information without needing to modify anything on your dhcp server. This service (dnsmasq) will work the easiest if the fog server and pxe booting client are on the same subnet.
The reason that FOG needs internet access to install it all for FOG itself. FOG does download precompiled binary files, but also the linux distribution needs to reach out to the distribution’s repository to download needed packages. So at least when fog is installed internet access is required or you would have to download and install by hand all required packages. I can tell you that is not a fun time. If you fog server does not have direct internet access, but can have access via a proxy server fog can be installed that way too.
One final thought, FOG doesn’t like it when you change the FOG server’s IP address after FOG is installed. The issues can be fixed, just realize you will need to go in and change a few settings in the webgui and a few config files. Normally we would just have you rerun the fog installer to fix the missing bits, but that won’t work on your isolated network.
-
@george1421 I think I want to try that dnsmasq thing tomorrow. You have any tutorials. Or should I just download it?
I would be happy if I can use my home router and then disable dnsmasq when I am ready to put it back on the lab network. My supervisor said once I deploy a syspreped fog service image, we will consider um isolating the lab network, add our own dhcp server, multicast the images and come next morning with hook back up everything as it was. Sneaky, but beats hopping from computer to computer with FOS usb stick
-
@jackiejack For dnsmasq, you just need to install your linux distributions package. Just ensure that it is 2.76 or newer. Most distributions have that version now. That is the first version to support both uefi and bios (legacy) booting dynamically.
Then ensure no other .conf files are in /etc/dnsmasq.d directory. Then create a new config file called ltsp.conf (it can be anything as long as it ends in .conf, but keep the standard). In that /etc/dnsmasq.d/ltsp.conf file add the following configuration:
# Don't function as a DNS server: port=0 # Log lots of extra information about DHCP transactions. log-dhcp # Set the root directory for files available via FTP. tftp-root=/tftpboot # The boot filename, Server name, Server Ip Address dhcp-boot=undionly.kpxe,,<fog_server_IP> # Disable re-use of the DHCP servername and filename fields as extra # option space. That's to avoid confusing some old or broken DHCP clients. dhcp-no-override # inspect the vendor class string and match the text to set the tag dhcp-vendorclass=BIOS,PXEClient:Arch:00000 dhcp-vendorclass=UEFI32,PXEClient:Arch:00006 dhcp-vendorclass=UEFI,PXEClient:Arch:00007 dhcp-vendorclass=UEFI64,PXEClient:Arch:00009 # Set the boot file name based on the matching tag from the vendor class (above) dhcp-boot=net:UEFI32,i386-efi/ipxe.efi,,<fog_server_IP> dhcp-boot=net:UEFI,ipxe.efi,,<fog_server_IP> dhcp-boot=net:UEFI64,ipxe.efi,,<fog_server_IP> # PXE menu. The first part is the text displayed to the user. The second is the timeout, in seconds. pxe-prompt="Booting FOG Client", 1 # The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86, # Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI and X86-64_EFI # This option is first and will be the default if there is no input from the user. pxe-service=X86PC, "Boot to FOG", undionly.kpxe pxe-service=X86-64_EFI, "Boot to FOG UEFI", ipxe.efi pxe-service=BC_EFI, "Boot to FOG UEFI PXE-BC", ipxe.efi dhcp-range=<fog_server_ip>,proxy
ref: https://forums.fogproject.org/topic/8725/compiling-dnsmasq-2-76-if-you-need-uefi-support/5
Replacing <fog_server_ip> with the IP address of your fog server.
Then issue asudo systemctl enable dnsmasq
and thensudo systemctl restart dnsmasq
to start the service.To see if dnsmasq is running and listening issue the following command
netstat -an | grep 67
That should show if the dnsmasq service is listening on udp port 67 -
@george1421
Is this how it supposed to be? I don’t see “dnsmasq” -
-
@jackiejack While I can’t say for absolute, as long as you don’t have ics-dhcp, udp port 67 listening indicates you have a dhcp server running on that server. I know that was not real conclusive, its just because I don’t know what you installed previously.
You can run the following command to see if the dnsmasq process is running in memory.
sudo ps aux|grep dnsmasq
You should see the dnsmasq command with its command line switches.You can also run the following command and query systemd
sudo systemctl status dnsmasq
-
-
@jackiejack from your second picture dnsmasq / what ever is working because the next server and boot file name is making to the client computer. what it looks like is its timing out trying to download the file. Is 192.168.1.39 the current IP address of your fog server?
-
@george1421 Yes, static
-
@jackiejack Then can you do this.
sudo netstat -an|grep 69
this will see if the tftp server is running.ls -la /tftpboot/undi*
to see if you have the boot files in the right spot