Ad Widget

Collapse

my Mariadb died over the weekend (Need assistance) :(

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ftb3
    Junior Member
    • Sep 2024
    • 8

    #1

    my Mariadb died over the weekend (Need assistance) :(

    Let me explain with a quick history:
    25 year Windows admin with just enough linux exp to be completely destructive
    I got laid off on june, and new job in Aug, asked to start setting up network monitoring in zabbix (had never heard of zabbix until august of this year and until then, only rebooted, df -h, grep'd a few thing for linux experience)

    fast forward, i have a 4 page dash board monitoring 190 devices, both physical and virtual in 4 cities
    my problem? I didn't account for database growth and put my frontend, backend, and db all on one debian box with a 100 GB hdd.

    Today i'm getting the zabbix login error : Database error : no such file or directory
    which lead me to: mariadbd: Error writing file './ddl_recovery.log' (Errcode: 28 "No space left>

    which lead me to not knowing how to expand the virtual disk of linux server, reading on how to do that, had me figure out that i do not have fdisk installed: and i can't install it because : E: You don't have enough free space in /var/cache/apt/archives/.
    basically my /dev/sda1 is 97G in size and 100% full

    What I would love to do, is backup the database, build a new back end, build a new mariadb server, import the db, build a new front end server. My infrastructure isn't going to grow much, so my questions are:
    how big do you suggest the 3 servers be cpu/mem/storage, I now know that i need to give the DB server a lot more hdd space
    not know a huge amount of linux - do i give the db server 2 drives, one for OS and a larger one just for the db?
    is it really as easy as importing the backup?
    If I am currently using debian, would it matter if i plan on doing everythign new on ubuntu (as far as the db backup is concerned?)

    Thank you in advance and thanks for excusing my newness I have come a long way in 4 months but this backup/lift and shift a database in linux is way beyond anything i've done in my break/fix career lol
  • ftb3
    Junior Member
    • Sep 2024
    • 8

    #2
    so i can't do the dump for the backup because i can't start mariadb lol
    if i am building new servers, what I am losing, if i backup zabbix, will my 7.0.3 dashboards at least copy over if i upgrade to 7.2?
    Last edited by ftb3; 23-12-2024, 18:36.

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Originally posted by ftb3
      my problem? I didn't account for database growth and put my frontend, backend, and db all on one debian box with a 100 GB hdd.
      You also apparently didn't set up monitors (or backups?) of your Zabbix server itself. You really want to do that, so you get warned as resource limits (like disk space) start to impact system performance or availability.

      As far as problem reporting, you didn't tell us what version of Zabbix or what version of the distro you're using. You mentioned "virtual disk" so we can assume you're hosting it in some virtualization environment, but you didn't tell us which one.

      Since you're in a virtualization environment, you should be able to add storage, either by expanding the existing virtual disk or by adding another virtual disk BUT which of these is better depends entirely upon how your existing install is configured.

      What would really help is having you run (as root or via "sudo")

      Code:
      sudo lsblk
      and include the output here. That will tell us how your system storage is laid out and what technologies are involved. The easiest way to solve the storage issue may differ if you're using just partitions vs. partitions with LVM or something more esoteric.

      You should already have 'lsblk' installed on the system, but if it somehow is not installed, you can copy just that binary from another system that's the same distro and version.

      If your lsblk output looks something like this:

      Code:
      $ sudo lsblk
      NAME           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
      sda              8:0    0   64G  0 disk
      ├─sda1           8:1    0    1G  0 part /boot
      ├─sda2           8:2    0   58G  0 part /
      ├─sda3           8:3    0    4G  0 part [SWAP]
      sr0             11:0    1 1024M  0 rom
      i.e. everything is installed on traditional partitions and they're all on one (virtual) disk, all you really need to do is expand the size of the virtual disk in your virtualization software and then use parted/gparted to adjust both the partitions and the existing filesystem within the partition. parted and gparted know how to do that for both the partition and MOST types of filesystems that would have been created within the partition. Note you can make the adjustments in two separate steps using something like fdisk for the partition table and resize2fs for an ext2/ext3/ext4 filesystem, but doing it that way is a little more dangerous, especially if your big partition isn't the last thing on disk.

      Assuming whatever virtualization technology you're using allows you to attach an ISO to an existing system image and treat it as a boot CD/DVD image, you probably want to get one of the rescue images from 'gparted.org'. If you can get that Live image added to your existing system image, you can boot off that and use the gparted GUI to easily grow the partition and the filesystem to use the new space you added to the virtual disk.

      If your lsblk output isn't just simple partitions, and there's LVM involved too, it's still possible to grow your space but the procedure might be different. It all depends upon how things are laid out and whether it's easier to add a second virtual disk to your system than it is to expand the existing vdisk.

      Note if you search these forums for 'parted' or 'gparted', you'll run into other posts where people have basically done the same thing, except they filled the disk on the Zabbix appliance. Reading some of those forum threads may be useful to you too.

      Originally posted by ftb3
      Today i'm getting the zabbix login error : Database error : no such file or directory
      which lead me to: mariadbd: Error writing file './ddl_recovery.log' (Errcode: 28 "No space left>

      which lead me to not knowing how to expand the virtual disk of linux server, reading on how to do that, had me figure out that i do not have fdisk installed: and i can't install it because : E: You don't have enough free space in /var/cache/apt/archives/.
      basically my /dev/sda1 is 97G in size and 100% full
      It's super weird to me that your system doesn't have fdisk already, it's a pretty core utility.

      You could potentially clean up some space on the existing system, there should be an "apt" or "dpkg" command to force it to clear all cached data and packages. You could also look in /var/log for any old logs that you don't need, and either scp them off the system to some other system (if you want to preserve them) or just 'rm' them to free space, but anything under /var/log with a .1.gz or .2.gz etc. would be good candidates if you need to clean some space.

      Originally posted by ftb3
      What I would love to do, is backup the database, build a new back end, build a new mariadb server, import the db, build a new front end server. My infrastructure isn't going to grow much, so my questions are:
      how big do you suggest the 3 servers be cpu/mem/storage, I now know that i need to give the DB server a lot more hdd space
      not know a huge amount of linux - do i give the db server 2 drives, one for OS and a larger one just for the db?
      is it really as easy as importing the backup?
      If I am currently using debian, would it matter if i plan on doing everythign new on ubuntu (as far as the db backup is concerned?)
      Importing the database backup gets you all the historical data and all the hosts you've configured in zabbix. Other than the /etc/zabbix/zabbix_serverd.conf and anything you might have put in /etc/zabbix/zabbix_serverd.conf.d/* , and then the config file for the web interface, everything else is in the database.

      If you can grow your virtual disk, expand your partition and grow the filesystem (both with gparted), then MariaDB will probably just restart. It may recover a journal or do some fixing on startup, but it's probably not catastrophically corrupted. Be sure to check the log file that the database server writes, to see if it suggests any manual actions.
      Last edited by tim.mooney; 24-12-2024, 07:07.

      Comment

      • ftb3
        Junior Member
        • Sep 2024
        • 8

        #4
        Thank you so much for your reply! I am learning and this isn't something are using in production, I've been tasked with learning it. So losing it, which sad, was something I'm ok with. (I do have backups of it, but I didnt' like the VM autodiscovery). I have a new version up and going and I have a totally bizarre issue now. 1/2 my servers aren't auto discovering (even if they are on the same subnet as ones that are auto discovering).
        All I did was power off my old zabbix (all in one), build a new application server, db server, and front end server. Spent two days cussing at mysql because I'm clueless, until i figured out how to set up the 'remote accounts' so that that app and front end could log into the database.
        Now though lol
        "Cannot send list of active checks to <enter ip here>: host [host name here] not found."

        These errors are coming so fast it's crashing the zabbix-server agent :
        but again, I could have 2 boxes on the same subnet one works, one doesn't, they are exactly as they were when they both talked to the old application server, all i did was a fresh ubuntu 24.04 install, and new zabbix/db/front in. I'm completely confused

        Comment

        Working...