Project

General

Profile

Bug #12937

Updated by François ARMAND almost 4 years ago

With Rudder 4.1, some inventories are painfully slow to process 
 Checking the logs, in trace, it shows 
 <pre> 
 [2018-07-11 16:50:35] DEBUG com.normation.inventory.services.provisioning.NodeInventoryDNFinderService - Server Id 'NodeId(YYYYYYY-YYYYYYY-YYYYYYY-YYYYYYY-YYYYYYY)' found in DIT 'AcceptedInventory' with id finder 'use_existing_id' 
 [2018-07-11 16:50:35] DEBUG com.normation.inventory.services.provisioning.MachineDNFinderService - Processing machine id finder use_existing_id 
 [2018-07-11 16:50:35] DEBUG com.normation.inventory.services.provisioning.MachineDNFinderService - Processing machine id finder check_mother_board_uuid_accepted 
 [2018-07-11 16:50:35] DEBUG com.normation.inventory.services.provisioning.MachineDNFinderService - Machine Id 'MachineUuid(XXXXX-XXXXX-XXXXX-XXXXX-XXXXX)' found with id finder 'check_mother_board_uuid_accepted' 
 [2018-07-11 16:50:35] TRACE com.normation.inventory.ldap.provisioning.DefaultReportSaver - Precommit 'pre_commit_inventory:merge_uuid': 30645 ms 
 [2018-07-11 16:50:35] TRACE com.normation.inventory.ldap.provisioning.DefaultReportSaver - Precommit 'pre_commit_inventory:check_machine_cn': 0 ms 
 [2018-07-11 16:50:35] TRACE com.normation.inventory.ldap.provisioning.DefaultReportSaver - Precommit 'pre_commit_inventory:set_last_inventory_date': 0 ms 
 [2018-07-11 16:50:35] TRACE com.normation.inventory.ldap.provisioning.DefaultReportSaver - Precommit 'pre_commit_inventory:add_ip_values': 0 ms 
 [2018-07-11 16:50:35] TRACE com.normation.inventory.ldap.provisioning.DefaultReportSaver - Precommit 'pre_commit_inventory:log_inventory': 0 ms 
 [2018-07-11 16:50:35] TRACE com.normation.inventory.ldap.provisioning.DefaultReportSaver - Pre commit report: 30647 ms 
 </pre> 

 There is no reason for such check to be so slow. 

 h3. H3. WORKAROUND 

 It may helps to delete unreferenced software, and perhaps the batch that should do that is in error (you can @grep unreferenced /var/log/rudder/webapp/*@ to see if there is errors or a lot of them) 

 You can do it manually:  

 So,  
 so, first, MAKE A BACKUP OF YOUR LDAP: https://docs.rudder.io/reference/6.2/administration/procedures.html#_migration_backups_and_restores 

 Then, create find all unused software. Create de directory for work, and go in it. Then: 

 - create a directory for work, and go in it. Then: 
 - all softwares:  
 <pre> 
 ldapsearch -LLL -o ldif-wrap=no -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w LDAP_PASS_FROM_rudder-passwords_file -b "ou=Software,ou=Inventories,cn=rudder-configuration" -s sub 1.1 | sort | uniq | cut -d: -f2 > all-soft-sorted.dns 
 </pre> 
 - softwares used in accepted nodes:  
 <pre> 
 ldapsearch -LLL -o ldif-wrap=no -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w LDAP_PASS -b "ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration" -s one 'nodeId=*' software | grep softwareId | sort | uniq | cut -d: -f2 > nodes-soft-sorted.dns 
 </pre> 
 - software to delete (ie all - nodes):  
 <pre> 
 grep -f nodes-soft-sorted.dns -v all-soft-sorted.dns > soft-to-delete.dns 
 </pre> 
 - then delete unreferenced:  
 <pre> 
 ldapdelete -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w LDAP_PASS -f soft-to-delete.dns 
 </pre> 

Back