CrossRealms / Splunk-App-Auto-Update-MaxMind-Database

Splunk App that auto updates the max-mind database (used for iplocation command)
10 stars 3 forks source link

Support for Indexer Cluster and Distributed Environment #9

Closed VatsalJagani closed 1 year ago

VatsalJagani commented 2 years ago
VatsalJagani commented 2 years ago

Currently following are the problems for distributing limits.conf and db file to Indexer Cluster:

sclapper commented 1 year ago

If you make the following changes you can avoid using limits.conf, it will replicate to indexers and works in cloud. bin/mmdb_utils.py 22 MMDB_FILE_NAME = 'GeoIP2-City.mmdb' 25 DB_DIR_PATH = '/opt/splunk/etc/apps/search/lookups’ 117 #self.update_mmdb_location()

VatsalJagani commented 1 year ago

@sclapper - I don't think on indexer the location of the lookup would be same. It would be under /opt/splunk/var/run/ folder instead which would be a problem.

sclapper commented 1 year ago

/opt/splunk/etc/apps/search/lookups is just the path where you put GeoIP2-City.mmdb, just need to write the mmdb to ..search/lookups/GeoIP2-City.mmdb and it will replicate.

VatsalJagani commented 1 year ago

@sclapper - Yes that is accurate it will replicate, but the location on the indexer would not be /opt/splunk/etc/apps/search/lookups. It would something like this: /opt/splunk/var/run/searchpeers/splunkui111-1324253269/apps/search/lookups. Path would have dynamic number with it (replicated bundle number)

So how would you assign a path in the limits.conf for the indexer? Also, the path for the indexer and search head would be different so you need to write different limits.conf for search head and indexer, which is not possible in Splunk cloud.

sclapper commented 1 year ago

This method doesn’t require using limits.conf, Test it out.

dave-safian-kyndryl commented 1 year ago

When you update the database using this method (as a lookup) https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Iplocation#Updating_the_IP_geolocation_database_file

It gets written to the splunk_dir/etc/apps/search/lookups dir and it gets distributed to the indexers. I believe this is a new feature in Splunkv9 but has been available in Splunk cloud for a while longer.

VatsalJagani commented 1 year ago

@sclapper, @kyndsafian - Thanks for your suggestion and comments. We're working on this to improve for both enterprise and cloud by using this new feature.

VatsalJagani commented 1 year ago

@sclapper , @kyndsafian - Thanks for your suggestion and guidance.

We have implemented the change here - https://github.com/CrossRealms/Splunk-App-Auto-Update-MaxMind-Database/pull/13 We have tested the approach it's working in SHC.

Currently, we are resolving one other issue with SHC - Other SHs opening the setup page even after App setup is completed on one SH, and app.conf is_configured parameter is also replicated to other SHs. Once that is resolved, we'll create a new release of the App.

Really appreciate your comments here.

VatsalJagani commented 1 year ago

App version 2.0.0 has been released with proper support of the Search Head Cluster, Distributed environment, and Splunk Cloud Classic and Victoria experience. https://splunkbase.splunk.com/app/5482

Thanks for everyone's suggestions and support. @sclapper , @kyndsafian