Hi all! I deployed fleet on kubernetes, and I hav...
# fleet
o
Hi all! I deployed fleet on kubernetes, and I have a lot of hosts connected to it (about 19k). My DB is stacked with a lot of information because of this, and I noticed that I have A LOT of duplicate hosts in my DB: SELECT count(uuid) from hosts; returns 26342, and SELECT count(DISTINCT uuid) from hosts; (to get count of unique values) returns 19360. So there's about 7k duplicate hosts I belive. This causes my fleet web UI to be really slow. Any tips on how to manage this correctly and remove those duplicate hosts?
d
Hey @Ortal Kombat, I'm looking into this for you. Can you please let me know what version of Fleet you're running?
o
4.50.0
I have this issue for a while now, and I upgraded to this version today from 4.38.0
d
Are you using fleetd in your deployment?
o
No
d
o
Yes --host_identifier=instance
d
I think using
instance
is likely the cause of the duplicate records. Every time osquery is or the osquerydb is deleted, a new instance-unique uuid is generated and Fleet will treat it as a unique host record
Are you enrolling VMs?
o
Yes, I enroll VMs
So changing it to 'hostname' should solve this?
d
I actually think with VMs in your environment, it might be best to leave the identifier set to
instance
. We want to avoid a a separate issue where VMs with the same hostname or UUID would fail to check in and would re-enroll over each other
Are the duplicate host records your'e seeing all VMs?
With VMs it's expected you'll see multiple hosts with the same UUID. I'd recommend continuing to use
instance
as your identifier but set up host expiry on your server to automatically remove hosts that haven't checked in in a while: https://fleetdm.com/docs/configuration/configuration-files#host-expiry-settings
o
No, actually most of them are physical computers. But a lot of them really didn't communicate with fleet in a while, so I think setting the host expiry will do help, I'll try that
Thanks a lot! I'll let you know if it helped or not
d
Sounds good! Keep us posted
o
I set the host expiry to 21 days and it cleaned a really big portion of records from the hosts table. I also set the max activities age to 30 days. This really helped and my Fleet UI now runs much better. Thanks a lot for the help @Dale Ribeiro!
d
That's great, glad to hear it!