Question

Problem with my /var/lib/mysql space disk

  • 8 July 2022
  • 8 replies
  • 3126 views

Userlevel 2
Badge +8

Hi I have a problem with my /var/lib/mysql space disk it is almost full and when its full everything will be down, which file can I remove or what can I do to solve this problem ?

 


8 replies

Userlevel 6
Badge +19

Hi, 

 

Check the disk space required to run Centreon here: https://docs.centreon.com/docs/installation/prerequisites/#define-disk-space

 

/var/lib/mysql is holding all your centreon configuration and data, from what I see it’s far too small! 


Simon

Userlevel 2
Badge +8

Hi, 

 

Check the disk space required to run Centreon here: https://docs.centreon.com/docs/installation/prerequisites/#define-disk-space

 

/var/lib/mysql is holding all your centreon configuration and data, from what I see it’s far too small! 


Simon

How can I change It right now ? I have only 100 service to monitor

Userlevel 2
Badge +8

I have found a solution


GXw5iGRWSYWzlrfPi9KpKJcZqi5byyIEGdixr1-_RALy9xtgKikPeBbYerBpFAG85gXlOJjUQxuAK14C_RD1kFXQUy5bwks9g87GMgRtdKTwc-gB3gQpQ4T9AIJazcd7gvqJegUn0JVNM1SDgMs

U7eThrFaiXfRBGjp1_fTWegIdnwn-RzRygA_4lf6yjJhzKydHg4Ymh8XJlHlzaNO9sbw1ip3KHvWGi_RgO29_LZSga_XSA4piRw4EpOm7k9rCHCw2afBlIg_1Q3eQX46xWDEkulOX0BkbWM66kw

K-QCOG8Z81zaTilU1e9c62dHfiVi-kRKuNnAMpf2Zczi3Atk7AtwybNqVhDmKVcSDllko-bFRFmGom0ufPm3sXHv0ILYBCLiUUrW9mNb2wEQADt2QHy97aLlOc-qwOEbl8gVQrdzUP-nPaZHadE

Userlevel 3
Badge +8

Hi,

Even 3.5Gb is really too small. How many hosts do you want and how many checks per host ?

And look the BDD datas retention. Default is 6 months.

 

For example, I have :

800 hosts and 8200 services, with 3 months BDD retention.

With this, my BDD size is 47Gb, and it’s not so big.

 

You have to estimate the final number of hosts/services/retention you want to size your BDD volume.

As @sims24 said, use the prerequisites link to help you with the sizing.

Another tips ( if your BDD is on the central server ):

create a logical volume for /var/lib/centreon. 

It will be used for all metrics (rrd files ), and it consumes disk space ( 27Go for me ). 

Use different logical volume. Here is for example my volumes.

It’s the first thing to do when you install a central, estimate the sizing with documentation help

Userlevel 2
Badge +8

Hi,

Even 3.5Gb is really too small. How many hosts do you want and how many checks per host ?

And look the BDD datas retention. Default is 6 months.

 

For example, I have :

800 hosts and 8200 services, with 3 months BDD retention.

With this, my BDD size is 47Gb, and it’s not so big.

 

You have to estimate the final number of hosts/services/retention you want to size your BDD volume.

As @sims24 said, use the prerequisites link to help you with the sizing.

Another tips ( if your BDD is on the central server ):

create a logical volume for /var/lib/centreon. 

It will be used for all metrics (rrd files ), and it consumes disk space ( 27Go for me ). 

Use different logical volume. Here is for example my volumes.

It’s the first thing to do when you install a central, estimate the sizing with documentation help

Hi, thank for your answer ! In the futur I will be carefull with my disk volumes, but right now Im only monitoring 20 hosts and 100 services, later if I want to add more space to my /var/lib/mysql using the VGS memory is the only way to do that or there other better way to do it ?

Userlevel 3
Badge +8

Hi,

Yes, if you want to increase a LVM volume, use lvresize command, if tou have enough free space on your volume group ( vgdisplay to see the free space ).

 

If you don’t have enough free space to do the logical volume extend, add a new disk ( if your server is a VM ) and add the new disk to the volume group.

Userlevel 2
Badge +8

Hi,

Yes, if you want to increase a LVM volume, use lvresize command, if tou have enough free space on your volume group ( vgdisplay to see the free space ).

 

If you don’t have enough free space to do the logical volume extend, add a new disk ( if your server is a VM ) and add the new disk to the volume group.

How can I add a new disk on a VM ? because I have only 2,51GiB free right ?

Userlevel 3
Badge +8

Sorry for the delay, I was out of office.

  1. Add a new disk to the VM in your Vcenter ( ex 50 or 100gb )
  2. Make the kernel detect the new disk
echo "- - -" >/sys/class/scsi_host/host0/scan
echo "- - -" >/sys/class/scsi_host/host1/scan
echo "- - -" >/sys/class/scsi_host/host2/scan
  1. Verify if you see the new disk
fdisk -l
  1. create a new PV for LVM ( ex: if the new disk is /dev/sdc )
pvcreate /dev/sdc
  1. Add the new PV to the VolumeGroup which contains the volume you want to extend ( ex: if the VG name is “rootVG” )
vgextend rootVG /dev/sdc
  1. Vérify the new free space in your VolumeGroup ( Free PE / size  )
vgdisplay
  1. Extend the LogicalVolume you want ( ex with varLV )
lvresize --resizefs --size +50G /dev/rootVG/varLV

 

Reply